1.2.8: Add support for custom event handlers #246
Tao-VanJS
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi fellow VanJSers,
I'm happy to announce the release of VanJS 1.2.8. 🎉🎉🎉
In this release, we changed the implementation of event handlers in VanJS. Instead of registering event handlers via
on...
property, we changed to useaddEventListener
andremoveEventListener
to register and unregister event handlers.As a result of the change, you can set custom event handlers via tag functions:
Try it out here: https://jsfiddle.net/dupc9oaz/.
Furthermore, we believe adding the support of custom event handlers will enable more seamless integration between VanJS and custom web components. (#2).
With the new feature, the bundle size increases slightly. Gzipped bundle increases to
1021 bytes
(1.0kB) from970 bytes
(0.9kB), while minified bundle increases to1831 bytes
(1.8kB) from1729 bytes
(1.7kB) - still being the smallest reactive UI framework in the world.❤️ Hope you can enjoy!
Beta Was this translation helpful? Give feedback.
All reactions