Skip to content

Upgrade turbopack-dev-server from hyper 0.14 to hyper 1.x#90946

Closed
lukesandberg wants to merge 1 commit intoupdate-tokio-1.47.3from
upgrade-hyper-1.x
Closed

Upgrade turbopack-dev-server from hyper 0.14 to hyper 1.x#90946
lukesandberg wants to merge 1 commit intoupdate-tokio-1.47.3from
upgrade-hyper-1.x

Conversation

@lukesandberg
Copy link
Contributor

@lukesandberg lukesandberg commented Mar 5, 2026

Summary

Upgrade turbopack-dev-server from hyper 0.14 to hyper 1.x (the only crate in the workspace that directly depends on hyper).

Stacked on #90945 (tokio 1.47.3 update).

Changes

Dependency updates:

  • hyper 0.14 → 1.x (with server and http1 features)
  • hyper-tungstenite 0.9 → 0.19 (hyper 1.x compatible)
  • socket2 0.4 → 0.5
  • Added hyper-util 0.1 (replaces removed hyper::Server)
  • Added http-body-util 0.1 (replaces removed hyper::Body)

Code migration:

  • Server setup (lib.rs): Replaced hyper::Server + make_service_fn + AddrIncoming with a manual tokio::net::TcpListener accept loop + hyper_util::server::conn::auto::Builder (the recommended hyper 1.x pattern)
  • Request body (http.rs): Request<hyper::Body>Request<hyper::body::Incoming>, body collected via http_body_util::BodyExt::collect()
  • Response body (lib.rs, http.rs): hyper::BodyEither<Full<Bytes>, Empty<Bytes>> type alias
  • WebSocket (update/server.rs): WebSocketStream<Upgraded>WebSocketStream<TokioIo<Upgraded>>
  • Error handling (lib.rs): Service error type changed from hyper::Error to anyhow::Error; connection error check uses downcast for is_incomplete_message()

Duplicate dependencies eliminated

This upgrade removes 7 duplicate crate pairs from the dependency tree:

  • hyper 0.14 / 1.7 → just 1.7
  • h2 0.3 / 0.4 → eliminated (hyper 1.x doesn't pull h2 directly)
  • http-body 0.4 / 1.0 → just 1.0
  • socket2 0.4 / 0.5 → just 0.5
  • tungstenite 0.18 / 0.20 → just 0.28
  • base64 0.13 → eliminated

Test plan

  • cargo check full workspace passes
  • CI build and test suite

@nextjs-bot nextjs-bot added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Mar 5, 2026
Copy link
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Mar 5, 2026

Failing test suites

Commit: e67b725 | About building and testing Next.js

pnpm test-dev test/development/app-dir/cache-only-toggle/cache-only-toggle.test.ts (job)

  • instant-mode-toggle > should show loading skeleton during SPA navigation when instant mode is on (DD)
Expand output

● instant-mode-toggle › should show loading skeleton during SPA navigation when instant mode is on

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

  146 |         '[data-testid="comments-skeleton"]'
  147 |       )
> 148 |       expect(skeleton).toBe(true)
      |                        ^
  149 |     })
  150 |
  151 |     // Clean up

  at toBe (development/app-dir/cache-only-toggle/cache-only-toggle.test.ts:148:24)
  at retry (lib/next-test-utils.ts:861:14)
  at Object.<anonymous> (development/app-dir/cache-only-toggle/cache-only-toggle.test.ts:144:5)

pnpm test-start test/e2e/app-dir/next-after-app-static/build-time/build-time.test.ts (job)

  • prefetch={true} with instant route > also disables full prefetch when instant is on a layout, not the page (DD)
Expand output

● prefetch={true} with instant route › also disables full prefetch when instant is on a layout, not the page

thrown: "Exceeded timeout of 60000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  50 |       }
  51 |
> 52 |       const result = Reflect.apply(target, thisArg, args)
     |                              ^
  53 |       return typeof result === 'function' ? wrapJestTestFn(result) : result
  54 |     },
  55 |     get(target, prop, receiver) {

  at Object.apply (lib/e2e-utils/index.ts:52:30)
  at it (e2e/app-dir/prefetch-true-instant/prefetch-true-instant.test.ts:77:3)
  at Object.describe (e2e/app-dir/prefetch-true-instant/prefetch-true-instant.test.ts:5:1)

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 5, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing upgrade-hyper-1.x (e67b725) with update-tokio-1.47.3 (4d5015d)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@mondyzzz-glitch
Copy link

感谢反馈!我们看到了你的feature请求。我们会尽快处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants