0.12.0: Polymorphic binding, SVG/AutoML support, readonly properties, performance optimizations, etc. #53
Replies: 4 comments
-
0.12.1 was just released. 0.12.1 is a minor release of VanJS. In this release, we support |
Beta Was this translation helpful? Give feedback.
-
0.12.2 was just released. 0.12.2 is a minor release of VanJS, here are the changes:
|
Beta Was this translation helpful? Give feedback.
-
0.12.3 was just released. 0.12.3 is a minor release of VanJS. In this release, we disallow As of 0.12.3, Supporting |
Beta Was this translation helpful? Give feedback.
-
0.12.4 was just released. 0.12.4 is a minor release. In this release, we fixed a typo in the comments of |
Beta Was this translation helpful? Give feedback.
-
Hi fellow VanJSers,
I'm happy to announce the release of VanJS
0.12.0
. 🎉🎉🎉0.12.0
is a major release, with the implementation of several long-waited features as well as some performance optimizations.1. Polymorphic binding
If you use VanJS to build reusable components, it's desirable for the users to specify both state and non-state property values while building the components. For instance, for a reusable
Button
component like that:it would be desirable for
Button
to accept both staticcolor
value andcolor
state. If the property value is being used as the property value of a DOM element, or as a child node, things can work out of the box. However, prior to this release, State-derived properties andvan.bind
only support state objects as dependencies, which means if thecolor
property is used like that:you can only pass-in state objects for
color
property, as non-state objects won't work for State-derived properties. This release solves the issue by allowing both state and non-state property values being used as dependencies for State-derived properties andvan.bind
. With this feature, you can build both static and dynamicButton
components:Try on jsfiddle
2. SVG/MathML support
In this release, we introduce a new function
van.tagsNS
to support the creation ofSVG
,MathML
or other HTML elements withnamespaceURI
. For instance, you can build a smiley face withSVG
elements now:Try on jsfiddle
and also math formulas with
MathML
elements:Try on jsfiddle
Great thanks to @andrewgryan for providing the intial draft implementation of this feature.
3. Support readonly properties while creating HTML elements
Prior to this release, readonly properties of HTML elements (e.g.: the
list
property of an<input>
element) can't be set properly. This release solves the problem. Thus the code below will work now:Try on jsfiddle
4. Performance optimizations
In this release, we replace
forEach
call withfor (... of ...)
loops for better performance. Meanwhile, we disable theterser
optimization forwrap_func_args
as the optimization is obsolete in newer browser versions.With all the added features and performance optimizations, the minimized bundle size increases slightly to
1.3kB
(1365 bytes
), while still holding the title of the smallest reactive UI framework in the world.❤️ Hope you can enjoy!
Beta Was this translation helpful? Give feedback.
All reactions