Releases: vanjs-org/van
1.2.5: Enable auto-completion for the `props` parameter of tag functions
Improved the type definition in van.d.ts
to enable auto-completion for the props
parameter of tag functions.
See the release announcement: #114 (comment)
1.2.4: Fix the incompatibility issue between `van.debug.js` and VanX
See the release announcement: #114 (comment)
1.2.3: `van.d.ts` type simplification
Simplify van.d.ts
for the type definition of tag functions with the help of HTMLElementTagNameMap
. Thanks @yahia-berashish for the idea!
1.2.2
was skipped due to faulty release.
See the release announcement: #114 (comment)
1.2.1: Improved type system in `van.d.ts`
A minor release with changes to van.d.ts
to improve VanJS's type system:
- The binding function for state-derived child nodes is now taking the type
((dom?: Node) => ValidChildDomValue) | ((dom?: Element) => Element)
. - Specialize the return types of tag functions for more known tag names. Specifically,
1.2.1
added specialized return types for tags ofHTMLElement
type.
See the release announcement: #120
1.2.0: Hydration support added (with only 12 more bytes)
- New API
van.hydrate
that allows us to hydrate a SSR component into a CSR component with added reactivity while preserving all the server-side states. Sample usage:
van.hydrate(document.getElementById("basic-counter")!, dom => Counter({
van,
id: dom.id,
init: Number(dom.getAttribute("data-counter")),
}))
- Change
van-{VERSION}.debug.js
to allow string values inon...
properties of tag functions, if the properties are used to set HTML attributes (viasetAttribute
) of the DOM element. This is crucial for cross-platform UI components to specify event handlers, as for SSR, only string-valuedon...
event handlers can be visible in the rendered HTML strings. You can refer to https://vanjs.org/ssr#on-properties for a detailed explanation. - Fix some type definitions in
van.d.ts
:- For state-valued child nodes, restrict the types of
val
property toPrimitive | null | undefined
(DOM-node-valued states are not allowed anymore). This is because DOM-node-valued states have problematic behavior and should be generally avoided, see https://vanjs.org/advanced#why-not-dom-valued-states for more information. - For state-derived child nodes, the binding function should be of type
(dom: Node | undefined) => ValidChildDomValue
(changed from(dom: Node) => ValidChildDomValue
), as it needs to handle to case where thedom
parameter isundefined
(when the binding function is invoked for the first time). - Simplify the type definition of
Props
with built-in typeRecord
.
- For state-valued child nodes, restrict the types of
See the release announcement: #114
1.1.3: small adjustments to van.d.ts and van.debug.js
1.1.3
is a minor release. Here are the changes:
- Simplify
van.d.ts
by using TypeScript built-in types - Unify the style in
van.debug.js
There is no change in the implementation of van.js
file.
Version 1.1.1
and 1.1.2
are skipped as the published NPM packages have some minor issues in van.d.ts
file.
See the release announcement: #81 (comment)
1.1.0: A big improvement on GC
The garbage collection mechanism in VanJS was revamped in 1.1.0
. In this overhaul, we improved the GC handling for derived states and side effects registered inside DOM binding functions to avoid some unnecessary constraints while defining derived states and side effects.
See the release announcement: #81
1.0.2: avoid the duplicate execution of Object.getPrototypeOf in tag functions
1.0.2
is a minor release. This release contains an optimization to avoid the duplicate execution of Object.getPrototypeOf
in tag functions.
This optimization increases the bundle size slightly: the size of .min.js
is 1630 bytes (4 more bytes compared to 1.0.1
); and the size of .min.js.gz
is 928 bytes (2 more bytes compared to 1.0.1
).
See the release announcement: #72 (comment)
1.0.1: Rename a parameter to keep the style consistent
This is a minor release. In this release, we renamed a parameter to keep the style consistent in source file van.js
. There was no change in the actual implementation.
Thanks @tolluset for the contribution!
See the release announcement: #72 (comment)
1.0.0: Milestone for API stability
A major milestone with the commitment of API stability and forward compatibility for future releases.
What's new?
- More intuitive API for complex state binding: State-derived properties and State-derived child nodes
- Unified API for derived states, side effects and advanced derivations:
van.derive
- NPM support
- Supports
null
as a valid property value for tag functions - More graceful behavior for invalid property values provided in tag functions
- More graceful behavior if an error is thrown in the binding function
- A new demo application:
package-lock.json
inspector (in 28 lines) - Performance optimizations
See the release announcement: #72