fix: resume empty placeholders via a unified text resume marker - #4071
Merged
Conversation
🦋 Changeset detectedLatest commit: 8274cd5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4071 +/- ##
==========================================
- Coverage 90.78% 90.75% -0.03%
==========================================
Files 424 424
Lines 20447 20461 +14
Branches 3874 3877 +3
==========================================
+ Hits 18562 18570 +8
- Misses 1323 1330 +7
+ Partials 562 561 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DylanPiercey
force-pushed
the
dpiercey-ws-fix-empty-placeholder-vhgzim
branch
7 times, most recently
from
September 1, 2026 15:17
95d8734 to
31824f2
Compare
… markers Replaces the `_escape`/`_unescaped` + `_el_resume` pair a serialized placeholder wrote with a single `_text_resume`/`_html_resume` call. When the rendered text is empty it writes only a new `EmptyText` resume marker, so resume creates the text node instead of guessing a neighbor — fixing resume claiming a preceding element/input (or a section edge) as the placeholder's text node. Non-empty text claims its previous sibling unconditionally, letting the client resume runtime drop its node heuristic, and `<!>` separators are now emitted at runtime only when non-empty text would merge with a preceding text node (`_sep` removed). Unescaped markup that parses to multiple top-level nodes is bracketed with `HtmlStart`/`HtmlEnd` markers so resume claims the whole range and restores the last-child accessor `_html` tracks client side, instead of claiming only the final node and orphaning the rest on the first update. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DylanPiercey
force-pushed
the
dpiercey-ws-fix-empty-placeholder-vhgzim
branch
2 times, most recently
from
September 1, 2026 15:25
fed6ddc to
8274cd5
Compare
Merged
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.
Supersedes #4070.
A placeholder that rendered empty on the server could resume against the wrong DOM node (e.g.
<div/>${value}withvaluestarting empty claimed the<div>as its text node), because resume guessed the node from the marker's previous sibling and<!>separators only covered some positions (#3143, #4070). A multi-node$!{value}also resumed with only its last node claimed, orphaning the rest on the first update.Serialized placeholders now write a single
_text_resume/_html_resumecall instead of_escape/_unescapedplus_el_resume: empty text emits anEmptyTextmarker and resume creates the text node itself, non-empty text claims its previous sibling unconditionally, and multi-node unescaped markup is bracketed withHtmlStart/HtmlEndmarkers so resume reconstructs the full range. Separators (and_sep) remain only where non-empty text would merge with a preceding text node. The new resume handling is latched behind_htmlusage and single ordered symbol comparisons, so the resume bundle floor shrinks along with the SSR output.🤖 Generated with Claude Code