Unverified Commit 9a20fce8 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Use internal prefix for Turbopack shutdown env (#98747)

## Summary

Rename `NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN` to
`__NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN` to mark the environment
variable as internal and subject to change.

## Verification

- `pnpm --filter=next types`
- `pnpm prettier --with-node-modules --ignore-path .prettierignore
--check packages/next/src/cli/next-dev.ts
packages/next/src/server/dev/hot-reloader-turbopack.ts
test/e2e/filesystem-cache/warm-restart-task-stats.test.ts`
- `npx eslint --config eslint.config.mjs
packages/next/src/cli/next-dev.ts
packages/next/src/server/dev/hot-reloader-turbopack.ts
test/e2e/filesystem-cache/warm-restart-task-stats.test.ts`
- Focused test attempted: `pnpm test-dev-turbo
test/e2e/filesystem-cache/warm-restart-task-stats.test.ts` (failed
because the fixture did not emit
`.next/dev/server/pages/_app/build-manifest.json`, causing the page
request to return 500 before the assertion)

<!-- NEXT_JS_LLM -->
parent a777ebcf
......@@ -103,7 +103,7 @@ const CHILD_EXIT_TIMEOUT_MS = parseInt(
10
)
const shouldWaitForChildExit =
process.env.NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN === '1'
process.env.__NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN === '1'
const handleSessionStop = async (signal: NodeJS.Signals | number | null) => {
if (signal != null && child?.pid) child.kill(signal)
......
......@@ -570,7 +570,7 @@ export async function createHotReloaderTurbopack(
opts.onDevServerCleanup?.(async () => {
setBundlerFindSourceMapImplementation(() => undefined)
setBundlerFindSourceMapURLImplementation(() => null)
if (process.env.NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN === '1') {
if (process.env.__NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN === '1') {
await project.shutdown()
} else {
await project.onExit()
......
......@@ -40,7 +40,7 @@ describe('warm-restart task statistics', () => {
TURBO_ENGINE_SNAPSHOT_MIN_ACTIVE_TIME_MILLIS: '0',
NEXT_TURBOPACK_TASK_STATISTICS: STATS_RELATIVE_PATH,
// Wait for turbo-tasks to persist the cache before the dev process exits.
NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN: '1',
__NEXT_DEV_WAIT_FOR_TURBOPACK_SHUTDOWN: '1',
}
const { next } = nextTestSetup({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment