You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start inlineCss feature: optional config to inline only matching CSS, and load the rest without blocking render
#8949
Proposal: server.build.inlineCss inlines all manifest CSS of the matched routes. I propose the more granular control by a developer - usual critical-CSS split - a small set of stylesheets inline, everything else as normal cacheable files that don’t block first paint.
tanstackStart({server: {build: {inlineCss: boolean|{include: '**/*.critical.css',// string | RegExp | array, matched against source module ids/** * 'nonblocking' - rest CSS are rendered as links with non-blocking mechanism. * Client navigation is unchanged. */rest?: 'nonblocking',// optional: 'blocking' (or 'default') | 'nonblocking'},},},})
If config with include is set, only CSS from matching modules goes into the inline <style>, the other manifest stylesheets stay as <link rel="stylesheet">.
Without other: 'nonblocking' render still waits for the remaining links, so I see the two options as one feature.
Open question:
Non-blocking mechanism (media="none" onload=…) needs a handler.
We run a custom HeadContent in production that renders manifest stylesheet links with media="none" and switches them to all after hydration. That works with a nonce-only CSP but waits for JS.
Second option - a nonce’d inline script.
I can send the PR (e2e, docs, changeset) once the shape is agreed.
AI assistance: custom CSS inlining for Start is implemented by hand before "AI-era", current proposal drafted with Claude, reviewed and edited by me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Proposal:
server.build.inlineCssinlines all manifest CSS of the matched routes. I propose the more granular control by a developer - usual critical-CSS split - a small set of stylesheets inline, everything else as normal cacheable files that don’t block first paint.If config with
includeis set, only CSS from matching modules goes into the inline <style>, the other manifest stylesheets stay as<link rel="stylesheet">.Without
other: 'nonblocking'render still waits for the remaining links, so I see the two options as one feature.Open question:
Non-blocking mechanism (
media="none" onload=…) needs a handler.We run a custom
HeadContentin production that renders manifest stylesheet links withmedia="none"and switches them toallafter hydration. That works with a nonce-only CSP but waits for JS.Second option - a nonce’d inline script.
I can send the PR (e2e, docs, changeset) once the shape is agreed.
AI assistance: custom CSS inlining for Start is implemented by hand before "AI-era", current proposal drafted with Claude, reviewed and edited by me.
All reactions