Skip to content

cleanup: drop zimmerframe devDep and the seen-set idempotency guard#50

Closed
NullVoxPopuli-ai-agent wants to merge 1 commit intoNullVoxPopuli:mainfrom
NullVoxPopuli-ai-agent:cleanup/drop-zimmerframe-and-seen
Closed

cleanup: drop zimmerframe devDep and the seen-set idempotency guard#50
NullVoxPopuli-ai-agent wants to merge 1 commit intoNullVoxPopuli:mainfrom
NullVoxPopuli-ai-agent:cleanup/drop-zimmerframe-and-seen

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown

Summary

zimmerframe is no longer used since the walker switched to visitorKeys in #49. This cleans up the remaining traces and removes the seen WeakSet, which guarded against a double-fire case that the new walker can't reach.

Changes

  • Drop zimmerframe from devDependencies. Not in dependencies since perf: drop zimmerframe from outer-AST walk, always use visitorKeys #49.
  • Rewrite tests/glimmer-comments.test.js to use toTree's visitors API instead of importing walk from zimmerframe. Same assertions, same coverage.
  • Update stale comment in tests/custom-parser-ts.test.js (was referencing zimmerframe's cloning behavior).
  • Remove the seen WeakSet from walkWithKeys. The 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.

Perf impact

Tiny. The seen set 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

  • All 189 existing tests pass
  • The relocation test (moves a Glimmer comment into program.comments and removes it from the template) still passes — it moves into program.comments, which isn't in visitorKeys, so the walker never revisits.

🤖 Generated with Claude Code

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>
@NullVoxPopuli
Copy link
Copy Markdown
Owner

this is still useful for testing

@NullVoxPopuli NullVoxPopuli deleted the cleanup/drop-zimmerframe-and-seen branch April 24, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants