Skip to content

fix vite preview streaming#6828

Open
huseeiin wants to merge 1 commit intoTanStack:mainfrom
huseeiin:fix-vite-preview-streaming
Open

fix vite preview streaming#6828
huseeiin wants to merge 1 commit intoTanStack:mainfrom
huseeiin:fix-vite-preview-streaming

Conversation

@huseeiin
Copy link
Contributor

@huseeiin huseeiin commented Mar 5, 2026

now streaming works in vite preview

Summary by CodeRabbit

  • Chores
    • Modified preview server response headers to disable content compression for all responses.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc05ec86-bfbc-4c37-bf16-10cbc33624cd

📥 Commits

Reviewing files that changed from the base of the PR and between 861f319 and f991061.

📒 Files selected for processing (1)
  • packages/start-plugin-core/src/preview-server-plugin/plugin.ts

📝 Walkthrough

Walkthrough

A single-line addition to the preview server middleware that sets the Content-Encoding response header to "identity", disabling compression for all responses served through the preview server.

Changes

Cohort / File(s) Summary
Preview Server Middleware
packages/start-plugin-core/src/preview-server-plugin/plugin.ts
Added Content-Encoding header set to "identity" in middleware to disable response compression.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A header so light, a line so small,
Identity claimed, no compression at all!
The preview server hops without a squeeze,
Each response flies free upon the breeze! 📨✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix vite preview streaming' directly relates to the PR objective of making streaming work in vite preview, and the code change (disabling compression via Content-Encoding header) is a targeted fix for this streaming issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Bundle Size Benchmarks

  • Commit: 861f319bbeb8
  • Measured at: 2026-03-05T18:42:21.433Z
  • Baseline source: history:9c81d5ac571e
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 86.84 KiB 0 B (0.00%) 273.33 KiB 75.44 KiB ▁▁▁▁▁▁▁▁▁▁█
react-router.full 89.88 KiB 0 B (0.00%) 283.67 KiB 78.18 KiB ▁▁▁▁▁▁▁▁▁▁█
solid-router.minimal 36.17 KiB 0 B (0.00%) 108.44 KiB 32.49 KiB ▁▁▁▁▁▁▁▁▁▁█
solid-router.full 40.50 KiB 0 B (0.00%) 121.49 KiB 36.40 KiB ▁▁▁▁▁▁▁▁▁▁█
vue-router.minimal 52.03 KiB 0 B (0.00%) 148.42 KiB 46.71 KiB ▁▁▁▁▁▁▁▁▁▁█
vue-router.full 56.85 KiB 0 B (0.00%) 164.01 KiB 51.04 KiB ▁▁▁▁▁▁▁▁▁▁█
react-start.minimal 99.40 KiB 0 B (0.00%) 312.48 KiB 85.98 KiB ▁▁▁▁▁▁▁▁▁▁█
react-start.full 102.78 KiB 0 B (0.00%) 322.29 KiB 88.82 KiB ▁▁▁▁▁▁▁▁▁▁█
solid-start.minimal 48.49 KiB 0 B (0.00%) 146.03 KiB 42.85 KiB ▁▁▁▁▁▁▁▁▁▁█
solid-start.full 53.96 KiB 0 B (0.00%) 161.98 KiB 47.51 KiB ▁▁▁▁▁▁▁▁▁▁█

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

@nx-cloud
Copy link

nx-cloud bot commented Mar 5, 2026

View your CI Pipeline Execution ↗ for commit f991061

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

☁️ Nx Cloud last updated this comment at 2026-03-05 18:54:10 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: af5817f

let serverBuild: any = null

server.middlewares.use(async (req, res, next) => {
res.setHeader('content-encoding', 'identity')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this only required for solid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this only required for solid?

i don't think so. its for all streaming frameworks

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 5, 2026

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing huseeiin:fix-vite-preview-streaming (f991061) with main (9c81d5a)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (861f319) during the generation of this report, so 9c81d5a 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.

2 participants