Releases: delph123/supplejs
Releases · delph123/supplejs
v1.3.0 / v1.3.1 - Effectless Components
What's New
- Support effectless components in #31
A new API for components is supported
Old convention of returning an effect from a component, even when the effect does not consume any signal directly, will continue to work:
function CounterButton() {
const [count, setCount] = createSignal(0);
return () => (
<button onClick={() => setCount(count() + 1)}>{count}</button>
);
}
But effectless components are now also supported, providing a more easy coding path:
function CounterButton() {
const [count, setCount] = createSignal(0);
return <button onClick={() => setCount(count() + 1)}>{count}</button>
}
Bugfix
- Cleanup elements when disposing iterators in #30
Miscellaneous
- Use supplejs-testing-library in #28
Full Changelog: v1.2.2...v1.3.1
v1.2.2
v1.2.1
v1.2.0 - Compatibility with TSX & react-jsx transform
What's New
- Add global typing for JSX namespace with TypeScript in #24
- Typing for HTML tag (
<div />
) - Typing for custom components (
<App />
) - Typing for children (
<Title>SuppleJS {version}</Title>
) - Typescript no longer emits an error when noImplicitAny is true at each usage of JSX!
- Typing for HTML tag (
- createDeferred: API to notify changes when browser is idle in #25
- Support for react-jsx transform in TS (thanks to addition of
./jsx-runtime
module andjsx
,jsxs
andjsxDEV
transforms)
New API to support deferred changes notifications:
createDeferred(source: () => T, { equals?: false | ((prev: T, next: T) => boolean), timeoutMs?: number }): () => T
Bugfix
- Prevent consumption of internal API by importing from "supplejs/lib/xxx" (exports declaration in package.json)
Miscellaneous
- Merged SuppleNode, SuppleChild & SuppleChildren - SuppleJS Nodes can be anything from a simple element to a function or an array
Full Changelog: v1.1.0...v1.2.0
v1.1.1
Add package exports
Package exports allows to declare modules exported by this package, same as "main" but in a more modern way.
It also prevents library consumers from consuming exported elements from nested modules (lib/context.js)
Full Changelog: v1.1.0...v1.1.1
v1.1.0
v1.0.5
v1.0.0 - MVP
What's New
- Error management in #20
New APIs to support error management:
catchError<T>(tryFn: () => T, onError: ErrorHandler): T | undefined
<ErrorBoundary fallback={(err: any, reset: (() => void)) => SuppleNode}>{children}</ErrorBoundary>
Bugfix
- Fix unit tests on memo to avoid printing error in #17
- Fix context provider to support signal in component body
- Add return type to all API contract in #19
Documentation
render()
createRenderEffect()
Miscellaneous
- Bump ws from 8.17.0 to 8.17.1 by @dependabot in #18
Full Changelog: v0.9.0...v1.0.0
v0.9.0 - Context
What's New
- [v0.9] Support context (create and use context from higher up the tree) in #10
New APIs to support context
function createContext<T>(defaultValue?: T): Context<T> {}
function useContext<T>(context: Context<T>): T {}
interface Context<T> {
id: symbol;
Provider: (props: { value: T; children?: SuppleChildren }) => SuppleNodeEffect;
defaultValue: T;
}
Full Changelog: v0.8.1...v0.9.0