Skip to content
Source
Sign inSign up
TanStack/redact

fix: prefix streaming transport ids and reveal instructions #104

OpenBleedingDev(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/104/headopened

Showing 12 changed files with 28 additions and 13 deletions (loading 9).

x
0 of 12 viewed, 12 left
7 additions and 0 deletions.changeset/ssr-prefixed-segment-ids.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/redact': patch
+---
+​
+Use safely escaped, prefixed hexadecimal transport IDs for streamed Suspense boundaries, pass both DOM IDs to reveal instructions, and emit the recognized stylesheet-gated reveal instruction.
+​
+Keep reveal registrations shared across independently prefixed streams without changing early-event capture behavior. Remove the hidden segment and its parsing wrapper if a stylesheet-gated reveal fails, including when its boundary has already been deleted.
3 additions and 2 deletionspackages/redact/src/dom/features/suspense-hydration/full.tsModified
View file
@@ -151,7 +151,8 @@
// Pending: fallback DOM lives inside <div id="B:ID">. Hydrate the fallback
// React subtree against that div's children.
- const bDiv = document.getElementById(`B:${id}`);
+ const boundaryId = (findRoot(fiber)?.i ?? '') + 'B:' + id.toString(16);
+ const bDiv = document.getElementById(boundaryId);
try {
if (bDiv) {
setHydrationCursor(fiber, new HydrationCursor(bDiv));
@@ -171,7 +172,7 @@
clearHydrationCursor(fiber);