Skip to content

Commit

Permalink
Remove unused internal env var (vercel#55762)
Browse files Browse the repository at this point in the history
`__NEXT_PREBUNDLED_REACT` is replaced by `__NEXT_EXPERIMENTAL_REACT` as we're bundling built-in react for app router
  • Loading branch information
huozhi authored Sep 22, 2023
1 parent 0d6f3ac commit 57cd1d0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import startOperationStreamHandler from '../internal/operation-stream'

import '../polyfill/app-polyfills.ts'
// TODO: when actions are supported, this should be removed/changed
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = 'next'
import 'next/dist/server/require-hook'

import type { IncomingMessage } from 'node:http'
Expand Down
4 changes: 0 additions & 4 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ import { createClientRouterFilter } from '../lib/create-client-router-filter'
import { createValidFileMatcher } from '../server/lib/find-page-file'
import { startTypeChecking } from './type-check'
import { generateInterceptionRoutesRewrites } from '../lib/generate-interception-routes-rewrites'
import { needsExperimentalReact } from '../lib/needs-experimental-react'

import { buildDataRoute } from '../server/lib/router-utils/build-data-route'
import { defaultOverrides } from '../server/require-hook'
Expand Down Expand Up @@ -1256,9 +1255,6 @@ export default async function build(
__NEXT_INCREMENTAL_CACHE_IPC_PORT: incrementalCacheIpcPort + '',
__NEXT_INCREMENTAL_CACHE_IPC_KEY:
incrementalCacheIpcValidationKey,
__NEXT_PRIVATE_PREBUNDLED_REACT: needsExperimentalReact(config)
? 'experimental'
: 'next',
},
},
enableWorkerThreads: config.experimental.workerThreads,
Expand Down
5 changes: 0 additions & 5 deletions packages/next/src/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import { nodeFs } from '../server/lib/node-fs-methods'
import * as ciEnvironment from '../telemetry/ci-info'
import { normalizeAppPath } from '../shared/lib/router/utils/app-paths'
import { denormalizeAppPagePath } from '../shared/lib/page-path/denormalize-app-path'
import { needsExperimentalReact } from '../lib/needs-experimental-react'

const { AppRouteRouteModule } =
require('../server/future/route-modules/app-route/module.compiled') as typeof import('../server/future/route-modules/app-route/module')
Expand Down Expand Up @@ -1837,7 +1836,6 @@ export async function copyTracedFiles(
...serverConfig,
distDir: `./${path.relative(dir, distDir)}`,
}
const hasExperimentalReact = needsExperimentalReact(nextConfig)
try {
const packageJsonPath = path.join(distDir, '../package.json')
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'))
Expand Down Expand Up @@ -1994,9 +1992,6 @@ let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
const nextConfig = ${JSON.stringify(nextConfig)}
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = ${hasExperimentalReact}
? 'experimental'
: 'next'
require('next')
const { startServer } = require('next/dist/server/lib/start-server')
Expand Down
5 changes: 0 additions & 5 deletions packages/next/src/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
getReservedPortExplanation,
isPortIsReserved,
} from '../lib/helpers/get-reserved-port'
import { needsExperimentalReact } from '../lib/needs-experimental-react'

let dir: string
let child: undefined | ReturnType<typeof fork>
Expand Down Expand Up @@ -199,10 +198,6 @@ const nextDev: CliCommand = async (args) => {
},
})

process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = needsExperimentalReact(config)
? 'experimental'
: 'next'

// we need to reset env if we are going to create
// the worker process with the esm loader so that the
// initial env state is correct
Expand Down

0 comments on commit 57cd1d0

Please sign in to comment.