cleanup: drop zimmerframe devDep and the seen-set idempotency guard#50
Closed
NullVoxPopuli-ai-agent wants to merge 1 commit intoNullVoxPopuli:mainfrom
Closed
Conversation
zimmerframe is no longer used since the walker switched to visitorKeys in NullVoxPopuli#49. This cleans up the remaining traces: - Drop zimmerframe from devDependencies. - Rewrite tests/glimmer-comments.test.js to use toTree's visitors API instead of importing `walk` from zimmerframe. - Update stale comment in tests/custom-parser-ts.test.js. - Remove the `seen` WeakSet from walkWithKeys. The `seen` guard existed because zimmerframe's `for (const key in node)` could follow enumerable parent back-links and revisit a node. The visitorKeys walker only follows declared child slots, so this class of double-fire is no longer reachable. Visitors that relocate nodes into non-child slots (e.g. program.comments) still never revisit because those slots aren't in visitorKeys either. All 189 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
this is still useful for testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zimmerframe is no longer used since the walker switched to
visitorKeysin #49. This cleans up the remaining traces and removes theseenWeakSet, which guarded against a double-fire case that the new walker can't reach.Changes
zimmerframefromdevDependencies. Not independenciessince perf: drop zimmerframe from outer-AST walk, always use visitorKeys #49.tests/glimmer-comments.test.jsto usetoTree'svisitorsAPI instead of importingwalkfrom zimmerframe. Same assertions, same coverage.tests/custom-parser-ts.test.js(was referencing zimmerframe's cloning behavior).seenWeakSet fromwalkWithKeys. The guard existed because zimmerframe'sfor (const key in node)could follow enumerable parent back-links and revisit a node. The visitorKeys walker only follows declared child slots, so this class of double-fire is no longer reachable. Visitors that relocate nodes into non-child slots (e.g.program.comments) still never revisit because those slots aren't invisitorKeyseither.Perf impact
Tiny. The
seenset was costing ~0.3% of parse time in ember-eslint-parser's bench (WeakSet.add on every outer-AST node). Dropping it trims that.Test plan
moves a Glimmer comment into program.comments and removes it from the template) still passes — it moves intoprogram.comments, which isn't invisitorKeys, so the walker never revisits.🤖 Generated with Claude Code