Last 12 weeks ยท 0 commits
2 of 6 standards met
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: 110, Forks: 10. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v1.1.4 (5mo ago). Open PRs: 2, open issues: 2. Last activity: 5mo ago. Community health: 50%. Top contributors: Rich-Harris, dummdidumm, github-actions[bot], Ocean-OS, baseballyama.
at the end of next() function, it calls apply_mutations() to return the mutated node.(line 87-89 in walk.js) but, in visit() function, it do the same thing.(line 133-137 in walk.js) so, if calling next() in a visitor and this node's child is mutated, apply_mutations() will be called twice. i think the return value in next() function is unnecessary.