Skip to content

perf(link): omit Pages runtime in app-only builds#2225

Merged
james-elicx merged 3 commits into
cloudflare:mainfrom
TheAlexLichter:perf/omit-pages-link-runtime-app-only
Jun 22, 2026
Merged

perf(link): omit Pages runtime in app-only builds#2225
james-elicx merged 3 commits into
cloudflare:mainfrom
TheAlexLichter:perf/omit-pages-link-runtime-app-only

Conversation

@TheAlexLichter

@TheAlexLichter TheAlexLichter commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Pure App Router builds now compile Pages-only navigation, prefetching, interpolation, and hybrid route ownership logic out of next/link. Pages Router and hybrid applications retain the existing behavior. If the App navigation runtime is unavailable, App-only links use document navigation so the destination still renders without relying on a missing client runtime.

@pkg-pr-new

pkg-pr-new Bot commented Jun 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2225
npm i https://pkg.pr.new/vinext@2225

commit: 173f923

@TheAlexLichter

Copy link
Copy Markdown
Collaborator Author

Note: I will clean this up a. bit more after 2222-2225 are merged

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 173f923 against base 95b320f using alternating same-runner rounds. Next.js was unchanged and skipped.

4 improved · 0 regressed · 2 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 132.8 KB 121.0 KB 🟢 -8.9%
Client entry size (gzip) vinext 118.7 KB 116.4 KB 🟢 -1.9%
Dev server cold start vinext 2.36 s 2.36 s ⚫ +0.1%
Production build time vinext 2.84 s 2.72 s 🟢 -4.3%
RSC entry closure size (gzip) vinext 91.0 KB 91.0 KB ⚫ -0.0%
Server bundle size (gzip) vinext 161.7 KB 154.7 KB 🟢 -4.3%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

Comment thread packages/vinext/src/shims/link.tsx Outdated
@TheAlexLichter TheAlexLichter force-pushed the perf/omit-pages-link-runtime-app-only branch from 958344f to 76b2311 Compare June 22, 2026 13:19
@james-elicx james-elicx merged commit d6afa2e into cloudflare:main Jun 22, 2026
47 checks passed
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