Reload affected WebSocket routes in development - #97031
Draft
DavidIlie wants to merge 5 commits into
Draft
Conversation
Contributor
Tests PassedCommit: c768b81 |
Contributor
Stats from current PR🔴 1 regression
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (23 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsDiff too large to display app-page-exp..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsDiff too large to display app-page-tur..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsDiff too large to display app-page-tur..time.prod.jsDiff too large to display app-page.runtime.dev.jsDiff too large to display app-page.runtime.prod.jsDiff too large to display app-route-ex..ntime.dev.jsDiff too large to display app-route-ex..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route.runtime.dev.jsDiff too large to display app-route.ru..time.prod.jsDiff too large to display pages-api.ru..time.prod.jsDiff too large to display pages.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display 📎 Tarball URLCommit: c768b81 |
DavidIlie
force-pushed
the
codex/websocket-route-handlers-hmr
branch
from
August 10, 2026 11:34
bfb9f08 to
77988c3
Compare
DavidIlie
force-pushed
the
codex/websocket-route-handlers-hmr
branch
from
August 10, 2026 11:40
77988c3 to
feb11ad
Compare
DavidIlie
force-pushed
the
codex/websocket-route-handlers-hmr
branch
2 times, most recently
from
August 10, 2026 13:09
49c4539 to
dc8eea9
Compare
DavidIlie
force-pushed
the
codex/websocket-route-handlers-hmr
branch
from
August 10, 2026 14:41
dc8eea9 to
d993290
Compare
DavidIlie
force-pushed
the
codex/websocket-route-handlers-hmr
branch
from
August 10, 2026 16:29
d993290 to
b29fc22
Compare
DavidIlie
force-pushed
the
codex/websocket-route-handlers-hmr
branch
from
August 10, 2026 16:54
b29fc22 to
c768b81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Reload only the WebSocket Route Handlers affected by a development server update, and document the completed experimental feature.
Why?
Closing every persistent connection on each development update makes WebSocket applications difficult to work on. Once lifecycle and route-generation ownership exist, Next.js can invalidate only the routes whose server code changed while leaving unrelated connections alive.
How?
1012when their route or one of its dependencies changes.NextResponse.upgrade()guide, API reference, deployment behavior, reconnection guidance, and process-local policy boundaries.This is stacked on #97030 and completes the seven-PR experimental WebSocket Route Handler stack.
Verification
pnpm test-dev-turbo test/development/app-dir/server-hmr/server-hmr.test.ts -t "WebSocket route HMR"pnpm test-dev-turbo test/e2e/app-dir/websocket-route-handlers/websocket-route-handlers.test.tspnpm build-allpnpm types-and-precompiled