Last 12 weeks · 9 commits
2 of 6 standards met
#19/#20 swapped the spread here for a property-descriptor copy so Svelte's hidden / pointers survived clones. Svelte removed those pointers after sveltejs/svelte#14204 (a clone's back-reference is stale by construction) and now keeps that data in , and s. No other dependent puts non-enumerable properties on nodes. A parent is now spread once, on its first transformed child, the same way arrays are already sliced; clones carry own enumerable properties only. Closes #32 (fixed by #37, regression test added).
Summary Adds an optimized export for analysis passes that only inspect the tree without transforming it. What's different from No mutation tracking — no object, no checks, no calls No return values — visitors return , context.visit/next return No object spreads in the universal visitor path — when both and a specialized visitor exist, the context object is mutated in-place instead of creating spread copies Shared path array — single array across the entire walk instead of passing through every recursive call Types New exports: , , These mirror the existing // types but with return types, making it a type error to accidentally return replacement nodes from a read-only walk. Benchmark (in Svelte compiler) Switching 7 analysis-phase files from to in the Svelte compiler gives ~20% faster compilation: Tests 6 new tests covering: Basic traversal Universal + specialized visitor interaction State passing through universal visitor Path correctness with Path correctness with halting traversal All 17 tests pass (11 existing + 6 new). 🤖 Generated with Claude Code
Repository: sveltejs/zimmerframe. Description: A tool for walking Stars: 122, Forks: 11. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v1.1.5 (4w ago). Open PRs: 3, open issues: 3. Last activity: 2w ago. Community health: 50%. Top contributors: Rich-Harris, dummdidumm, github-actions[bot], Nic-Polumeyv, Ocean-OS, baseballyama.