perf: lower manifest script preload priority #8212
main fromrefs/pull/8212/head·merged by schiller-manuel(GitHub profile, opens in a new tab) What#
Generated script preloads, meaning the modulepreload links (or preload as="script" for IIFE output) that HeadContent renders from the Start manifest, now carry fetchPriority="low". Static Early Hints and the response Link header now carry it too.
Server-rendered HTML doesn't need this JavaScript to paint. Until now Chrome fetched it at High, so on bandwidth-bound connections it competed with render-blocking stylesheets, fonts and in-viewport images. With low, those go first, and the JS still arrives in time for hydration. React already uses this default for its own bootstrapModules preloads, and Next.js inherits it.
Changes#
getScriptPreloadAttrs(router-core) returnsfetchPriority: 'low'. React, Solid and VueHeadContentall render through this helper, and so does Early Hints.collectStaticHintsFromManifest(start-server-core) builds script hints with the sharedaddEarlyHintFetchAttrs, sofetchPriorityis forwarded along withcrossOrigin. Without this, Chromium had already started the hinted fetch atMEDIUMbefore the HTML attribute arrived.- Tests:
- start-server-core: Early Hints unit tests check the hint objects and the serialized
fetchpriority=low. react-start/early-hintse2e: 103 and responseLinkheader assertions.- React: SSR and iife tests.
- Solid: new server-suite SSR test and an iife test.
- Vue: assertions added, and the SSR hydration fixtures updated.
- start-server-core: Early Hints unit tests check the hint objects and the serialized
- Docs: one bullet in the Early Hints guide.
Evidence#
Applied-throttling measurements in this thread show large first-paint gains when the preload set is big, with hydration time unchanged:
- 71 preloads / ~445 KB: mobile FCP 4.44 s → 2.87 s; hydration 6.71 s → 6.58 s.
- 143 preloads: FCP 4.65 s → 0.87 s; all JS done 6.56 s → 6.47 s.
With small preload sets, the real-world difference is about zero. Lighthouse's simulated gains on small sets are a Lantern artifact, which GoogleChrome/lighthouse#16869 addresses.
Deliberately out of scope#
- No scoping by ssr mode. This applies to
ssr: false,'data-only'and the SPA shell as well. Stylesheets block rendering even for content drawn by client JS, and React also lowers its bootstrap preloads unconditionally. - No escape hatch yet. If one becomes necessary, it should be
fetchPriorityon the manifest link viatransformAssets, so that the HTML, Early Hints and hydration all see the same value. - RSC client-reference preloads (
ReactDOM.preloadModule) are a follow-up. They need React ≥ 19.3 and a server-only branch. - Head order of stylesheets vs. preloads (#6749) gets its own PR, with an HTTP/1.1 measurement.
- Deferred hydration child chunks are never part of the manifest preloads, so they're unaffected.
Closes #8546
🤖 Generated with Claude Code
Summary by CodeRabbit#
- New Features
- JavaScript preload links now use low fetch priority across React, Solid, and Vue, including module and IIFE scripts.
- Static Early Hints now carry the low-priority setting for JavaScript preloads.
- Documentation
- Updated the Early Hints guide to describe low-priority JavaScript hints.
- 1
This is great! We’ve also seen lower Lighthouse scores after migrating to Next.js 16.3, so hopefully this will fix it.
Edited 2026-09-10. My original comment claimed the entry chunk is "the one preload in the set that gates hydration" and proposed exempting it. That was wrong — every generated preload is hydration-critical. Corrected below, and the conclusion has changed with it.
We ran this patch downstream on two SSR marketing apps for a week. I've since reverted it, and the reasons may be useful input on your open questions.
Measured priorities#
A probe page through headless Chrome with
--log-net-log: threemodulepreloadlinks (no hint /low/high), plus an unhinted<script type="module" async>whose statically-imported dependency also had no hint.resource net priority Blink / DevTools document, stylesheet HIGHEST Highest modulepreload(no hint)MEDIUM High modulepreload fetchpriority="high"MEDIUM High <script type="module" async>(no preload)MEDIUM High static dep of that async module (no preload) MEDIUM High modulepreload fetchpriority="low"LOWEST Low Two things follow.
An async module script and its static dependencies are already fetched at High. So the generated
modulepreloadlinks aren't raising priority above what the module graph gets on its own once the entry parses — they only remove the discovery waterfall. What the patch buys is bandwidth, not the correction of a priority inversion. That still favours the change, but it's a different mechanism than "these compete at high priority with CSS": the stylesheet is Highest and outranks them either way.fetchpriority="high"on amodulepreloadis a no-op versus omitting the attribute. Scripts don't reach Highest that way. Any exemption you might want to build is therefore free — it can't outrank the resources this PR protects — but by the same token it can't buy back much either.Why an entry-only exemption doesn't work#
My first instinct was your question 3's shape: keep
lowfor route assets, exempt the bootstrap chunk so hydration isn't held behind tight mode. That doesn't hold up.getChunkPreloadsemits[chunk.fileName, ...chunk.imports]— rollup's static imports, withdynamicImportsexcluded — andhydrate()inload-client.jsawaitsloadRouteChunkfor every committed match before hydrating. So the entire preload set is on the hydration critical path, not just the entry. On our marketing pages that's 72 chunks. Promoting one of them starts hydration no earlier; hydration waits on the slowest member of the graph.That makes this a genuine paint-versus-interactive tradeoff across the whole set, rather than something that can be tuned by classifying assets. Which I think sharpens your risk 1 rather than resolving it.
Why we reverted#
Mostly your own numbers. The 1.098 s mobile FCP improvement is under Lighthouse simulated throttling; under applied throttling the same deployments differ by 13 ms. Lighthouse's simulator models priority explicitly, so simulated results are exactly where a priority hint would look strongest. Your write-up is admirably clear about this — I just think the 13 ms number deserves more weight than the 1.1 s one when choosing a framework default.
Against that, the hydration cost is real but also unmeasured: no extra main-thread work, but the whole graph lands after first paint, so the hydration long task shifts into the window where first interactions happen. We have no RUM on those apps, so neither side of the tradeoff is observable in the field for us, and a change we can't falsify wasn't worth the reasoning it required at each review.
None of that argues the patch is wrong — for a content page where nothing interactive matters before paint, biasing to paint is defensible. It argues against it as an unconditional default, which is the question you're actually asking. An opt-in (or a per-route/per-asset override) would let apps make that call with knowledge of their own interactivity, and would sidestep your risks 2 and 5 entirely.
Your point 4 stands independently, and looks like the sharper bug: Early Hints call
getScriptPreloadAttrsbut don't carryfetchPriorityinto the HTTP hint, so on a browser that acts on the hint the HTML attribute arrives too late to matter.Caveats#
Priorities measured over local HTTP/1.1, headless, on a single Chrome version. Priority assignment is Blink-side so the protocol shouldn't matter, but these heuristics drift between releases. And as above, we have no field data either — this is a mechanism argument, not a measured INP delta.
Ecosystem update relevant to your closing question about whether this should be a framework default.
React 19.3.0 shipped react/react#36835, so
ReactDOM.preloadModule()now forwardsfetchPriority— the ask in react/react#36834, alongside vitejs/vite-plugin-react#1264 doing the same for@vitejs/plugin-rscclient references.Verified against the published packages, production builds, same script against both:
function App() { ReactDOM.preloadModule('/dep.js', { as: 'script', fetchPriority: 'low' }) return <div>hi</div> }<!-- react-dom 19.2.8 --> <link rel="modulepreload" href="/dep.js"/> <!-- react-dom 19.3.0 --> <link rel="modulepreload" href="/dep.js" fetchPriority="low"/>@types/react-dom@19.3.0hasn't caught up —PreloadModuleOptionsstill lists onlyas,crossOrigin,integrity,nonce, so it needs a cast for the moment.Two things I take from it for this PR:
React exposed a knob rather than changing a default. It still hardcodes
fetchPriority: 'low'only for its ownbootstrapScriptsandbootstrapModules; for everything else the priority is opt-in per call. That seems like a reasonable precedent for the question you put to the maintainers — rather than lowering all generated manifest preloads by default, expose the priority (per asset, or per app) and let applications decide. It also sidesteps risks 2 and 5, where the right answer genuinely differs between a content site and anssr: falseroute.It gives the React renderer a first-class path. If Start routed manifest preloads through
ReactDOM.preloadModule()instead of JSX<link>elements, the priority would ride along with React's own resource dedupe, and Flight/RSC would pick it up for free. Not a general solution, though — Solid and Vue would still need the current markup path, so the sharedgetScriptPreloadAttrshelper stays either way.It doesn't touch your point 4, which still looks like the sharpest issue in the list: Early Hints don't carry
fetchPriority, so wherever a browser acts on the hint, the HTML attribute arrives too late to matter.Some measurements on the gap between simulated and applied throttling mentioned in the description. They come from a Start app (React 19.3, Vite 8, 10 to 15 generated modulepreloads per page, about 135 KB of brotli JS) served over HTTP/2 behind Caddy, with Lighthouse 13.5 mobile:
FCP LCP Performance generated preloads as today ( High)1.51 s 1.51 s 99 to 100 same build, preloads with fetchpriority="low"0.79 s 1.51 s 100 today, Chrome with applied throttling (150 ms, 1.6 Mbps, 4× CPU) 0.53 s The FCP drop comes from how Lantern builds its FCP graphs, not from bandwidth.
FirstContentfulPaint.getFirstPaintBasedGraphkeeps every network request that finished before the observed (unthrottled) first paint and has render-blocking priority, andNetworkNode.hasRenderBlockingPriority()treats aScriptatHighas render-blocking. AmodulepreloadisHighby default. Module evaluation appears in the trace asv8.evaluateModulewithout a URL, so Lantern can't tell that the script ran after the paint. On a fast local or edge server the preloads finish before the observed paint, and their bytes count against the simulated FCP. Withfetchpriority="low"they areLowand drop out of the FCP graphs. The pessimistic LCP graph keeps every request that finished before the observed LCP, whatever its priority, which is why our LCP didn't move.This matches your applied-throttling result: real FCP is about 0.5 s either way, because the browser paints long before the scripts arrive. A default change would mostly move Lighthouse's FCP, and it would cost hydration time on slow links, since every preload is needed for hydration (as noted above). I'd also go with an opt-in. For now we're keeping the default priority in our app.
Follow-up to my comment from Sept 10, where I said we'd reverted this patch because the hydration cost was unmeasured and the applied-throttling gain was 13 ms in your write-up. I've now measured both on one of those marketing pages (71 generated preloads, about 445 KB of JS). The data changes my conclusion: for an app like ours,
fetchpriority="low"is a clear win under applied throttling, and hydration doesn't move.Setup#
- Real Chrome (not headless-shell) driven by Playwright against the production site. Only the HTML document is swapped per variant, via request interception; every JS, CSS, font and image request goes to the real CDN, same origin, over HTTP/2. The document is held back for the time it would take to arrive over the throttled link, so no variant gets it for free.
- Three variants of the same SSR HTML snapshot: preloads as generated today, the same preloads with
fetchpriority="low", and preloads removed. - Applied throttling through CDP, matching Lighthouse's devtools settings. Mobile: 562.5 ms RTT, 1.47 Mbps, 4× CPU, 412×823. Desktop: 40 ms RTT, 10 Mbps, 1× CPU, 1350×940.
- Fresh context and cache disabled on every load. 5 rounds with variants interleaved, 60 loads in all; medians below, with very little spread between runs.
- Hydrated is when
$_TSR.h()runs (wrapped by an init script). Menu works comes from a second pass that clicks the header menu every 250 ms from FCP until it opens. Slowest click is the largest Event Timing duration over those clicks, the same data INP is built from.
Results#
today ( High)fetchpriority="low"preloads removed Mobile FCP (= LCP) 4.44 s 2.87 s 2.86 s Mobile last JS chunk downloaded 7.47 s 7.34 s 8.07 s Mobile hydrated 6.71 s 6.58 s 7.33 s Mobile menu works 7.23 s 7.03 s 7.78 s Mobile slowest click, median (worst) 96 ms (104) 112 ms (128) 120 ms (128) Desktop FCP 660 ms 388 ms 444 ms Desktop hydrated 917 ms 933 ms 1,012 ms Desktop menu works 1.32 s 1.26 s 1.47 s Desktop slowest click 32 ms 32 ms 24 ms What this says about my earlier reasoning#
- "The whole graph lands after first paint, so hydration shifts later": wrong, at least here. On a bandwidth-bound link the total bytes don't change, so the last chunk arrives at the same time either way.
lowonly reorders the queue so CSS, font and the hero image go first. Removing the links does cost about 0.6 s of hydration on mobile (the discovery waterfall), which supports the point that every preload is hydration-critical. That's an argument against dropping preloads, not against lowering their priority. - "The 13 ms applied-throttling number should outweigh the 1.1 s simulated one": that depends on how many preload bytes there are. @TiagoGranelli's explanation of the Lantern graphs matches what I see in simulation (FCP moves, LCP doesn't). But with about 445 KB of preloads against about 140 KB of HTML, CSS and font, the contention is real, not just a simulator artifact: −1.57 s FCP on mobile and −270 ms on desktop under applied throttling. With 4 preloads (your app) or 135 KB (Tiago's), there's much less to contend with, which fits the near-zero deltas you both saw.
- INP. No change on desktop. On mobile the slowest click goes up about 16 ms, all well under 200 ms. Part of that comes from the probe: it starts clicking at FCP, which now happens 1.5 s earlier, so more clicks land before hydration (median 15 vs 10) and the maximum is taken over more samples. The user-facing number, when the menu first works, is 0.2 s sooner.
Where that leaves the default question#
I still wouldn't make it an unconditional default. The gain scales with preload bytes, and
ssr: falseroutes (your risk 2) haven't been measured. But the case for an opt-in is stronger than I made it sound: for SSR content pages with a large preload set, it's a real paint win at no measurable hydration or INP cost. Your point 4 (Early Hints not carryingfetchPriority) would need fixing alongside any opt-in, or the attribute is moot wherever hints are sent.Caveats: one app, one network path (Southeast Asia to a Cloudflare edge), lab rather than field data, and a single interaction probed. For anyone wanting to try this without patching:
useTags()andAssetare exported, so a smallHeadContentreplacement can addfetchPriority: 'low'to themodulepreloadtags.Update to my data comment above: we shipped this to production on two Start sites, and I've changed my position. I now think
lowshould be the default, as this PR proposes, rather than an opt-in.Production before/after, with
fetchpriority="low"on the generated preloads as the only change. Lighthouse 13.5 medians:Site / page Form Perf FCP webcatalog.io /en/desktop mobile 47 → 66 6.9 s → 3.5 s webcatalog.io /en/desktop desktop 71 → 90 2.6 s → 674 ms webcatalog.io /en/apps/ometv mobile 35 → 67 6.8 s → 3.5 s webcatalog.io /en/apps/ometv desktop 66 → 83 2.6 s → 641 ms webcatalog.io /en/apps/country/us mobile 59 → 65 6.4 s → 3.5 s webcatalog.io /en/apps/country/us desktop 80 → 80 1.3 s → 633 ms lexibird.com /en/desktop mobile 61 → 67 5.5 s → 3.1 s lexibird.com /en/desktop desktop 84 → 93 1.7 s → 817 ms In production on mobile and desktop Chrome: no hydration errors, menus open, client-side navigation works. TBT and TTI are unchanged within noise.
What changed my mind:
- The hydration cost I worried about in my Sept 10 comment doesn't materialize. On a bandwidth-bound link the last chunk arrives at the same time;
lowonly reorders the queue (applied throttling: 6.71 s → 6.58 s mobile hydration). - "Opt-in only" leaves the gain to teams who already know to look. The cost is invisible in code, and small apps lose nothing either way.
- It matches React's own default for bootstrap preloads, which Next.js inherits.
Two refinements I'd suggest to this PR, both detailed in #8546:
- Scope the default to server-rendered matches. Keep today's priority for
ssr: falsematches and SPA mode, where the JS is the content. - Add an escape hatch (a
HeadContentprop next toassetCrossOrigin, orfetchPriorityonTransformAssetResult), and forwardfetchPriorityinto Early Hints (your point 4).
The one regression we saw fits the first: on
/en/apps/country/us(desktop) the LCP element is a card rendered by client JS after hydration. Simulated LCP went from 2.9 s to 3.6 s there, although observed LCP improved.- The hydration cost I worried about in my Sept 10 comment doesn't materialize. On a bandwidth-bound link the last chunk arrives at the same time;
Data point for the open questions here, from a Start app (1.171, React 19, Vite 8 / rolldown) with transitive preloads, i.e. what #8520 would produce.
Rolldown gives only direct imports, so we hoisted the transitive closure ourselves (same effect as #8520): 47 → 143 modulepreloads on the home page, ~890 KB of JS. Over HTTP/2 that blanked the page on slow networks: the stylesheets share the connection with every chunk and finish together with the last one.
Chrome network emulation (Slow 4G: 150 ms, 1.6 Mbps, CPU 4x) against the real CDN over HTTP/2, median of 3:
preloads FCP CSS done first API call after hydration LCP 47 direct, default High 1.78 s 1.71 s 6.57 s 8.18 s 143 transitive, default High 4.65 s 4.58 s 6.09 s 7.69 s 143 transitive, fetchPriority="low"0.87 s 0.80 s 6.01 s 7.66 s So with a large preload set the applied-throttling gain is big, and
lowdoes not delay hydration on this page (all JS done at 6.47 s vs 6.56 s). Lighthouse mobile (simulated): 46 → ~61, FCP 9.1 s → 1.7 s.If #8520 lands without this default, every rolldown app gets the blank first paint we hit. For now we rewrite
{ rel: "modulepreload" }in router-core at build time and would be glad to drop that.I believe that the current priority is optimal for faster hydration and isn't actually blocking / increasing FCP. This PR just landed that addresses Lighthouse's heuristic being inaccurate - https://github.com/GoogleChrome/lighthouse/pull/16869
🦋 Changeset detected#
Latest commit: 8606e1a413ba2402e8bcdc44f04bcbd0dea0c2da
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 23 packages
Name Type @tanstack/router-core Patch @tanstack/start-server-core Patch @tanstack/react-router Patch @tanstack/react-start-client Patch @tanstack/react-start-rsc Patch @tanstack/react-start-server Patch @tanstack/router-generator Patch @tanstack/router-plugin Patch @tanstack/solid-router Patch @tanstack/solid-start-client Patch @tanstack/solid-start-server Patch @tanstack/start-client-core Patch @tanstack/start-plugin-core Patch @tanstack/start-storage-context Patch @tanstack/vue-router Patch @tanstack/vue-start-client Patch @tanstack/vue-start-server Patch @tanstack/react-start Patch @tanstack/solid-start Patch @tanstack/vue-start Patch @tanstack/router-cli Patch @tanstack/router-vite-plugin Patch @tanstack/start-static-server-functions Patch Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
View your CI Pipeline Execution ↗ for commit 8606e1a413ba2402e8bcdc44f04bcbd0dea0c2da
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 10m 27s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 2m 4s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-16 01:04:57UTCMore templates
- tanstack-router-vue-example-basic-jsx
- tanstack-router-vue-example-basic-file-based-jsx
- tanstack-router-vue-example-basic-file-based-sfc
- tanstack-router-solid-example-authenticated-routes
- tanstack-router-solid-example-authenticated-routes-firebase
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-default-search-params
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-basic-virtual-file-based
- tanstack-router-solid-example-basic-virtual-inside-file-based
- tanstack-router-solid-example-deferred-data
- tanstack-router-solid-i18n-paraglide
- tanstack-router-solid-example-kitchen-sink
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-large-file-based
- tanstack-router-solid-example-location-masking
- tanstack-router-solid-example-navigation-blocking
- tanstack-router-solid-example-quickstart
- tanstack-router-solid-example-quickstart-esbuild-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-router-solid-example-quickstart-rspack-file-based
- tanstack-router-solid-example-quickstart-webpack-file-based
- @tanstack/router-solid-mono-simple
- router-solid-mono-simple-lazy
- router-solid-monorepo-solid-query
- tanstack-router-solid-example-scroll-restoration
- tanstack-solid-router-search-validator-adapters
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-authjs
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-bun-hosting
- tanstack-solid-start-example-convex-better-auth
- tanstack-solid-start-example-counter
- tanstack-solid-start-i18n-paraglide
- tanstack-solid-start-example-large
- tanstack-solid-start-streaming-data-from-server-functions
- tanstack-solid-start-example-supabase-basic
- tanstack-solid-start-tailwind-v4
- tanstack-router-solid-example-view-transitions
- tanstack-router-solid-example-with-framer-motion
- tanstack-router-solid-example-with-trpc
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-router-react-example-basic-authjs
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-rsbuild
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-example-next-migration
- tanstack-start-example-rscs
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
@tanstack/arktype-adapter
npm i https://pkg.pr.new/@tanstack/arktype-adapter@8212@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8212@tanstack/eslint-plugin-start
npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8212@tanstack/history
npm i https://pkg.pr.new/@tanstack/history@8212@tanstack/react-router
npm i https://pkg.pr.new/@tanstack/react-router@8212@tanstack/react-router-devtools
npm i https://pkg.pr.new/@tanstack/react-router-devtools@8212@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8212@tanstack/react-start
npm i https://pkg.pr.new/@tanstack/react-start@8212@tanstack/react-start-client
npm i https://pkg.pr.new/@tanstack/react-start-client@8212@tanstack/react-start-rsc
npm i https://pkg.pr.new/@tanstack/react-start-rsc@8212@tanstack/react-start-server
npm i https://pkg.pr.new/@tanstack/react-start-server@8212@tanstack/router-cli
npm i https://pkg.pr.new/@tanstack/router-cli@8212@tanstack/router-core
npm i https://pkg.pr.new/@tanstack/router-core@8212@tanstack/router-devtools
npm i https://pkg.pr.new/@tanstack/router-devtools@8212@tanstack/router-devtools-core
npm i https://pkg.pr.new/@tanstack/router-devtools-core@8212@tanstack/router-generator
npm i https://pkg.pr.new/@tanstack/router-generator@8212@tanstack/router-plugin
npm i https://pkg.pr.new/@tanstack/router-plugin@8212@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8212@tanstack/router-utils
npm i https://pkg.pr.new/@tanstack/router-utils@8212@tanstack/router-vite-plugin
npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8212@tanstack/solid-router
npm i https://pkg.pr.new/@tanstack/solid-router@8212@tanstack/solid-router-devtools
npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8212@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8212@tanstack/solid-start
npm i https://pkg.pr.new/@tanstack/solid-start@8212@tanstack/solid-start-client
npm i https://pkg.pr.new/@tanstack/solid-start-client@8212@tanstack/solid-start-server
npm i https://pkg.pr.new/@tanstack/solid-start-server@8212@tanstack/start-client-core
npm i https://pkg.pr.new/@tanstack/start-client-core@8212@tanstack/start-fn-stubs
npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8212@tanstack/start-plugin-core
npm i https://pkg.pr.new/@tanstack/start-plugin-core@8212@tanstack/start-server-core
npm i https://pkg.pr.new/@tanstack/start-server-core@8212@tanstack/start-static-server-functions
npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8212@tanstack/start-storage-context
npm i https://pkg.pr.new/@tanstack/start-storage-context@8212@tanstack/valibot-adapter
npm i https://pkg.pr.new/@tanstack/valibot-adapter@8212@tanstack/virtual-file-routes
npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8212@tanstack/vue-router
npm i https://pkg.pr.new/@tanstack/vue-router@8212@tanstack/vue-router-devtools
npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8212@tanstack/vue-router-ssr-query
npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8212@tanstack/vue-start
npm i https://pkg.pr.new/@tanstack/vue-start@8212@tanstack/vue-start-client
npm i https://pkg.pr.new/@tanstack/vue-start-client@8212@tanstack/vue-start-server
npm i https://pkg.pr.new/@tanstack/vue-start-server@8212@tanstack/zod-adapter
npm i https://pkg.pr.new/@tanstack/zod-adapter@8212commit:
8606e1aMerging this PR will not alter performance#
:information_source: 31 benchmarks have no flame graph
The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.
ssr before-load chain (react)ssr assets inline-css cdn (react)ssr assets linked-css control (react)ssr dehydrate rich types (react)ssr server-fn during document ssr (react)ssr global-mw document (react)ssr control-flow route headers (react)ssr selective (react)ssr control-flow unmatched 404 (react)ssr dehydrate plain control (react)- …and 21 more
✅ 194untouched benchmarks⏩ 3skipped benchmarks1
Comparingmaxktz:fix/preload-priority(8606e1a) withmain(7a06725)Footnotes#
-
3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
07229ec2-3547-4caf-bb60-36b72326d609📥 Commits
Reviewing files that changed from the base of the PR and between 7a0672503857283614799a0b480f4a82110e5ab6 and 8606e1a413ba2402e8bcdc44f04bcbd0dea0c2da.
📒 Files selected for processing: 10
.changeset/quiet-script-preloads.mddocs/start/framework/react/guide/early-hints.mde2e/react-start/early-hints/tests/early-hints-protocol.spec.tspackages/react-router/tests/Scripts.test.tsxpackages/router-core/src/manifest.tspackages/solid-router/tests/Scripts.test.tsxpackages/solid-router/tests/server/HeadContent.test.tsxpackages/start-server-core/src/early-hints.tspackages/start-server-core/tests/early-hints.test.tspackages/vue-router/tests/Scripts.test.tsxIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Generated script preloads now use low fetch priority. Static Early Hints copy supported fetch attributes from manifest preloads. Framework tests, HTTP/2 protocol tests, documentation, and a changeset describe or verify these updates.
Changes: Script preload priority
packages/router-core/src/manifest.ts,packages/react-router/tests/Scripts.test.tsx,packages/solid-router/tests/*,packages/vue-router/tests/Scripts.test.tsxgetScriptPreloadAttrsnow returnsfetchPriority: 'low'. React, Solid, and Vue tests check low-priority module and IIFE script preloads.packages/start-server-core/src/early-hints.ts,packages/start-server-core/tests/early-hints.test.ts,e2e/react-start/early-hints/tests/early-hints-protocol.spec.ts,docs/start/framework/react/guide/early-hints.md,.changeset/quiet-script-preloads.mdPriority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other · Severity of issue fixed: Medium
Merge Risk: ⚪ Minimal · up to
8606eThe preload-priority change is ready to merge after normal checks. Performance may vary with page preload counts, but no concrete blocking regression is established.
Pre-merge checks:
2 · 
3
#8546requires low priority for generated preloads and forwarding into static Early Hints. The PR implements both:getScriptPreloadAttrsreturnsfetchPriority: 'low', `collectStaticHintsFrom…ssr: falseand SPA output. Add the requested supported priority override, such as a transform result orHeadContentoption, and ensure HTML an…#8546, and the added tests and documentation support that objective. The implementation also changesssr: false, data-only, and SPA manifest …ssr: falseor SPA manifest preloads unless the issue scope is updated and the behavior is intentionally accepted.Full details: Linked Issues check
Explanation
Issue
#8546requires low priority for generated preloads and forwarding into static Early Hints. The PR implements both:getScriptPreloadAttrsreturnsfetchPriority: 'low',collectStaticHintsFromManifestusesaddEarlyHintFetchAttrs, and tests cover hint objects and serialized headers. However, the issue also requires preserving the existing priority forssr: falsematches and SPA mode, plus an escape hatch. The changed helper applieslowunconditionally, and the PR adds neither escape hatch.Resolution
Limit the low-priority default to server-rendered matches. Preserve the existing priority for
ssr: falseand SPA output. Add the requested supported priority override, such as a transform result orHeadContentoption, and ensure HTML and Early Hints use the same value.Full details: Out of Scope Changes check
Explanation
The preload and Early Hints changes are related to issue
#8546, and the added tests and documentation support that objective. The implementation also changesssr: false, data-only, and SPA manifest preloads becausegetScriptPreloadAttrsnow returnslowfor every call. Issue#8546identifies those client-rendered modes as excluded from the requested default, so this behavior is outside the linked issue scope.Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 8 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
🧪 Generate unit tests (beta)
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