fix(renderer): keep component Fragments structurally transparent - #158
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the renderer so that when a plain component returns a Fragment, the Fragment remains structurally transparent (no visible wrapper host is inserted) across SPA rendering, scheduled updates, parent-driven reconciliation, and SSR hydration.
Changes:
- Add transactional reconciliation for component-owned Fragment ranges to preserve DOM identity, focus/selection, and rollback semantics.
- Stop materializing multi-node component results via an implementation
divwhen the result is a Fragment. - Add jsdom regressions for sibling topology (including hydration) and document the Fragment topology contract; bump package version to
0.0.77.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/jsdom/ssr/hydration.test.tsx | Adds hydration regression ensuring component-returned Fragment siblings preserve direct-child topology and identity. |
| tests/jsdom/dom/component-fragment-structure.test.tsx | Adds DOM regression covering updates/removal cleanup for transparent component Fragment siblings. |
| src/renderer/component-range-commit.ts | Routes component range replacement through Fragment range sync before materializing wrapper hosts. |
| src/renderer/component-host.ts | Enables Fragment range sync when an existing component host is a comment-anchored range. |
| src/renderer/component-host-results.ts | Prevents Fragment component results from being wrapped in an implementation div. |
| src/renderer/component-fragment-range.ts | Introduces transactional range reconciliation for component-returned Fragments. |
| package.json | Bumps @askrjs/askr version to 0.0.77. |
| package-lock.json | Updates lockfile version fields to 0.0.77. |
| docs/guides/platform-recipes.md | Updates the “verified against” version contract to 0.0.77. |
| docs/guides/component-generation.md | Documents guidance around using Fragments for multiple direct siblings (and avoiding wrapper elements). |
| docs/core/rendering.md | Documents the component Fragment topology contract and internal comment-anchored range behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
smiggleworth
force-pushed
the
fix/transparent-component-fragments
branch
from
July 27, 2026 17:26
9dbf211 to
d9d1e26
Compare
smiggleworth
force-pushed
the
fix/transparent-component-fragments
branch
from
July 27, 2026 17:39
d9d1e26 to
1847d9d
Compare
smiggleworth
force-pushed
the
fix/transparent-component-fragments
branch
from
July 27, 2026 17:46
1847d9d to
d8adc90
Compare
smiggleworth
force-pushed
the
fix/transparent-component-fragments
branch
from
July 27, 2026 18:02
d8adc90 to
4216923
Compare
smiggleworth
force-pushed
the
fix/transparent-component-fragments
branch
from
July 27, 2026 18:15
4216923 to
d487962
Compare
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
Fixes #157
Red to green
Before the renderer change, the new direct-sibling regression expected SECTION, DIV, MAIN but received DIV, MAIN because the component result was wrapped in an implementation div.
The first transparent-range implementation exposed four existing identity and rollback regressions in the full jsdom suite. The final transactional range reconciliation keeps those tests green as well as the new regression.
Validation