fix: preserve context across control boundaries - #152
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes context propagation across control-boundary primitives (For/Show/Case) so child scopes preserve the correct provider frame, including transactional refresh of stable keyed For rows when provider context changes. It also updates regression coverage and bumps the package version to 0.0.75.
Changes:
- Propagate and semantically compare context frames for control boundaries so stable keyed For rows stay stable on unrelated parent updates.
- Refresh For-owned child scopes transactionally when the provider context frame changes.
- Add jsdom regression tests covering For/Show/Case context preservation and stability; bump version + docs.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/jsdom/renderer/context-frame-invariants.test.tsx | Adds regression coverage for context frames across For/Show/Case and stable keyed behavior. |
| src/runtime/for-scopes.ts | Assigns For-owned child scopes an explicit ownerFrame and adds refreshForContextScopes. |
| src/runtime/for-internal.ts | Tracks _contextFrame/_contextFrameChanged on For state and triggers transactional refresh when needed. |
| src/runtime/control.ts | Ensures Show/Case branch scopes inherit the boundary’s context frame when created. |
| src/runtime/context.ts | Adds haveEquivalentContextFrames for semantic context-frame comparison. |
| src/runtime/child-scope.ts | Marks rendered vnode trees with the scope’s ownerFrame to preserve context metadata. |
| src/renderer/reconcile-resolution.ts | Uses getControlBoundaryState() (frame-aware) for control-boundary resolution. |
| src/renderer/evaluate-reconcile.ts | Centralizes control-boundary evaluation/state access via boundary helpers. |
| src/renderer/boundary-state.ts | Propagates vnode context frames into control boundary state/scopes and detects For frame changes. |
| package.json | Bumps package version to 0.0.75. |
| package-lock.json | Updates lockfile version metadata to 0.0.75. |
| docs/guides/platform-recipes.md | Updates documented version contract to 0.0.75. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
smiggleworth
force-pushed
the
fix/for-scope-context-propagation
branch
from
July 27, 2026 14:37
3d972ab to
c0546b3
Compare
smiggleworth
force-pushed
the
fix/for-scope-context-propagation
branch
from
July 27, 2026 14:52
c0546b3 to
b5077c8
Compare
smiggleworth
force-pushed
the
fix/for-scope-context-propagation
branch
from
July 27, 2026 15:13
b5077c8 to
a74c3c1
Compare
Contributor
Author
|
@copilot review |
Contributor
Reviewed the latest commit set on this branch; I don’t have additional code changes to request at this time. |
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
This supplies the owning runtime fix for askrjs/askr-ui#14. The UI issue remains open until its downstream regression PR and package release complete.
Validation
Regression coverage