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

Update Middleware Routing #3930

Merged
merged 5 commits into from
Feb 28, 2023
Merged

Update Middleware Routing #3930

merged 5 commits into from
Feb 28, 2023

Conversation

jridgewell
Copy link
Contributor

@jridgewell jridgewell commented Feb 23, 2023

This accomplishes 2 things:

  • Moves the creation of the edge info onto the Next.js side
  • Extracts the middleware's export const config = {}, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623

@vercel
Copy link

vercel bot commented Feb 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
examples-vite-web 🔄 Building (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
9 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-cra-web ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2023 at 9:48PM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2023

🟢 CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

Benchmark for 639b4d5

Test Base PR % Significant %
bench_startup/Turbopack SSR/1000 modules 2070.91ms ± 5.02ms 2054.79ms ± 2.10ms -0.78% -0.09%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 11.38ms ± 0.09ms 11.71ms ± 0.10ms +2.86%
bench_hmr_to_commit/Turbopack RCC/1000 modules 16.77ms ± 0.12ms 16.93ms ± 0.25ms +0.96%
bench_hmr_to_commit/Turbopack RSC/1000 modules 505.73ms ± 1.88ms 505.16ms ± 0.88ms -0.11%
bench_hmr_to_commit/Turbopack SSR/1000 modules 11.38ms ± 0.05ms 11.49ms ± 0.09ms +0.95%
bench_hmr_to_eval/Turbopack CSR/1000 modules 10.71ms ± 0.09ms 10.93ms ± 0.07ms +2.03%
bench_hmr_to_eval/Turbopack RCC/1000 modules 15.16ms ± 0.34ms 15.33ms ± 0.29ms +1.11%
bench_hmr_to_eval/Turbopack SSR/1000 modules 10.30ms ± 0.08ms 10.55ms ± 0.11ms +2.49%
bench_hydration/Turbopack RCC/1000 modules 3835.95ms ± 9.78ms 3841.54ms ± 12.72ms +0.15%
bench_hydration/Turbopack RSC/1000 modules 3517.44ms ± 7.39ms 3523.81ms ± 16.04ms +0.18%
bench_hydration/Turbopack SSR/1000 modules 3396.50ms ± 14.40ms 3373.52ms ± 11.56ms -0.68%
bench_startup/Turbopack CSR/1000 modules 2557.40ms ± 6.72ms 2560.87ms ± 8.20ms +0.14%
bench_startup/Turbopack RCC/1000 modules 2356.27ms ± 5.74ms 2364.86ms ± 5.69ms +0.36%
bench_startup/Turbopack RSC/1000 modules 2318.90ms ± 9.97ms 2309.24ms ± 8.18ms -0.42%
bench_startup/Turbopack SSR/1000 modules 2070.91ms ± 5.02ms 2054.79ms ± 2.10ms -0.78% -0.09%

@jridgewell jridgewell changed the title Extract middleware matcher config Update Middleware Routing Feb 25, 2023
In order to setup the middleware in routing, we need to know what routes to match on without executing the middleware edgeInfo itself.
@github-actions
Copy link
Contributor

Benchmark for a054105

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 13.04ms ± 0.10ms 12.91ms ± 0.11ms -1.06%
bench_hmr_to_commit/Turbopack RCC/1000 modules 16.76ms ± 0.10ms 16.68ms ± 0.14ms -0.45%
bench_hmr_to_commit/Turbopack RSC/1000 modules 536.27ms ± 2.36ms 535.73ms ± 1.91ms -0.10%
bench_hmr_to_commit/Turbopack SSR/1000 modules 12.77ms ± 0.09ms 12.88ms ± 0.08ms +0.87%
bench_hmr_to_eval/Turbopack CSR/1000 modules 11.67ms ± 0.13ms 11.61ms ± 0.13ms -0.54%
bench_hmr_to_eval/Turbopack RCC/1000 modules 15.67ms ± 0.16ms 15.35ms ± 0.15ms -2.01%
bench_hmr_to_eval/Turbopack SSR/1000 modules 11.76ms ± 0.09ms 12.05ms ± 0.16ms +2.48%
bench_hydration/Turbopack RCC/1000 modules 4118.01ms ± 12.80ms 4078.74ms ± 13.06ms -0.95%
bench_hydration/Turbopack RSC/1000 modules 3738.77ms ± 15.49ms 3776.55ms ± 22.47ms +1.01%
bench_hydration/Turbopack SSR/1000 modules 3622.55ms ± 15.40ms 3586.21ms ± 8.07ms -1.00%
bench_startup/Turbopack CSR/1000 modules 2749.92ms ± 9.64ms 2714.70ms ± 8.85ms -1.28%
bench_startup/Turbopack RCC/1000 modules 2495.01ms ± 10.60ms 2482.77ms ± 6.63ms -0.49%
bench_startup/Turbopack RSC/1000 modules 2461.58ms ± 11.17ms 2437.40ms ± 12.16ms -0.98%
bench_startup/Turbopack SSR/1000 modules 2181.92ms ± 2.92ms 2188.14ms ± 2.07ms +0.28%

@jridgewell jridgewell added the pr: automerge Kodiak will merge these automatically after checks pass label Feb 27, 2023
@github-actions
Copy link
Contributor

Benchmark for 4cce076

Test Base PR % Significant %
bench_hydration/Turbopack RSC/1000 modules 3572.34ms ± 21.33ms 3507.26ms ± 11.15ms -1.82% -0.00%
bench_startup/Turbopack RSC/1000 modules 2349.00ms ± 7.90ms 2390.15ms ± 11.47ms +1.75% +0.10%
bench_startup/Turbopack SSR/1000 modules 2159.12ms ± 3.47ms 2097.72ms ± 7.77ms -2.84% -1.81%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 12.63ms ± 0.15ms 12.53ms ± 0.12ms -0.74%
bench_hmr_to_commit/Turbopack RCC/1000 modules 16.43ms ± 0.41ms 16.85ms ± 0.26ms +2.52%
bench_hmr_to_commit/Turbopack RSC/1000 modules 510.67ms ± 2.07ms 506.53ms ± 4.15ms -0.81%
bench_hmr_to_commit/Turbopack SSR/1000 modules 12.45ms ± 0.10ms 12.55ms ± 0.07ms +0.85%
bench_hmr_to_eval/Turbopack CSR/1000 modules 10.37ms ± 0.11ms 10.37ms ± 0.09ms +0.01%
bench_hmr_to_eval/Turbopack RCC/1000 modules 14.98ms ± 0.29ms 14.82ms ± 0.22ms -1.08%
bench_hmr_to_eval/Turbopack SSR/1000 modules 10.89ms ± 0.18ms 10.41ms ± 0.09ms -4.41%
bench_hydration/Turbopack RCC/1000 modules 3838.28ms ± 12.77ms 3863.81ms ± 16.55ms +0.67%
bench_hydration/Turbopack RSC/1000 modules 3572.34ms ± 21.33ms 3507.26ms ± 11.15ms -1.82% -0.00%
bench_hydration/Turbopack SSR/1000 modules 3364.58ms ± 8.12ms 3361.61ms ± 11.96ms -0.09%
bench_startup/Turbopack CSR/1000 modules 2591.85ms ± 10.48ms 2578.22ms ± 7.38ms -0.53%
bench_startup/Turbopack RCC/1000 modules 2404.69ms ± 8.39ms 2396.76ms ± 7.77ms -0.33%
bench_startup/Turbopack RSC/1000 modules 2349.00ms ± 7.90ms 2390.15ms ± 11.47ms +1.75% +0.10%
bench_startup/Turbopack SSR/1000 modules 2159.12ms ± 3.47ms 2097.72ms ± 7.77ms -2.84% -1.81%

@github-actions
Copy link
Contributor

Benchmark for f8afd01

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 11.96ms ± 0.06ms 11.94ms ± 0.11ms -0.12%
bench_hmr_to_commit/Turbopack RCC/1000 modules 16.76ms ± 0.16ms 16.91ms ± 0.13ms +0.90%
bench_hmr_to_commit/Turbopack RSC/1000 modules 508.07ms ± 2.56ms 504.88ms ± 1.50ms -0.63%
bench_hmr_to_commit/Turbopack SSR/1000 modules 11.97ms ± 0.14ms 11.99ms ± 0.11ms +0.17%
bench_hmr_to_eval/Turbopack CSR/1000 modules 11.23ms ± 0.08ms 11.28ms ± 0.12ms +0.45%
bench_hmr_to_eval/Turbopack RCC/1000 modules 15.41ms ± 0.15ms 15.33ms ± 0.33ms -0.46%
bench_hmr_to_eval/Turbopack SSR/1000 modules 10.98ms ± 0.07ms 11.08ms ± 0.11ms +0.91%
bench_hydration/Turbopack RCC/1000 modules 3840.71ms ± 13.90ms 3840.29ms ± 12.41ms -0.01%
bench_hydration/Turbopack RSC/1000 modules 3517.68ms ± 10.28ms 3513.05ms ± 9.73ms -0.13%
bench_hydration/Turbopack SSR/1000 modules 3432.56ms ± 47.17ms 3359.10ms ± 10.37ms -2.14%
bench_startup/Turbopack CSR/1000 modules 2578.57ms ± 5.84ms 2578.32ms ± 7.35ms -0.01%
bench_startup/Turbopack RCC/1000 modules 2371.00ms ± 7.32ms 2354.69ms ± 8.63ms -0.69%
bench_startup/Turbopack RSC/1000 modules 2309.13ms ± 9.48ms 2300.51ms ± 8.80ms -0.37%
bench_startup/Turbopack SSR/1000 modules 2065.69ms ± 3.38ms 2067.52ms ± 2.31ms +0.09%

@kodiakhq kodiakhq bot merged commit ec742f7 into main Feb 28, 2023
@kodiakhq kodiakhq bot deleted the jrl-middleware-config branch February 28, 2023 02:09
ijjk pushed a commit to vercel/next.js that referenced this pull request Mar 1, 2023
ijjk added a commit to vercel/next.js that referenced this pull request Mar 1, 2023
This implements middleware support for Turbopack's route resolver. In
vercel/turborepo#3930, I'm updating the data that we
pass to include a new `MiddlewareConfig`, which includes the files
needed for invoking the edge function and the matchers extracted from
the middleware's static `export config = {}`.

~~This needs to wait for vercel/turborepo#3930 to
land first~~ Merged.
Fixes https://linear.app/vercel/issue/WEB-624

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
jridgewell added a commit to vercel/next.js that referenced this pull request Mar 10, 2023
This accomplishes 2 things:
- Moves the creation of the edge info onto the Next.js side
- Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
This accomplishes 2 things:
- Moves the creation of the edge info onto the Next.js side
- Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
This accomplishes 2 things:
- Moves the creation of the edge info onto the Next.js side
- Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
This accomplishes 2 things:
- Moves the creation of the edge info onto the Next.js side
- Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
This accomplishes 2 things:
- Moves the creation of the edge info onto the Next.js side
- Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants