1.6.0: Use microtask queue for state derivation and DOM binding #466
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.
-
Hi fellow VanJSers,
I'm happy to announce the release of VanJS
1.6.0
. 🎉🎉🎉✨ What's in the release?
In VanJS state derivation and DOM binding are done asynchronously. Previously, we're using
setTimeout(updateDoms)
thus the state derivation and DOM updates are scheduled in the macrotask queue. In this release, we changed it fromsetTimeout(updateDoms)
toqueueMicrotask(updateDoms)
so that the state derivation and DOM updates are scheduled in the microtask queue.We believe this change will benefit us in the following aspect:
2
is guaranteed to be printed. Whereas before this release, we have to wait forupdateDoms
to run in macrotask queue which is somewhat undeterministic.With this improvement, the bundle sizes increase slightly. Gzipped bundle increases to
1076 bytes
(1.0kB) from1059 bytes
(1.0kB) (17 bytes
increase), while minified bundle increases to2066 bytes
(2.0kB) from2046 bytes
(2.0kB) (20 bytes
increase) - still being the smallest reactive UI framework in the world.❤️ Hope you can enjoy!
Thanks @cubxx and @sirenkovladd for the ideas!
Beta Was this translation helpful? Give feedback.
All reactions