Vanjs Org Van Versions Save

🍦 VanJS: World's smallest reactive UI framework. Incredibly Powerful, Insanely Small - Everyone can build a useful UI app in an hour.

1.5.0

2 months ago

1. Optimization on state derivations

Major optimization on how state derivations are being executed. For instance, with the code:

const a = van.state(3), b = van.state(5)
const s = van.derive(() => a.val + b.val)

If we have:

++a.val
++b.val

s will be derived only once.

And if we have:

++a.val
--a.val

The derivation of s will be skipped since a remains unchanged after ++a.val and --a.val.

2. rawVal property for State objects

rawVal property for State objects for getting the current value of the State object (peeking) without registering the state as a dependency of the binding function. For instance, the derived state: van.derive(() => a.rawVal + b.val) will be updated when b changes, but won't be updated when a changes.

1.4.1

2 months ago

1.4.0

2 months ago

Simplify VanJS API by deprecating 4 rarely used functions:

  • van.tagsNS is merged into van.tags
  • van._ can be replaced by van.derive
  • van.val and van.oldVal are deprecated and can be replaced by client-side solution like: https://vanjs.org/tutorial#polymorphic-binding
  • Support van.state() in TypeScript to create dummy or uninitialized State objects

See the release announcement: https://github.com/vanjs-org/van/discussions/280

1.3.0

2 months ago

Improve the dependency detection in binding functions to avoid self-referencing side effect triggering infinite loop.

With this release, the following code will work perfectly:

van.derive(() => {
  if (checked.val) ++numChecked.val
})

See the release announcement: https://github.com/vanjs-org/van/discussions/275

1.2.8

3 months ago

In this release, we changed the implementation of event handlers in VanJS. Instead of registering event handlers via on... property, we changed to use addEventListener and removeEventListener to register and unregister event handlers.

As a result of the change, you can set custom event handlers via tag functions:

const {button, div, p} = van.tags

const dom = div(button({oncustom: () => van.add(dom, p("Event triggered!"))}, "Button"))
van.add(document.body, dom)

dom.querySelector("button").dispatchEvent(new Event("custom"))

See the release announcement: https://github.com/vanjs-org/van/discussions/246

1.2.7

5 months ago

In this release, we export 2 more types: Val and PropsWithKnownKeys in van.d.ts. Thanks @DanielMazurkiewicz for the contribution!

See the release announcement: https://github.com/vanjs-org/van/discussions/114#discussioncomment-7849992

1.2.6

6 months ago

1.2.5

6 months ago

Improved the type definition in van.d.ts to enable auto-completion for the props parameter of tag functions.

See the release announcement: https://github.com/vanjs-org/van/discussions/114#discussioncomment-7399324

1.2.4

6 months ago

1.2.3

6 months ago

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: https://github.com/vanjs-org/van/discussions/114#discussioncomment-7330296