VanX 0.5.0: Better console debugging for reactive objects #300
Replies: 2 comments
-
VanX Users are advised to upgraded to VanX Bundle size changes slightly with the bug fix. Gzipped bundle increases to |
Beta Was this translation helpful? Give feedback.
-
VanX Bundle size changes slightly with the bug fix. Gzipped bundle decreases to |
Beta Was this translation helpful? Give feedback.
-
Hi fellow VanJSers,
I'm happy to announce the release of VanX
0.5.0
. 🎉🎉🎉In this release, we did substantial refactor to the internal implementation of VanX. The most notable improvement is to enable better debugging support for reactive objects when they are logged via
console.log
. Specifically, when reactive objects are logged viaconsole.log
, the proxy target will be displayed in the console. Prior to VanX0.5.0
, the proxy targets of reactive objects are the input objects, whose field values won't be kept in sync with changes of the underlying states in the reactive objects. This can cause confusion, e.g.: #298 (comment). VanX0.5.0
improves the situation by making underlying states as the proxy targets of reactive objects. With this change, whenever reactive objects are logged viaconsole.log
, you will see the underlying states in the console, with the most up-to-date values.As an example, here is what you will see when you log a reactive array in the console:
With this refactor, the bundle size of VanX changes slightly. Gzipped bundle increases to
1122 bytes
(1.1kB) from1106 bytes
(1.1kB) (16 bytes
increase), while minified bundle decreases to2187 bytes
(2.1kB) from2191 bytes
(2.1kB) (4 bytes
decrease) - still being an ultra-lightweight extension to VanJS.❤️ Hope you can enjoy!
Beta Was this translation helpful? Give feedback.
All reactions