-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Which project does this relate to?
Start
Describe the bug
The inline <script> blocks generated by TanStack Start for SSR dehydration contain unnecessary blank lines and whitespace. Since this output is machine-generated serialization (Seroval streams, router state, etc.) and not user content, it could be minified without any risk of breaking functionality.
Your Example Website or App
https://github.com/canmi21/taki
Steps to Reproduce the Bug or Issue
View the HTML source of any SSR-rendered TanStack Start page. The dehydrated <script> tags contain patterns like:
<script>($R=>{ ... })($R["tsr"]);
document.currentScript.remove()</script>
There are blank lines between statements and unnecessary newlines within the Seroval stream constructor output.
Expected behavior
Dehydrated script output should be compact, e.g:
<script>($R=>{ ... })($R["tsr"]);document.currentScript.remove()</script>Screenshots or Videos
Platform
- Router / Start Version: 1.166.11
- OS: any
- Browser: any
- Browser Version: any
- Bundler: vite
- Bundler Version: 8.0.0
Additional context
Why this matters
Slightly increases HTML payload size on every SSR response before compression Makes View Source unnecessarily noisy
This is framework-generated serialization, not user-authored content there is no "<pre.>" or whitespace-sensitive context to worry about, so it is safe to strip