Expose instant devtools for production builds under exposeInstantDevToolsInProductionBuild#91426
Expose instant devtools for production builds under exposeInstantDevToolsInProductionBuild#91426devjiwonchoi wants to merge 1 commit into
exposeInstantDevToolsInProductionBuild#91426Conversation
Tests Passed |
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
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
62d985a to
dcf4ddd
Compare
Auto-renders a floating navigation inspector widget in production when `exposeTestingApiInProductionBuild` is enabled. Uses the same cookie-based lock protocol as the dev overlay's InstantNavsPanel, rendered in Shadow DOM for style isolation. - Move shared cookie logic to `next-devtools/shared/instant-navs-cookie.ts` - Inject via `app-next.ts` and `app-next-turbopack.ts` (production only) - Add production e2e tests
dcf4ddd to
ac1a59b
Compare
|
Notifying the following users due to files changed in this PR based on this repo's notify modifiers: @timneutkens, @ijjk, @shuding, @huozhi: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac1a59b559
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| process.env.NODE_ENV === 'production' && | ||
| process.env.__NEXT_EXPOSE_INSTANT_DEVTOOLS |
There was a problem hiding this comment.
Gate instant devtools on dev-server mode, not NODE_ENV
This condition makes exposeInstantDevToolsInProductionBuild a no-op for production-style bundles built with NODE_ENV='development' (for example next build --debug-prerender, and other flows that set allowDevelopmentBuild). In those cases the app is not running next dev, but process.env.NODE_ENV === 'production' is false, so the widget never mounts even when the flag is explicitly enabled. Gating on process.env.__NEXT_DEV_SERVER (or removing the NODE_ENV check) would preserve the intended behavior across these build modes.
Useful? React with 👍 / 👎.
exposeInstantDevToolsInProductionBuild
This PR exposes the initial version of Instant DevTools for builds for testing purposes. It is not recommended to ship on the user-facing production builds.
CleanShot.2026-03-20.at.20.52.14.mp4