Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide interception rewrites to edge runtime #61414

Merged

Conversation

ztanner
Copy link
Member

@ztanner ztanner commented Jan 30, 2024

In #61794, the routes manifest is used to find the interception route rewrites in next-server and computed on the fly in next-dev-server based on appPaths.

The edge runtime doesn't have access to the routes manifest nor a full list of app paths. This writes an entry for the edge runtime to make the interception routes readable, and adds plumbing to return them in the getInterceptionRouteRewrites handling in web-server. This is what we use to signal to the server whether to return ‘Next-URL’ in the Vary for RSC requests.

This piggybacks on the existing interception routes test but adds an edge runtime case.

Closes NEXT-2304

@ijjk
Copy link
Member

ijjk commented Jan 30, 2024

Tests Passed

@ijjk
Copy link
Member

ijjk commented Jan 30, 2024

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
buildDuration 11.8s 11.7s N/A
buildDurationCached 5.9s 5s N/A
nodeModulesSize 196 MB 196 MB ⚠️ +18.7 kB
nextStartRea..uration (ms) 434ms 425ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
3f784ff6-HASH.js gzip 53.5 kB 53.5 kB N/A
423.HASH.js gzip 185 B 181 B N/A
68-HASH.js gzip 29.7 kB 29.7 kB N/A
framework-HASH.js gzip 45.2 kB 45.2 kB
main-app-HASH.js gzip 238 B 240 B N/A
main-HASH.js gzip 31.8 kB 31.9 kB N/A
webpack-HASH.js gzip 1.7 kB 1.7 kB
Overall change 46.9 kB 46.9 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
_app-HASH.js gzip 194 B 195 B N/A
_error-HASH.js gzip 182 B 181 B N/A
amp-HASH.js gzip 502 B 501 B N/A
css-HASH.js gzip 320 B 322 B N/A
dynamic-HASH.js gzip 2.5 kB 2.5 kB N/A
edge-ssr-HASH.js gzip 255 B 256 B N/A
head-HASH.js gzip 350 B 349 B N/A
hooks-HASH.js gzip 368 B 369 B N/A
image-HASH.js gzip 4.19 kB 4.18 kB N/A
index-HASH.js gzip 257 B 256 B N/A
link-HASH.js gzip 2.67 kB 2.67 kB N/A
routerDirect..HASH.js gzip 310 B 311 B N/A
script-HASH.js gzip 384 B 383 B N/A
withRouter-HASH.js gzip 306 B 308 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 106 B 106 B
Client Build Manifests
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
_buildManifest.js gzip 483 B 485 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
index.html gzip 527 B 527 B
link.html gzip 541 B 540 B N/A
withRouter.html gzip 522 B 523 B N/A
Overall change 527 B 527 B
Edge SSR bundle Size Overall increase ⚠️
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
edge-ssr.js gzip 94.2 kB 94.4 kB ⚠️ +242 B
page.js gzip 150 kB 150 kB ⚠️ +339 B
Overall change 244 kB 244 kB ⚠️ +581 B
Middleware size
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
middleware-b..fest.js gzip 619 B 624 B N/A
middleware-r..fest.js gzip 151 B 149 B N/A
middleware.js gzip 47.4 kB 47.4 kB N/A
edge-runtime..pack.js gzip 1.94 kB 1.94 kB
Overall change 1.94 kB 1.94 kB
Next Runtimes
vercel/next.js canary vercel/next.js 01-30-provide_interception_rewrites_to_edge_runtime Change
app-page-exp...dev.js gzip 166 kB 166 kB
app-page-exp..prod.js gzip 95.4 kB 95.4 kB
app-page-tur..prod.js gzip 97.2 kB 97.2 kB
app-page-tur..prod.js gzip 91.6 kB 91.6 kB
app-page.run...dev.js gzip 136 kB 136 kB
app-page.run..prod.js gzip 90.2 kB 90.2 kB
app-route-ex...dev.js gzip 22 kB 22 kB
app-route-ex..prod.js gzip 14.9 kB 14.9 kB
app-route-tu..prod.js gzip 14.9 kB 14.9 kB
app-route-tu..prod.js gzip 14.7 kB 14.7 kB
app-route.ru...dev.js gzip 21.7 kB 21.7 kB
app-route.ru..prod.js gzip 14.7 kB 14.7 kB
pages-api-tu..prod.js gzip 9.43 kB 9.43 kB
pages-api.ru...dev.js gzip 9.7 kB 9.7 kB
pages-api.ru..prod.js gzip 9.43 kB 9.43 kB
pages-turbo...prod.js gzip 22 kB 22 kB
pages.runtim...dev.js gzip 22.7 kB 22.7 kB
pages.runtim..prod.js gzip 22 kB 22 kB
server.runti..prod.js gzip 49.9 kB 49.9 kB N/A
Overall change 874 kB 874 kB
Diff details
Diff for page.js

Diff too large to display

Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Diff for server.runtime.prod.js

Diff too large to display

Commit: 5ddc84e

@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch from 534f837 to 557dbe8 Compare January 30, 2024 23:18
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch 2 times, most recently from cfbb1a2 to 22796c7 Compare January 30, 2024 23:45
@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch from 557dbe8 to 916576c Compare January 30, 2024 23:50
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch 2 times, most recently from 811da62 to b104d0d Compare January 31, 2024 01:23
@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch from 916576c to 97b6040 Compare January 31, 2024 01:25
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from b104d0d to 19bfed5 Compare January 31, 2024 01:26
@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch from 97b6040 to 620b40b Compare January 31, 2024 02:17
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch 2 times, most recently from 1dc429b to c438ed6 Compare January 31, 2024 03:34
@ijjk ijjk added the Turbopack Related to Turbopack with Next.js. label Jan 31, 2024
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from c438ed6 to 8ecfc58 Compare January 31, 2024 03:41
@ztanner ztanner marked this pull request as ready for review January 31, 2024 03:56
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from 4172e5b to 76dca9d Compare February 6, 2024 15:14
@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch 3 times, most recently from 843f681 to 74e1f8b Compare February 6, 2024 23:05
@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch 4 times, most recently from 67494f0 to 4936d42 Compare February 7, 2024 21:11
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from 76dca9d to 048aa2f Compare February 7, 2024 21:33
@ztanner ztanner force-pushed the 01-26-fix_erroneous_prefetch_cache_misses branch from 4936d42 to e2c7fe9 Compare February 7, 2024 21:46
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from 048aa2f to f9835c8 Compare February 7, 2024 23:30
@ztanner ztanner changed the base branch from 01-26-fix_erroneous_prefetch_cache_misses to 02-07-conditionally_send_Next-URL_in_Vary_response February 7, 2024 23:30
@ztanner ztanner force-pushed the 02-07-conditionally_send_Next-URL_in_Vary_response branch 2 times, most recently from 0f77d79 to 8bd70d5 Compare February 8, 2024 00:23
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch 2 times, most recently from c28deef to e8933c8 Compare February 9, 2024 16:05
@ztanner ztanner force-pushed the 02-07-conditionally_send_Next-URL_in_Vary_response branch 2 times, most recently from 02c4657 to c329086 Compare February 9, 2024 16:59
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from e8933c8 to 704d09d Compare February 9, 2024 17:02
Base automatically changed from 02-07-conditionally_send_Next-URL_in_Vary_response to canary February 9, 2024 17:57
@ztanner ztanner force-pushed the 01-30-provide_interception_rewrites_to_edge_runtime branch from 704d09d to 5ddc84e Compare February 9, 2024 17:58
@ztanner ztanner merged commit 3e3c012 into canary Feb 9, 2024
70 checks passed
@ztanner ztanner deleted the 01-30-provide_interception_rewrites_to_edge_runtime branch February 9, 2024 18:30
Copy link
Member Author

ztanner commented Feb 9, 2024

Merge activity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Next.js team PRs by the Next.js team. locked Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants