Skip to content

fix: stream solid suspense chunks independently#7512

Open
brenelz wants to merge 2 commits into
solid-router-v2-prefrom
fix/solid-stream-boundary-flush
Open

fix: stream solid suspense chunks independently#7512
brenelz wants to merge 2 commits into
solid-router-v2-prefrom
fix/solid-stream-boundary-flush

Conversation

@brenelz
Copy link
Copy Markdown
Contributor

@brenelz brenelz commented May 30, 2026

Not sure if this should go on main or just the solid-router-v2-pre branch.

Solid Streaming Fix

Why This Is Needed

Solid SSR can stream resolved Loading/Suspense boundaries after the main HTML document has already emitted </body></html>.

TanStack Router's SSR stream transform needs to inject router serialization scripts before the closing document tags. Before the fix, the transform treated everything from </body> onward as the closing HTML tail and buffered it until the whole app render and router serialization finished.

That accidentally buffered Solid's later boundary chunks too. In practice, a fast boundary like deferredPerson resolving at 1s was held until a slower boundary like deferredStuff resolved at 2s, so both appeared together instead of streaming independently.

What The Fix Does

The transform now captures only the actual closing tags (</body></html>) so router scripts can still be injected before them.

Any renderer chunks that arrive after those closing tags, including Solid boundary templates and scripts, are streamed immediately instead of being appended to the closing-tag buffer.

This preserves the required router script ordering while allowing Solid boundaries to reveal as each promise resolves.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e8ae47c2-f0f9-4040-a4ae-2846fe1c0625

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/solid-stream-boundary-flush

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 30, 2026

View your CI Pipeline Execution ↗ for commit a37a984

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 2m 48s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-30 14:29:42 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

Bundle Size Benchmarks

  • Commit: 3384d0ef7e0f
  • Measured at: 2026-05-30T14:27:51.693Z
  • Baseline source: history:9a6c12596ff6
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.48 KiB +238 B (+0.27%) 275.76 KiB 75.97 KiB ▃▃▃▃▃▃▃▁▁▁▁█
react-router.full 90.78 KiB +89 B (+0.10%) 286.95 KiB 78.95 KiB ▆▆▆▆▆▆▆▁▁▁▁█
solid-router.minimal 42.01 KiB +6.54 KiB (+18.42%) 123.63 KiB 37.88 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.full 46.38 KiB +6.21 KiB (+15.44%) 137.19 KiB 41.83 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.minimal 53.38 KiB +423 B (+0.78%) 153.07 KiB 47.94 KiB ▂▂▂▂▂▂▂▁▁▁▁█
vue-router.full 58.25 KiB -359 B (-0.60%) 168.53 KiB 52.18 KiB ███████▇▇▇▇▁
react-start.minimal 102.01 KiB +135 B (+0.13%) 324.00 KiB 88.21 KiB ▄▄▄▄▄▄▄▁▁▁▁█
react-start.full 105.38 KiB +128 B (+0.12%) 334.35 KiB 91.14 KiB ▄▄▄▄▄▄▄▁▁▁▁█
solid-start.minimal 63.19 KiB +13.61 KiB (+27.45%) 192.38 KiB 55.92 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.full 67.09 KiB +11.72 KiB (+21.16%) 203.92 KiB 59.23 KiB ▁▁▁▁▁▁▁▁▁▁▁█

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 30, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7512

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7512

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7512

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7512

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7512

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7512

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7512

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7512

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7512

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7512

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7512

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7512

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7512

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7512

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7512

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7512

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7512

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7512

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7512

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7512

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7512

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7512

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7512

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7512

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7512

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7512

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7512

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7512

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7512

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7512

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7512

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7512

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7512

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7512

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7512

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7512

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7512

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7512

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7512

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7512

commit: a37a984

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 30, 2026

Merging this PR will improve performance by 7.73%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 4 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
ssr request loop (solid) 174.6 ms 169 ms +3.36%
client-side navigation loop (solid) 72.6 ms 64.7 ms +12.3%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/solid-stream-boundary-flush (a37a984) with solid-router-v2-pre (67a9040)1

Open in CodSpeed

Footnotes

  1. No successful run was found on solid-router-v2-pre (2edb597) during the generation of this report, so 67a9040 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant