[SPIKE] Remove -with-dynamic-vars / -get-dynamic-var support#21485
Closed
NullVoxPopuli-ai-agent wants to merge 1 commit into
Closed
[SPIKE] Remove -with-dynamic-vars / -get-dynamic-var support#21485NullVoxPopuli-ai-agent wants to merge 1 commit into
NullVoxPopuli-ai-agent wants to merge 1 commit into
Conversation
Removes the template-facing dynamic vars feature: - the -get-dynamic-var (call/append) and -with-dynamic-vars (block) keywords, the GetDynamicVar/WithDynamicVars MIR nodes, their encoding and strict-mode passes - wire format opcodes WithDynamicVars (45) and GetDynamicVar (53) and their types (numbers left as gaps, not renumbered) - VM opcodes GetDynamicVar (111) and BindDynamicScope (58), their append-opcode handlers, VM#bindDynamicScope, and debug metadata - the associated integration test suites Dynamic scope itself stays: Ember's outlet machinery reads and writes outletState on the dynamic scope directly from JS, and component invocation still pushes/pops dynamic scope. Only the template syntax for reading/writing arbitrary dynamic vars is removed. Note: this deletes the intimate API liquid-fire uses to intercept outletState in templates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Spike: remove support for the
-with-dynamic-vars/-get-dynamic-vartemplate keywords and the VM plumbing that exists only to serve them.This removes the template-facing dynamic vars feature end to end:
-get-dynamic-var(call + append positions),-with-dynamic-vars(block position), and theutils/dynamic-vars.tskeyword delegateGetDynamicVarandWithDynamicVarsnodes, their encoding passes, and their strict-mode visitor armsWithDynamicVars(45) andGetDynamicVar(53), theirWireFormat.Statements/WireFormat.Expressionstypes, and the wire-format-debug formatting (opcode numbers are left as gaps, not renumbered)DynamicScope()opcode-builder helperVM_GET_DYNAMIC_VAR_OP(111) andVM_BIND_DYNAMIC_SCOPE_OP(58) — constants,VmOptypes, append-opcode handlers,VM#bindDynamicScope, and debug metadata-with-dynamic-vars and -get-dynamic-varintegration suite, the entry-point "initial dynamic context" test, the curlydynamicScopesmoke test, Ember'swith-dynamic-var-test.js, and the-with-dynamic-varsleg of the syntax refinements testWhat is deliberately kept
Dynamic scope itself is not removed — Ember's outlet machinery stores
outletStatein it from JS:DynamicScopeinterface (get/set/child) andDynamicScopeImpl—outlet.ts's component manager and syntax calldynamicScope.get('outletState')/.set(...)directlyVM_PUSH_DYNAMIC_SCOPE_OP/VM_POP_DYNAMIC_SCOPE_OP— component invocation still saves/restores dynamic scope around component boundariesrenderMain/renderComponent'sdynamicScopeparameterDynamicScopeclass inrenderer.ts, including itsoutletState-only assertions (now guarding only internal JS callers)Breaking-change note
This deletes the intimate API that liquid-fire uses to intercept
outletState(
{{#-with-dynamic-vars outletState=...}}/(-get-dynamic-var "outletState")) — theoutlet-test.jscase labeled "outletState can pass through user code (liquid-fireintimate API)" is removed accordingly. Everywhere else in Ember these keywords were
already restricted to
outletStateby assertions. If this lands for real it presumablyneeds an RFC/deprecation story for liquid-fire (or confirmation that current liquid-fire
no longer relies on it).
Testing
pnpm type-check:internals— clean (the two@glimmer/componentmodule-resolution errors inowner/type-testsare pre-existing onmain)pnpm lint:eslint— cleanpnpm test(vite build + full testem browser suite) — 9382 tests, 9365 pass, 17 skip, 0 fail🤖 Generated with Claude Code