Performance & caching
VSN.js favors small runtime work and caches parsed behaviors to avoid re-parsing.
Behavior caching
Behavior ASTs are cached so repeated mounts don’t re-parse the same source.
Mutation observer
VSN watches the DOM and re-evaluates only affected elements. Debouncing helps avoid thrashing.
Tips
- Keep behaviors scoped to specific selectors.
- Avoid heavy work inside
onhandlers; prefer small functions. - Use
vsn-getfor partial updates rather than full reflows.