Skip to content

Unify appShells flag with Partial Prefetching#95415

Merged
acdlite merged 4 commits into
canaryfrom
acdlite/remove-app-shells-flag
Jul 16, 2026
Merged

Unify appShells flag with Partial Prefetching#95415
acdlite merged 4 commits into
canaryfrom
acdlite/remove-app-shells-flag

Conversation

@acdlite

@acdlite acdlite commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The experimental appShells flag was added while the feature was being developed. It was not meant to be a public-facing flag.

Some of the behavior that was gated behind the appShells flag is purely an optimization and can be landed without any gate.

There are also some behaviors that we don't want to turn on unless you've opted into the new prefetching model via Partial Prefetching. Arguably these too are internal optimizations, but because they can change the number of requests that are made to the server (e.g. one request for the shell, another for the page data), we will gate these behind Partial Prefetching to minimize the impact on existing applications.

The result is that until you opt into Partial Prefetching, you should not see any meaningfully detrimental impact to prefetching costs, regardless of how your app is structured.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: a966875

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Stats from current PR

🔴 1 regression, 4 improvements

Metric Canary PR Change Trend
Turbo Build Time 4.942s 5.353s 🔴 +411ms (+8%) ▁▁█▄▂
node_modules Size 516 MB 516 MB 🟢 131 kB (0%) ▁████
Webpack Build Time 25.728s 24.396s 🟢 1.332s (-5%) ▁▁▁▂▁
Webpack Build Time (cached) 26.242s 24.707s 🟢 1.535s (-6%) ▁▂▁▂▁
Webpack Cold (First Request) 3.394s 3.239s 🟢 155ms (-5%) ▁▁▁▂▁
📊 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) 812ms 812ms ▁▂█▂▂
Cold (Ready in log) 775ms 778ms ▁▁█▂▁
Cold (First Request) 1.270s 1.307s ▁▁█▃▁
Warm (Listen) 813ms 813ms ▁▂█▂▂
Warm (Ready in log) 787ms 783ms ▁▁█▂▁
Warm (First Request) 1.294s 1.301s ▁▁█▃▁
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 813ms 761ms ▁▁▁▂▂
Cold (Ready in log) 778ms 762ms ▁▁▁▂▂
Cold (First Request) 3.394s 3.239s 🟢 155ms (-5%) ▁▁▁▂▁
Warm (Listen) 762ms 760ms ▁▂▁▁▂
Warm (Ready in log) 765ms 754ms ▁▁▁▁▁
Warm (First Request) 3.397s 3.300s ▁▁▁▁▂

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 4.942s 5.353s 🔴 +411ms (+8%) ▁▁█▄▂
Cached Build 5.098s 5.184s ▁▂█▄▂
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 25.728s 24.396s 🟢 1.332s (-5%) ▁▁▁▂▁
Cached Build 26.242s 24.707s 🟢 1.535s (-6%) ▁▂▁▂▁
node_modules Size 516 MB 516 MB 🟢 131 kB (0%) ▁████
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
01ej5hausrj59.js gzip 155 B N/A -
03gmyxr7dukvs.js gzip 10.3 kB N/A -
040t1q17lo593.js gzip 8.77 kB N/A -
0bb0vtp8dwsez.js gzip 450 B N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0l0sr6gau5xjn.js gzip 3.53 kB N/A -
0nxqz3q165m2l.js gzip 220 B N/A -
0qr-1tnb7_hg5.js gzip 5.72 kB N/A -
0uilzvklme4ea.js gzip 8.76 kB N/A -
0z0y83mfx-l-h.js gzip 10 kB N/A -
1_-g_r52k540c.js gzip 7.4 kB N/A -
11onfdpbudeec.js gzip 154 B N/A -
15ok8ydf274z0.js gzip 10.6 kB N/A -
16cqqcigykfea.js gzip 13.6 kB N/A -
17h18zxt1915l.js gzip 1.46 kB N/A -
19vifh5iqephk.js gzip 158 B N/A -
1cjyeh2th3h3g.js gzip 71 kB N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1fq1h7dxad4cv.js gzip 9.44 kB N/A -
1fym-adbk_69_.js gzip 13.1 kB N/A -
1gav7nfh4y8ln.js gzip 8.76 kB N/A -
1mbayfijnc4mr.js gzip 154 B N/A -
1o34vh44ndvtu.js gzip 13.2 kB N/A -
1ufl-_jc-p-jv.js gzip 65.6 kB N/A -
23ahh8aj11eib.js gzip 152 B N/A -
24s61_7wt5wma.js gzip 153 B N/A -
28zvm2eil07rs.js gzip 155 B N/A -
29fgq-30c4we5.js gzip 158 B N/A -
2g72182uckjva.js gzip 154 B N/A -
2ienk5oyaycls.js gzip 155 B N/A -
2ls1p246l5h9x.js gzip 166 B N/A -
2rypqffktcxqh.js gzip 8.69 kB N/A -
2uqsizxtehgqf.js gzip 8.79 kB N/A -
2vzktdqwbijqc.js gzip 8.74 kB N/A -
2wcar9zudlttv.js gzip 44.9 kB N/A -
36-aonvjl8-q9.js gzip 154 B N/A -
3c244akvx_-be.js gzip 8.74 kB N/A -
3dmlemitx3ef3.js gzip 2.29 kB N/A -
3yjhj-iz0bdp4.js gzip 151 B N/A -
4237vdj6eyslt.js gzip 8.7 kB N/A -
turbopack-0g..lah7.js gzip 3.78 kB N/A -
turbopack-0j..ua2_.js gzip 3.77 kB N/A -
turbopack-0m..4-7v.js gzip 3.78 kB N/A -
turbopack-0s..7xkv.js gzip 3.77 kB N/A -
turbopack-14..p97a.js gzip 3.77 kB N/A -
turbopack-1f..7d2q.js gzip 3.77 kB N/A -
turbopack-1m..pdz-.js gzip 3.78 kB N/A -
turbopack-28..g4wv.js gzip 3.78 kB N/A -
turbopack-2c..8hif.js gzip 3.79 kB N/A -
turbopack-2h..bwrl.js gzip 3.77 kB N/A -
turbopack-33..nc2f.js gzip 3.77 kB N/A -
turbopack-3b..2w-8.js gzip 3.77 kB N/A -
turbopack-3f..yfnt.js gzip 3.77 kB N/A -
turbopack-3s..zbad.js gzip 3.76 kB N/A -
0_brf1o8xtfgw.js gzip N/A 156 B -
00tc16j5-eos9.js gzip N/A 1.46 kB -
0gaw1gmpwuwkn.js gzip N/A 8.8 kB -
0lfd6n4hnvfus.js gzip N/A 156 B -
0mwo2e6a43qd6.js gzip N/A 154 B -
0oxxm8ra6x40w.js gzip N/A 155 B -
12zyjjmq4oad1.js gzip N/A 5.72 kB -
1b_5lm2rb0cxg.js gzip N/A 65.6 kB -
1k9cc4-gpa2cx.js gzip N/A 13.1 kB -
1kfiwrcr725kl.js gzip N/A 13.2 kB -
1n59uogejo81s.js gzip N/A 10.3 kB -
1npei3hlexdv3.js gzip N/A 9.99 kB -
1q-0qyccjh4q3.js gzip N/A 158 B -
1ssuiwj_rnpc5.js gzip N/A 8.77 kB -
2-phc9obd3nyd.js gzip N/A 8.77 kB -
20z9kb96_57f4.js gzip N/A 164 B -
24utq57r3l1cw.js gzip N/A 8.7 kB -
29tie9lu2une4.js gzip N/A 71 kB -
2aw0kxkhyra0_.js gzip N/A 153 B -
2eemzo7z71a10.js gzip N/A 154 B -
2fhjq6ek3srmr.js gzip N/A 8.69 kB -
2g0t7upz_v-hf.js gzip N/A 10.6 kB -
2ia9qqy99aie9.js gzip N/A 13.6 kB -
2n5fp99a5xt9s.js gzip N/A 7.4 kB -
2oza28kdqvoay.js gzip N/A 8.74 kB -
2s1ku9sx60j5g.js gzip N/A 155 B -
2smk18o7qzte6.js gzip N/A 154 B -
2zh8-mmhujy8o.js gzip N/A 2.29 kB -
30h_m0irj-q6p.js gzip N/A 221 B -
37ejbfx1u9lpo.js gzip N/A 8.75 kB -
38c63ct4i1cy7.js gzip N/A 449 B -
38pfb-vjc58zl.js gzip N/A 160 B -
3jimpal3lvz5e.js gzip N/A 9.44 kB -
3q86bccmeq9ht.js gzip N/A 45.1 kB -
3su6a4l8jbfth.js gzip N/A 3.53 kB -
3vp18tbs9ie7b.js gzip N/A 156 B -
3wb4pe4z4-aim.js gzip N/A 8.77 kB -
43cuc9gzge2dj.js gzip N/A 151 B -
turbopack-0c..ceu6.js gzip N/A 3.76 kB -
turbopack-0r..o21k.js gzip N/A 3.77 kB -
turbopack-0v..6n4f.js gzip N/A 3.78 kB -
turbopack-12..bfke.js gzip N/A 3.77 kB -
turbopack-1a..ll78.js gzip N/A 3.77 kB -
turbopack-1j..lqtq.js gzip N/A 3.77 kB -
turbopack-1v..tzol.js gzip N/A 3.79 kB -
turbopack-1x..lsi3.js gzip N/A 3.78 kB -
turbopack-2i..bzur.js gzip N/A 3.77 kB -
turbopack-3_..wlef.js gzip N/A 3.77 kB -
turbopack-3-..hdvm.js gzip N/A 3.77 kB -
turbopack-3l..eco6.js gzip N/A 3.77 kB -
turbopack-3m..txtb.js gzip N/A 3.77 kB -
turbopack-3w..c3ex.js gzip N/A 3.78 kB -
Total 447 kB 447 kB ⚠️ +226 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 757 B 749 B 🟢 8 B (-1%)
Total 757 B 749 B ✅ -8 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 431 B 436 B 🔴 +5 B (+1%)
Total 431 B 436 B ⚠️ +5 B

📦 Webpack

Client

Main Bundles
Canary PR Change
2486.HASH.js gzip 169 B N/A -
3146-HASH.js gzip 64 kB N/A -
39fcf99b-HASH.js gzip 62.9 kB N/A -
8443-HASH.js gzip 4.68 kB N/A -
9431-HASH.js gzip 5.62 kB N/A -
framework-HASH.js gzip 59.8 kB 59.8 kB
main-app-HASH.js gzip 255 B 254 B
main-HASH.js gzip 39.7 kB 40.1 kB 🔴 +452 B (+1%)
webpack-HASH.js gzip 1.68 kB 1.68 kB
6105-HASH.js gzip N/A 5.63 kB -
764.HASH.js gzip N/A 169 B -
8898-HASH.js gzip N/A 63.5 kB -
9597-HASH.js gzip N/A 4.65 kB -
e1ccab69-HASH.js gzip N/A 62.9 kB -
Total 239 kB 239 kB ✅ -31 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 194 B 194 B
_error-HASH.js gzip 183 B 182 B
css-HASH.js gzip 335 B 335 B
dynamic-HASH.js gzip 1.8 kB 1.8 kB
edge-ssr-HASH.js gzip 255 B 254 B
head-HASH.js gzip 351 B 349 B
hooks-HASH.js gzip 384 B 384 B
image-HASH.js gzip 580 B 580 B
index-HASH.js gzip 259 B 259 B
link-HASH.js gzip 2.49 kB 2.49 kB
routerDirect..HASH.js gzip 319 B 319 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 315 B 313 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.96 kB 7.95 kB ✅ -7 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 128 kB 128 kB
page.js gzip 283 kB 285 kB 🔴 +2.23 kB (+1%)
Total 411 kB 413 kB ⚠️ +1.86 kB
Middleware
Canary PR Change
middleware-b..fest.js gzip 618 B 614 B
middleware-r..fest.js gzip 156 B 155 B
middleware.js gzip 45.2 kB 45.2 kB
edge-runtime..pack.js gzip 842 B 842 B
Total 46.9 kB 46.9 kB
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 719 B 720 B
Total 719 B 720 B ⚠️ +1 B
Build Cache
Canary PR Change
0.pack gzip 4.81 MB 4.81 MB
index.pack gzip 119 kB 119 kB
index.pack.old gzip 119 kB 119 kB
Total 5.04 MB 5.05 MB ⚠️ +456 B

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 364 kB 364 kB
app-page-exp..prod.js gzip 201 kB 201 kB
app-page-tur...dev.js gzip 364 kB 363 kB
app-page-tur..prod.js gzip 201 kB 201 kB
app-page-tur...dev.js gzip 360 kB 360 kB
app-page-tur..prod.js gzip 199 kB 199 kB
app-page.run...dev.js gzip 361 kB 360 kB
app-page.run..prod.js gzip 199 kB 199 kB
app-route-ex...dev.js gzip 81.5 kB 81.5 kB
app-route-ex..prod.js gzip 55.4 kB 55.4 kB
app-route-tu...dev.js gzip 81.6 kB 81.5 kB
app-route-tu..prod.js gzip 55.4 kB 55.4 kB
app-route-tu...dev.js gzip 81.2 kB 81.1 kB
app-route-tu..prod.js gzip 55.2 kB 55.1 kB
app-route.ru...dev.js gzip 81.1 kB 81.1 kB
app-route.ru..prod.js gzip 55.2 kB 55.1 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 45.2 kB 45.2 kB
pages-api-tu..prod.js gzip 34 kB 33.9 kB
pages-api.ru...dev.js gzip 45.2 kB 45.2 kB
pages-api.ru..prod.js gzip 33.9 kB 33.9 kB
pages-turbo....dev.js gzip 54.7 kB 54.6 kB
pages-turbo...prod.js gzip 39.6 kB 39.6 kB
pages.runtim...dev.js gzip 54.7 kB 54.6 kB
pages.runtim..prod.js gzip 39.6 kB 39.5 kB
server.runti..prod.js gzip 67.5 kB 67.5 kB
use-cache-pr...dev.js gzip 71.4 kB 71.4 kB
use-cache-pr...dev.js gzip 71.4 kB 71.4 kB
use-cache-pr...dev.js gzip 69.7 kB 69.7 kB
use-cache-pr...dev.js gzip 69.7 kB 69.7 kB
Total 3.49 MB 3.49 MB ✅ -2.3 kB
📝 Changed Files (25 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
  • app-route-ex..ntime.dev.js
  • app-route-ex..time.prod.js
  • app-route-tu..ntime.dev.js
  • app-route-tu..time.prod.js
  • app-route-tu..ntime.dev.js
  • app-route-tu..time.prod.js
  • app-route.runtime.dev.js
  • app-route.ru..time.prod.js
  • pages-api-tu..ntime.dev.js
  • pages-api-tu..time.prod.js
  • pages-api.runtime.dev.js
  • pages-api.ru..time.prod.js
  • ... and 5 more
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
failed to diff
app-route-ex..ntime.dev.js

Diff too large to display

app-route-ex..time.prod.js

Diff too large to display

app-route-tu..ntime.dev.js

Diff too large to display

app-route-tu..time.prod.js

Diff too large to display

app-route-tu..ntime.dev.js

Diff too large to display

app-route-tu..time.prod.js

Diff too large to display

app-route.runtime.dev.js

Diff too large to display

app-route.ru..time.prod.js

Diff too large to display

pages-api-tu..ntime.dev.js

Diff too large to display

pages-api-tu..time.prod.js

Diff too large to display

pages-api.runtime.dev.js

Diff too large to display

pages-api.ru..time.prod.js

Diff too large to display

pages-turbo...ntime.dev.js

Diff too large to display

pages-turbo...time.prod.js

Diff too large to display

pages.runtime.dev.js

Diff too large to display

pages.runtime.prod.js

Diff too large to display

server.runtime.prod.js

Diff too large to display

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

Commit: a966875

@acdlite
acdlite force-pushed the acdlite/remove-app-shells-flag branch from 7cee0d1 to 68ff8dc Compare July 16, 2026 15:57
acdlite added 4 commits July 16, 2026 15:20
App Shells was mostly a temporary kill switch in case we needed to quickly
turn off the prefetch/render behavior that shipped alongside Cache Components.
It's stable now, so remove the flag and inline every reference as if it were
`true`, deleting the dead "off" branches.

The one behavior that was incidentally gated on App Shells — the client's
two-phase (Shell then Speculative) prefetch flow — should only apply when
Partial Prefetching is on. Re-gate it on the route's
SubtreeHasPartialPrefetching / SubtreeHasRuntimePrefetch hints, matching the
server's anySegmentHasPartialPrefetchingEnabled, so client and server agree on
which routes are "partial prefetching".

Everything gated on partialPrefetching / PrefetchingMode.Partial is a separate
system (despite the shared "shell" naming) and is untouched. Test configs drop
their appShells overrides; the errors.json entry is left in place.
Under the removed appShells flag every cacheComponents route entered the
two-phase (Shell) client prefetch flow. It's now scoped to routes that opt
into Partial Prefetching. Update the affected fixtures/tests:

- prefetch-runtime: links use prefetch={true} so per-param runtime prefetches
  still fire (auto links now only warm the reusable shell).
- prefetch-app-shell: fully-static routes opt into prefetch='partial' so their
  shell is extracted/reused; static-shell assertions expect a single response
  (the redundant runtime-shell prefetch no longer fires for fully-static
  routes).
Runtime-prefetch links (allow-runtime routes) use prefetch={true} so the
per-request runtime prefetch still fires under the Partial-Prefetching-scoped
two-phase flow — an auto link now only warms the reusable shell.
The runtime-prefetch warning test needs a per-request runtime prefetch
(PPRRuntime) to fire. Opt the route into instant + keep prefetch={true} on the
link so the per-request prefetch still happens under the Partial-Prefetching-
scoped two-phase flow (an auto prefetch of an allow-runtime route now only
warms the reusable shell, which defers params and never hits the cache).
@acdlite
acdlite force-pushed the acdlite/remove-app-shells-flag branch from 459aac7 to a966875 Compare July 16, 2026 19:20
@acdlite acdlite changed the title Remove experimental.appShells flag Unify appShells flag with Partial Prefetching Jul 16, 2026
@acdlite
acdlite marked this pull request as ready for review July 16, 2026 19:29
@acdlite
acdlite requested a review from gnoff July 16, 2026 19:29
@acdlite
acdlite merged commit bc48ef7 into canary Jul 16, 2026
128 checks passed
@acdlite
acdlite deleted the acdlite/remove-app-shells-flag branch July 16, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants