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

Share request resolving logic between http and update servers #3597

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

alexkirsz
Copy link
Contributor

@alexkirsz alexkirsz commented Feb 2, 2023

With the addition of the Next.js routing layer at the root of our content sources, we need the update server to also be able to follow Next.js rewrites, like the HTTP server.

This requires the following:

  • Rewrites need to be able to indicate a source where to "resume" after rewriting. Otherwise, we would enter an infinite loop of the Next.js layer rewriting to the Next.js layer.
  • The resolving logic from process_request_with_content_source needs to be extracted into its own function, so it may be called both from the HTTP server (which expects fully resolved ReadRefs) and the update server (which needs a VersionedContentVc): this is where resolve_source_request comes in.

@vercel
Copy link

vercel bot commented Feb 2, 2023

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests

See workflow summary for details

Copy link
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

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

doesn't compile

Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
@alexkirsz alexkirsz force-pushed the alexkirsz/web-530-next-routing-rewrite-doesnt-extract branch from 668c10a to 614083b Compare February 2, 2023 12:55
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Benchmark for 2451ecd

Test Base PR % Significant %
bench_hydration/Turbopack RCC/1000 modules 3946.70ms ± 11.58ms 3809.97ms ± 12.50ms -3.46% -2.26%
bench_startup/Turbopack RCC/1000 modules 2574.92ms ± 7.38ms 2534.91ms ± 8.86ms -1.55% -0.29%
bench_startup/Turbopack SSR/1000 modules 2104.66ms ± 4.64ms 2085.94ms ± 2.60ms -0.89% -0.20%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9937.09µs ± 53.63µs 10.24ms ± 0.11ms +3.02%
bench_hmr_to_commit/Turbopack RCC/1000 modules 10.22ms ± 0.13ms 10.43ms ± 0.12ms +2.08%
bench_hmr_to_commit/Turbopack RSC/1000 modules 494.56ms ± 3.21ms 499.82ms ± 2.40ms +1.06%
bench_hmr_to_commit/Turbopack SSR/1000 modules 10.10ms ± 0.08ms 10.30ms ± 0.06ms +1.97%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8942.32µs ± 108.72µs 9285.86µs ± 94.02µs +3.84%
bench_hmr_to_eval/Turbopack RCC/1000 modules 9182.67µs ± 80.32µs 9303.56µs ± 79.30µs +1.32%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8988.28µs ± 91.50µs 9328.44µs ± 111.52µs +3.78%
bench_hydration/Turbopack RCC/1000 modules 3946.70ms ± 11.58ms 3809.97ms ± 12.50ms -3.46% -2.26%
bench_hydration/Turbopack RSC/1000 modules 3395.35ms ± 11.25ms 3409.66ms ± 12.20ms +0.42%
bench_hydration/Turbopack SSR/1000 modules 3125.34ms ± 9.04ms 3116.54ms ± 6.16ms -0.28%
bench_startup/Turbopack CSR/1000 modules 2127.22ms ± 12.23ms 2117.68ms ± 22.81ms -0.45%
bench_startup/Turbopack RCC/1000 modules 2574.92ms ± 7.38ms 2534.91ms ± 8.86ms -1.55% -0.29%
bench_startup/Turbopack RSC/1000 modules 2453.51ms ± 8.60ms 2483.06ms ± 7.01ms +1.20%
bench_startup/Turbopack SSR/1000 modules 2104.66ms ± 4.64ms 2085.94ms ± 2.60ms -0.89% -0.20%

@sokra sokra merged commit 9422254 into main Feb 2, 2023
@sokra sokra deleted the alexkirsz/web-530-next-routing-rewrite-doesnt-extract branch February 2, 2023 14:08
Copy link
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

Excellent, thank you for getting this across the finish line!

jridgewell added a commit to vercel/next.js that referenced this pull request Mar 10, 2023
…/turborepo#3597)

With the addition of the Next.js routing layer at the root of our
content sources, we need the update server to also be able to follow
Next.js rewrites, like the HTTP server.

This requires the following:
* Rewrites need to be able to indicate a source where to "resume" after
rewriting. Otherwise, we would enter an infinite loop of the Next.js
layer rewriting to the Next.js layer.
* The resolving logic from `process_request_with_content_source` needs
to be extracted into its own function, so it may be called both from the
HTTP server (which expects fully resolved `ReadRef`s) and the update
server (which needs a `VersionedContentVc`): this is where
`resolve_source_request` comes in.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
…/turborepo#3597)

With the addition of the Next.js routing layer at the root of our
content sources, we need the update server to also be able to follow
Next.js rewrites, like the HTTP server.

This requires the following:
* Rewrites need to be able to indicate a source where to "resume" after
rewriting. Otherwise, we would enter an infinite loop of the Next.js
layer rewriting to the Next.js layer.
* The resolving logic from `process_request_with_content_source` needs
to be extracted into its own function, so it may be called both from the
HTTP server (which expects fully resolved `ReadRef`s) and the update
server (which needs a `VersionedContentVc`): this is where
`resolve_source_request` comes in.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…/turborepo#3597)

With the addition of the Next.js routing layer at the root of our
content sources, we need the update server to also be able to follow
Next.js rewrites, like the HTTP server.

This requires the following:
* Rewrites need to be able to indicate a source where to "resume" after
rewriting. Otherwise, we would enter an infinite loop of the Next.js
layer rewriting to the Next.js layer.
* The resolving logic from `process_request_with_content_source` needs
to be extracted into its own function, so it may be called both from the
HTTP server (which expects fully resolved `ReadRef`s) and the update
server (which needs a `VersionedContentVc`): this is where
`resolve_source_request` comes in.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…/turborepo#3597)

With the addition of the Next.js routing layer at the root of our
content sources, we need the update server to also be able to follow
Next.js rewrites, like the HTTP server.

This requires the following:
* Rewrites need to be able to indicate a source where to "resume" after
rewriting. Otherwise, we would enter an infinite loop of the Next.js
layer rewriting to the Next.js layer.
* The resolving logic from `process_request_with_content_source` needs
to be extracted into its own function, so it may be called both from the
HTTP server (which expects fully resolved `ReadRef`s) and the update
server (which needs a `VersionedContentVc`): this is where
`resolve_source_request` comes in.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…/turborepo#3597)

With the addition of the Next.js routing layer at the root of our
content sources, we need the update server to also be able to follow
Next.js rewrites, like the HTTP server.

This requires the following:
* Rewrites need to be able to indicate a source where to "resume" after
rewriting. Otherwise, we would enter an infinite loop of the Next.js
layer rewriting to the Next.js layer.
* The resolving logic from `process_request_with_content_source` needs
to be extracted into its own function, so it may be called both from the
HTTP server (which expects fully resolved `ReadRef`s) and the update
server (which needs a `VersionedContentVc`): this is where
`resolve_source_request` comes in.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
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.

3 participants