Repository navigation
fix(web): insert root hole content literally in renderToStream (#5275) - #5277
Open
O1sumitkumar wants to merge 1 commit into
Open
O1sumitkumar wants to merge 1 commit into
O1sumitkumar wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 27a04b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
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.
Fixes #5275
Summary
resolveRootHoles()inrenderToStreamfilled each<!--rhN-->marker withhtml.replace(marker, content). With a string as the second argument,String.prototype.replaceexpands$`,$&,$'and$$, so rendered text containing them was corrupted (for example`$`became the HTML before the marker, and$&became the marker itself). Both calls now pass a function,() => content, whose return value is inserted literally. This is the same formshellEdit(s => s.replace(now, () => to))already uses in this file.Changeset added:
@solidjs/webpatch. No public API change.How did you test this change?
packages/web/test/server/ssr-stream.spec.tsx(No Loading Boundary block): one where a root hole resolves to text with$`,$&,$'and$$, and one where the resolved content leaves a nested hole (theres.h.lengthbranch). Both fail onmain(e.g. received"Total: `<p _hk=1> 5 (<!--rh0-->amp; a…") and pass with the fix. Reverting only the secondreplacemakes the nested-hole test fail again, so each branch is covered.pnpm i,pnpm --filter @solidjs/compiler run build,pnpm build, thenpnpm testinpackages/web: client 2043 passed / 6 expected fail, server 2265 passed / 3 expected fail, hydrate 818 passed / 7 expected fail, no failures.prettier --checkis clean on the changed files.pnpm test(other packages' suites and type tests), the Babel/LOWER_SHOWCI variants, and the integration tests.This change was prepared with AI assistance (Grok Bot, an AI agent). I reviewed the diff and the test results.