Clean up scope bag, wire format, and debug render tree#21232
Open
NullVoxPopuli-ai-agent wants to merge 2 commits intoemberjs:mainfrom
Open
Clean up scope bag, wire format, and debug render tree#21232NullVoxPopuli-ai-agent wants to merge 2 commits intoemberjs:mainfrom
NullVoxPopuli-ai-agent wants to merge 2 commits intoemberjs:mainfrom
Conversation
8e95b20 to
870420e
Compare
986f2d5 to
d22590c
Compare
9a621d4 to
c79c0bf
Compare
Now that the scope bag is an object (`Record<string, unknown>`), lexical symbol names are always available via `Object.keys(scope())`. This makes two things redundant: - The optional `lexicalSymbols` slot in `SerializedTemplateBlock` (previously only populated when `emit.debugSymbols` was enabled) - The `emit.debugSymbols` option itself — removed from the compiler, `PrecompileOptionsWithLexicalScope` type, test helpers, and test callsites Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `name` field already identifies components in the render tree (now reliably, thanks to the object-based scope bag). The `template` field (module name of the backing template) adds no useful information beyond what `name` provides, so remove it from `RenderNode`, `CapturedRenderNode`, and all producers/consumers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c79c0bf to
c857465
Compare
Contributor
|
Only concern is making sure that we aren't causing a regression here for inspector behavior for non-strict handlebars. |
Contributor
https://github.com/ember-learn/ember-api-docs/pull/1007
|
Contributor
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
Follow-up cleanup now that the scope bag is a
Record<string, unknown>(#21224). Two commits:1. Remove
lexicalSymbolsfrom wire format and deaddebugSymbolscodepathLexical symbol names are now always available via
Object.keys(scope()), making two things redundant:lexicalSymbolsslot inSerializedTemplateBlockemit.debugSymbolsoption — removed from the compiler,PrecompileOptionsWithLexicalScopetype, test helpers (defComponent,createTemplate), and all test callsites2. Remove
templatefield from debug render treeThe
namefield already identifies components in the render tree (now reliably, thanks to the object-based scope bag). Thetemplatefield (module name of the backing .hbs file) provided no useful information beyond whatnamegives, so it's removed fromRenderNode,CapturedRenderNode, and all producers/consumers.This deletes the
moduleNameresolution logic from the component opcode,templateNamefrom route-template definition state, and thetemplateparameter fromgetDebugCustomRenderTree.Files changed
@glimmer/interfaces(wire-format)lexicalSymbolsfromSerializedTemplateBlock@glimmer/compilerblock.push(usedLocals)debug symbols emission@glimmer/opcode-compiler(shared.ts)meta()deriveslexicalfrom scope object keys@glimmer/syntaxemit.debugSymbolsfrom types@glimmer/interfaces(debug-render-tree, component manager)templatefromRenderNode,CapturedRenderNode,getDebugCustomRenderTree@glimmer/runtime(debug-render-tree, component opcode)captureTemplate,moduleNameresolutiontemplate/templateNamefieldsdefComponent,createTemplate,defineComponentemit/moduleName/debugSymbolsoptionstemplate:assertion linesTest plan
🤖 Generated with Claude Code