Skip to content
Source
Sign inSign up
TanStack/router

perf: lower manifest script preload priority #8212

Mergedmaxktz(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/8212/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 10 changed files with 11 additions and 2 deletions (loading 7).

x
0 of 10 viewed, 10 left
6 additions and 0 deletions.changeset/quiet-script-preloads.mdAdded
View file
@@ -0,0 +1,6 @@
+---
+'@tanstack/router-core': patch
+'@tanstack/start-server-core': patch
+---
+​
+Render generated script preloads (`modulepreload`, or `preload as="script"` for IIFE output) with `fetchPriority="low"` and forward it into static Early Hints, so they no longer compete with render-blocking stylesheets, fonts and images.
1 addition and 0 deletionsdocs/start/framework/react/guide/early-hints.mdModified
View file
@@ -164,6 +164,7 @@
- CDN URL rewrites are reflected in Early Hints.
- `crossOrigin` returned from `transformAssets` is reflected in Early Hints.
- JavaScript hints follow the client output format: `modulepreload` for module output, or `preload; as=script` for IIFE output.
+- JavaScript hints carry `fetchpriority=low`, matching the generated HTML preload links, so they don't compete with render-blocking stylesheets.
- Per-request transforms with `cache: false` are reflected in Early Hints for that request.
- Inlined CSS assets are skipped when Start's [CSS inlining](./css-styling#inline-route-css-in-production) build option inlines them into the HTML.
​
4 additions and 2 deletionse2e/react-start/early-hints/tests/early-hints-protocol.spec.tsModified
View file
@@ -103,7 +103,9 @@
const response = await makeRequest(baseURL, '/')