Skip to content

Remove prefetch from instant config#92761

Open
gnoff wants to merge 3 commits intocanaryfrom
jstory/remove-prefetch-from-instant
Open

Remove prefetch from instant config#92761
gnoff wants to merge 3 commits intocanaryfrom
jstory/remove-prefetch-from-instant

Conversation

@gnoff
Copy link
Copy Markdown
Contributor

@gnoff gnoff commented Apr 14, 2026

prefetching is now controlled with the prefetch export and this option is inert on the instant export. this removes the prefetch option as a valid property on the instant config type.

also updates the ts plugin for this export and adds the definition for the previously landed prefetch export

@nextjs-bot nextjs-bot added created-by: Next.js team PRs by the Next.js team. tests Turbopack Related to Turbopack with Next.js. type: next labels Apr 14, 2026
@gnoff gnoff requested review from acdlite and lubieowoce April 14, 2026 00:47
@nextjs-bot
Copy link
Copy Markdown
Collaborator

nextjs-bot commented Apr 14, 2026

Failing test suites

Commit: ce1e8fd | About building and testing Next.js

pnpm test-dev test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > runtime params are excluded from instant shell > does not include cookie values in instant shell during page load (DD)
Expand output

● instant-navigation-testing-api › runtime params are excluded from instant shell › does not include cookie values in instant shell during page load

expect(received).toContain(expected) // indexOf

Expected substring: "testCookie: hello"
Received string:    "testCookie: not set"

  411 |       const cookieValue = page.locator('[data-testid="cookie-value"]')
  412 |       await cookieValue.waitFor({ state: 'visible', timeout: 10000 })
> 413 |       expect(await cookieValue.textContent()).toContain('testCookie: hello')
      |                                               ^
  414 |     })
  415 |
  416 |     it('does not include dynamic param values in instant shell during page load', async () => {

  at Object.toContain (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:413:47)

@nextjs-bot
Copy link
Copy Markdown
Collaborator

nextjs-bot commented Apr 14, 2026

Stats from current PR

✅ No significant changes detected

📊 All Metrics
📖 Metrics Glossary

Dev Server Metrics:

  • Listen = TCP port starts accepting connections
  • First Request = HTTP server returns successful response
  • Cold = Fresh build (no cache)
  • Warm = With cached build artifacts

Build Metrics:

  • Fresh = Clean build (no .next directory)
  • Cached = With existing .next directory

Change Thresholds:

  • Time: Changes < 50ms AND < 10%, OR < 2% are insignificant
  • Size: Changes < 1KB AND < 1% are insignificant
  • All other changes are flagged to catch regressions

⚡ Dev Server

Metric Canary PR Change Trend
Cold (Listen) 456ms 456ms ▁██▁▁
Cold (Ready in log) 439ms 440ms ▃▃▂▅▄
Cold (First Request) 824ms 822ms ███▁▁
Warm (Listen) 456ms 456ms ▅▅█▅▅
Warm (Ready in log) 439ms 440ms ▆█▆▁▁
Warm (First Request) 335ms 333ms ▅▆▂▁▁
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 456ms 456ms ▁█▁██
Cold (Ready in log) 439ms 440ms ▂▂▆▇█
Cold (First Request) 1.919s 1.957s ▆▅▇▆▆
Warm (Listen) 457ms 457ms ▅██▅▅
Warm (Ready in log) 439ms 439ms ▂▂▇▇█
Warm (First Request) 1.937s 1.935s █▇█▇▇

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 4.025s 3.963s ▃▁▂▇▄
Cached Build 4.032s 4.017s ▁▃▂▆▅
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 14.429s 14.403s ▁▄▇▇▆
Cached Build 14.554s 14.576s ▂▃▇█▇
node_modules Size 494 MB 494 MB █████
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
053b9v5j96uu_.js gzip 8.56 kB N/A -
07rxhp_1_g4mu.js gzip 13.1 kB N/A -
096aa2uod0_wa.js gzip 9.82 kB N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0ea8vo2o6kp_s.js gzip 13.3 kB N/A -
0egovw6-5i1e3.js gzip 8.57 kB N/A -
0fli3_wppnim5.js gzip 12.9 kB N/A -
0gkovryjv05n3.js gzip 154 B N/A -
0ho78l23ixdy7.js gzip 155 B N/A -
0jrg8yoqn4b8e.js gzip 155 B N/A -
0k09jwjeb-tki.js gzip 13.8 kB N/A -
0kb7_ep3r1z0_.js gzip 10.1 kB N/A -
0kmgih16pb2zy.js gzip 9.24 kB N/A -
0lbv96yr1uj-x.js gzip 168 B N/A -
0wxpyd8r-vipl.js gzip 1.47 kB N/A -
1-z_xm7pzpbeh.js gzip 49.2 kB N/A -
11qa6mv6j4f0n.js gzip 160 B N/A -
16lhqjoqbznyg.js gzip 220 B 220 B
16vepdkipri3r.js gzip 8.51 kB N/A -
17n96uu6y1pxq.js gzip 8.6 kB N/A -
1d9ms1y2nit5w.js gzip 65.5 kB N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1odlz7_bqi4gv.js gzip 160 B N/A -
1s-lssnhdqk31.js gzip 156 B N/A -
1xz7fhgdco-x_.js gzip 8.59 kB N/A -
2__-e_ym8n788.js gzip 450 B N/A -
22o6xd9_ywdu6.js gzip 233 B N/A -
2avcdi72oetam.js gzip 156 B N/A -
2h9_xc-4i5_oy.js gzip 152 B N/A -
2k1q_gre6hp0-.js gzip 8.56 kB N/A -
2kvj8yrfznmwx.js gzip 5.69 kB N/A -
2sgqisp4604si.js gzip 8.51 kB N/A -
2u7io78pjtekk.js gzip 156 B N/A -
3_lh2q04233ur.js gzip 70.8 kB N/A -
342ijzvrpe53h.js gzip 2.29 kB N/A -
3p575fh88tejl.js gzip 155 B N/A -
3v9s-fz24f8oo.js gzip 10.4 kB N/A -
3zdh_rd16s0i8.js gzip 157 B N/A -
420pn_b9x-3ir.js gzip 8.62 kB N/A -
43l229j-6khv5.js gzip 156 B N/A -
44un3--wmqiyh.js gzip 7.61 kB N/A -
turbopack-0x..2c1o.js gzip 4.19 kB N/A -
turbopack-0y..rjc9.js gzip 4.2 kB N/A -
turbopack-1k..rbj5.js gzip 4.19 kB N/A -
turbopack-1q.._m7g.js gzip 4.19 kB N/A -
turbopack-2-..4mlc.js gzip 4.17 kB N/A -
turbopack-22..h7oj.js gzip 4.19 kB N/A -
turbopack-25..lf2b.js gzip 4.19 kB N/A -
turbopack-2b..nby5.js gzip 4.19 kB N/A -
turbopack-2m..wm_6.js gzip 4.19 kB N/A -
turbopack-2n.._pfr.js gzip 4.19 kB N/A -
turbopack-3b..ydgx.js gzip 4.19 kB N/A -
turbopack-3e..0ajm.js gzip 4.19 kB N/A -
turbopack-3l..dvr5.js gzip 4.19 kB N/A -
turbopack-3m..qy5_.js gzip 4.19 kB N/A -
03_szppy5nakp.js gzip N/A 49.2 kB -
0arkbdqpxc37i.js gzip N/A 8.6 kB -
0iuamvde1mkye.js gzip N/A 166 B -
0mz-rbiau93_g.js gzip N/A 161 B -
0tvekitj587fh.js gzip N/A 8.51 kB -
0vcsfpshdbpoi.js gzip N/A 157 B -
0z83a1om5rvtt.js gzip N/A 7.61 kB -
1-jqyfc89tixo.js gzip N/A 1.46 kB -
14t1kneseb8th.js gzip N/A 2.3 kB -
16bh0aqv641xv.js gzip N/A 157 B -
192q2suy7rwb_.js gzip N/A 8.56 kB -
1ab2xruymo-oj.js gzip N/A 449 B -
1im7xphq6dxob.js gzip N/A 159 B -
1ng_99sotnhzq.js gzip N/A 159 B -
1qui_nsqw5190.js gzip N/A 157 B -
1wzrm0xjjbzn5.js gzip N/A 10.1 kB -
25a1yz7zua29z.js gzip N/A 13.8 kB -
2f2bp_kexa37v.js gzip N/A 13.3 kB -
2fpb7l1pbce6e.js gzip N/A 65.5 kB -
2i5v1taq97gql.js gzip N/A 8.59 kB -
2jrvadyrjp0yr.js gzip N/A 155 B -
2n3vh0w0tnb_2.js gzip N/A 8.52 kB -
2u_rpxq3tzytl.js gzip N/A 233 B -
2wfbykz1avdns.js gzip N/A 8.56 kB -
32sifemopndov.js gzip N/A 10.4 kB -
368lim5wq0o0r.js gzip N/A 12.9 kB -
37ba9t8u6k_9f.js gzip N/A 156 B -
3aouhp_o4j3ta.js gzip N/A 151 B -
3de283pazbu99.js gzip N/A 9.81 kB -
3drqjohogojbw.js gzip N/A 5.69 kB -
3g8l1m2-o-ewi.js gzip N/A 13.1 kB -
3gp2o_v7jcw6s.js gzip N/A 8.57 kB -
3kab57ds4zwc9.js gzip N/A 157 B -
3qu7g1q2l_x2n.js gzip N/A 9.24 kB -
3vucw_kkxf-6j.js gzip N/A 155 B -
3zycucbo0ee-y.js gzip N/A 70.8 kB -
41p1znhcs5rk8.js gzip N/A 155 B -
43j6fjudq0a3_.js gzip N/A 8.62 kB -
turbopack-02..ejcf.js gzip N/A 4.19 kB -
turbopack-04..36zk.js gzip N/A 4.19 kB -
turbopack-05..ed1i.js gzip N/A 4.19 kB -
turbopack-08..ymqg.js gzip N/A 4.19 kB -
turbopack-1e..75yv.js gzip N/A 4.17 kB -
turbopack-1e..lwrg.js gzip N/A 4.19 kB -
turbopack-1s..5095.js gzip N/A 4.19 kB -
turbopack-1w..leed.js gzip N/A 4.19 kB -
turbopack-1x..h7hw.js gzip N/A 4.19 kB -
turbopack-29..nv35.js gzip N/A 4.19 kB -
turbopack-2d..42om.js gzip N/A 4.2 kB -
turbopack-3f..ewzo.js gzip N/A 4.19 kB -
turbopack-3m..3yye.js gzip N/A 4.19 kB -
turbopack-3z..lv_i.js gzip N/A 4.19 kB -
Total 465 kB 465 kB ⚠️ +39 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 715 B 718 B
Total 715 B 718 B ⚠️ +3 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 434 B 429 B 🟢 5 B (-1%)
Total 434 B 429 B ✅ -5 B

📦 Webpack

Client

Main Bundles
Canary PR Change
2637-HASH.js gzip 4.63 kB N/A -
7724.HASH.js gzip 169 B N/A -
8274-HASH.js gzip 61.3 kB N/A -
8817-HASH.js gzip 5.59 kB N/A -
c3500254-HASH.js gzip 62.8 kB N/A -
framework-HASH.js gzip 59.7 kB 59.7 kB
main-app-HASH.js gzip 255 B 254 B
main-HASH.js gzip 39.4 kB 39.4 kB
webpack-HASH.js gzip 1.68 kB 1.68 kB
5887-HASH.js gzip N/A 5.61 kB -
6522-HASH.js gzip N/A 60.7 kB -
6779-HASH.js gzip N/A 4.63 kB -
8854.HASH.js gzip N/A 169 B -
eab920f9-HASH.js gzip N/A 62.8 kB -
Total 235 kB 235 kB ✅ -621 B
Polyfills
Canary PR Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Total 39.4 kB 39.4 kB
Pages
Canary PR Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 182 B 182 B
css-HASH.js gzip 333 B 334 B
dynamic-HASH.js gzip 1.81 kB 1.8 kB
edge-ssr-HASH.js gzip 255 B 255 B
head-HASH.js gzip 353 B 349 B 🟢 4 B (-1%)
hooks-HASH.js gzip 384 B 382 B
image-HASH.js gzip 581 B 581 B
index-HASH.js gzip 260 B 259 B
link-HASH.js gzip 2.51 kB 2.51 kB
routerDirect..HASH.js gzip 316 B 318 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 313 B 314 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.98 kB 7.97 kB ✅ -10 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 126 kB 126 kB
page.js gzip 273 kB 273 kB
Total 399 kB 399 kB ✅ -349 B
Middleware
Canary PR Change
middleware-b..fest.js gzip 618 B 618 B
middleware-r..fest.js gzip 156 B 156 B
middleware.js gzip 43.8 kB 44.4 kB 🔴 +606 B (+1%)
edge-runtime..pack.js gzip 842 B 842 B
Total 45.4 kB 46 kB ⚠️ +606 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 721 B 720 B
Total 721 B 720 B ✅ -1 B
Build Cache
Canary PR Change
0.pack gzip 4.38 MB 4.38 MB
index.pack gzip 113 kB 113 kB
index.pack.old gzip 115 kB 113 kB 🟢 2.61 kB (-2%)
Total 4.61 MB 4.61 MB ✅ -5.41 kB

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 346 kB 346 kB
app-page-exp..prod.js gzip 192 kB 192 kB
app-page-tur...dev.js gzip 346 kB 346 kB
app-page-tur..prod.js gzip 192 kB 192 kB
app-page-tur...dev.js gzip 342 kB 342 kB
app-page-tur..prod.js gzip 190 kB 190 kB
app-page.run...dev.js gzip 343 kB 343 kB
app-page.run..prod.js gzip 190 kB 190 kB
app-route-ex...dev.js gzip 77 kB 77 kB
app-route-ex..prod.js gzip 52.5 kB 52.5 kB
app-route-tu...dev.js gzip 77.1 kB 77.1 kB
app-route-tu..prod.js gzip 52.6 kB 52.6 kB
app-route-tu...dev.js gzip 76.7 kB 76.7 kB
app-route-tu..prod.js gzip 52.3 kB 52.3 kB
app-route.ru...dev.js gzip 76.6 kB 76.6 kB
app-route.ru..prod.js gzip 52.3 kB 52.3 kB
dist_client_...dev.js gzip 324 B 324 B
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 318 B 318 B
dist_client_...dev.js gzip 317 B 317 B
pages-api-tu...dev.js gzip 43.9 kB 43.9 kB
pages-api-tu..prod.js gzip 33.5 kB 33.5 kB
pages-api.ru...dev.js gzip 43.9 kB 43.9 kB
pages-api.ru..prod.js gzip 33.5 kB 33.5 kB
pages-turbo....dev.js gzip 53.3 kB 53.3 kB
pages-turbo...prod.js gzip 39.1 kB 39.1 kB
pages.runtim...dev.js gzip 53.3 kB 53.3 kB
pages.runtim..prod.js gzip 39.1 kB 39.1 kB
server.runti..prod.js gzip 62.9 kB 62.9 kB
Total 3.06 MB 3.06 MB ⚠️ +161 B
📝 Changed Files (8 files)

Files with changes:

  • app-page-exp..ntime.dev.js
  • app-page-exp..time.prod.js
  • app-page-tur..ntime.dev.js
  • app-page-tur..time.prod.js
  • app-page-tur..ntime.dev.js
  • app-page-tur..time.prod.js
  • app-page.runtime.dev.js
  • app-page.runtime.prod.js
View diffs
app-page-exp..ntime.dev.js
failed to diff
app-page-exp..time.prod.js

Diff too large to display

app-page-tur..ntime.dev.js
failed to diff
app-page-tur..time.prod.js

Diff too large to display

app-page-tur..ntime.dev.js
failed to diff
app-page-tur..time.prod.js

Diff too large to display

app-page.runtime.dev.js
failed to diff
app-page.runtime.prod.js

Diff too large to display

📎 Tarball URL
https://vercel-packages.vercel.app/next/commits/ce1e8fd6c7c6125e61732b675b9ac26d2d79f738/next

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 14, 2026

Merging this PR will improve performance by 3.24%

⚡ 1 improved benchmark
✅ 16 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation packages-bundle.js[full] 1,020.4 ms 988.4 ms +3.24%

Comparing jstory/remove-prefetch-from-instant (e6e1d3b) with canary (54e44b4)

Open in CodSpeed

Footnotes

  1. 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.

Base automatically changed from jstory/add-unstable-prefetch-config to canary April 14, 2026 14:58
@gnoff gnoff force-pushed the jstory/remove-prefetch-from-instant branch from 7bc6d8c to b048604 Compare April 14, 2026 15:22
Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

TypeScript plugin autocomplete for unstable_instant suggests { prefetch: "static" } which is rejected by the strict Zod schema that no longer includes a prefetch property, and the type hint is missing true as a valid value.

Fix on Vercel

@gnoff gnoff force-pushed the jstory/remove-prefetch-from-instant branch from e6e1d3b to 1770048 Compare April 15, 2026 22:49
@nextjs-bot nextjs-bot added the Documentation Related to Next.js' official documentation. label Apr 15, 2026
"auto" mode is the default. It does not need to be explicitly exported
"force-" modes suggest overriding framework heuristics
"force-disabled" disables prefetching for this segment
"force-static" forces any prefetching of this segment to be static
"force-runtime" forces any prefetching of this segment to do runtime prefetching

It's worth noting that when runtime prefetching we fetch the necessary segment and all child segments in a single request. This means that a deeper segment might specify disabled or static and still get conditionally rendered as a runtime prefetch. This was already the behavior of runtime prefetching and not changing in this PR just something to call out since it may be confusing to folks trying to understand how the implementation of prefetching actually works
@gnoff gnoff force-pushed the jstory/remove-prefetch-from-instant branch from 1770048 to f899ae0 Compare April 15, 2026 22:54
gnoff added 2 commits April 15, 2026 15:54
prefetching is now controlled with the prefetch export and this option is inert on the instant export. this removes the prefetch option as a valid property on the instant config type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation. tests Turbopack Related to Turbopack with Next.js. type: next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants