From d64bc66000dbeffa2283cf24a7f3ae264f278e0a Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Thu, 21 Sep 2023 11:13:01 -0700 Subject: [PATCH] test(turbopack): remove escape hatches for custom turbopack bindings --- packages/next/src/cli/next-dev.ts | 1 - packages/next/src/lib/turbopack-warning.ts | 27 +++++----------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/packages/next/src/cli/next-dev.ts b/packages/next/src/cli/next-dev.ts index a1040982648e..6f4ca0c87d70 100644 --- a/packages/next/src/cli/next-dev.ts +++ b/packages/next/src/cli/next-dev.ts @@ -234,7 +234,6 @@ const nextDev: CliCommand = async (args) => { if (process.env.TURBOPACK) { await validateTurboNextConfig({ - isCustomTurbopack: !!process.env.__INTERNAL_CUSTOM_TURBOPACK_BINDINGS, ...devServerOptions, isDev: true, }) diff --git a/packages/next/src/lib/turbopack-warning.ts b/packages/next/src/lib/turbopack-warning.ts index 38e25f6b89ca..b598da3f59d0 100644 --- a/packages/next/src/lib/turbopack-warning.ts +++ b/packages/next/src/lib/turbopack-warning.ts @@ -85,11 +85,9 @@ const prodSpecificTurboNextConfigOptions = [ // check for babelrc, swc plugins export async function validateTurboNextConfig({ dir, - isCustomTurbopack, isDev, }: { allowRetry?: boolean - isCustomTurbopack?: boolean dir: string port: number hostname?: string @@ -212,9 +210,7 @@ export async function validateTurboNextConfig({ if (!hasWarningOrError) { thankYouMessage = chalk.dim(thankYouMessage) } - if (!isCustomTurbopack) { - console.log(turbopackGradient + thankYouMessage) - } + console.log(turbopackGradient + thankYouMessage) let feedbackMessage = `Learn more about Next.js v13 and Turbopack: ${chalk.underline( 'https://nextjs.link/with-turbopack' @@ -252,7 +248,7 @@ export async function validateTurboNextConfig({ .join('')}` } - if (unsupportedParts && !isCustomTurbopack) { + if (unsupportedParts) { const pkgManager = getPkgManager(dir) console.error( @@ -269,23 +265,12 @@ If you cannot make the changes above, but still want to try out\nNext.js v13 wit ` ) - if (!isCustomTurbopack) { - console.warn(feedbackMessage) - - process.exit(1) - } else { - console.warn('\n') - console.warn( - `${chalk.bold.yellow( - 'Warning:' - )} Unsupported config found; but continuing with custom Turbopack binary.\n` - ) - } - } + console.warn(feedbackMessage) - if (!isCustomTurbopack) { - console.log(feedbackMessage) + process.exit(1) } + console.log(feedbackMessage) + return rawNextConfig }