fix(jsx): replace Suspense and ErrorBoundary content across newlines (#5380)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* fix(jsx): replace Suspense and ErrorBoundary content across newlines The buffer-phase replacement regexes for Suspense and ErrorBoundary used '.*?', which cannot match across newlines. When a Suspense fallback or an ErrorBoundary region contained a newline (e.g. in the writeSSE Stringify phase), the replacement was a silent no-op: the resolved content was dropped and the template markers stayed in the output. Use [\s\S] so the regions match regardless of line breaks. * test(sse): cover sibling and nested multiline Suspense boundaries Two controls for the buffer-phase replacement: sibling Suspense boundaries with multiline fallbacks must each replace only their own region, and nested Suspense with multiline fallback and content must resolve through both levels. Both read the stream to completion. * refactor: use the `s` flag in boundary regexes and drop the no-op `.*?` from ErrorBoundary ---------
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: ndycode <ndycode@users.noreply.github.com>
- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
Diff stats
3 files+129 added−3 removed
- tests:+127 added−1 removed
- other:+2 added−2 removed