Unverified Commit 7d5a213c authored by Jan Kaifer's avatar Jan Kaifer Committed by GitHub

Remove `experimental.runtime` and emit warning when used (#46631)

We recommend that users just opt into `edge` per page.
This global default was an unfortunate pattern.
parent 527afe1c
...@@ -1284,7 +1284,6 @@ export default async function build( ...@@ -1284,7 +1284,6 @@ export default async function build(
enableUndici: config.experimental.enableUndici, enableUndici: config.experimental.enableUndici,
locales: config.i18n?.locales, locales: config.i18n?.locales,
defaultLocale: config.i18n?.defaultLocale, defaultLocale: config.i18n?.defaultLocale,
pageRuntime: config.experimental.runtime,
}) })
) )
......
...@@ -1255,7 +1255,7 @@ export async function isPageStatic({ ...@@ -1255,7 +1255,7 @@ export async function isPageStatic({
parentId?: any parentId?: any
edgeInfo?: any edgeInfo?: any
pageType?: 'pages' | 'app' pageType?: 'pages' | 'app'
pageRuntime: ServerRuntime pageRuntime?: ServerRuntime
hasServerComponents?: boolean hasServerComponents?: boolean
originalAppPath?: string originalAppPath?: string
}): Promise<{ }): Promise<{
......
...@@ -686,17 +686,7 @@ export default async function getBaseWebpackConfig( ...@@ -686,17 +686,7 @@ export default async function getBaseWebpackConfig(
if (isClient) { if (isClient) {
if (isEdgeRuntime(config.experimental.runtime)) { if (isEdgeRuntime(config.experimental.runtime)) {
Log.warn( Log.warn(
'You are using the experimental Edge Runtime with `experimental.runtime`.' 'You ase using `experimental.runtime` which was removed. Check https://nextjs.org/docs/api-routes/edge-api-routes on how to use edge runtime.'
)
}
if (config.experimental.runtime === 'nodejs') {
Log.warn(
'You are using the experimental Node.js Runtime with `experimental.runtime`.'
)
}
if (config.experimental.typedRoutes && !hasAppDir) {
Log.warn(
'`experimental.typedRoutes` requires `experimental.appDir` to be enabled.'
) )
} }
} }
...@@ -2392,7 +2382,6 @@ export default async function getBaseWebpackConfig( ...@@ -2392,7 +2382,6 @@ export default async function getBaseWebpackConfig(
reactProductionProfiling, reactProductionProfiling,
webpack: !!config.webpack, webpack: !!config.webpack,
hasRewrites, hasRewrites,
runtime: config.experimental.runtime,
swcMinify: config.swcMinify, swcMinify: config.swcMinify,
swcLoader: useSWCLoader, swcLoader: useSWCLoader,
removeConsole: config.compiler?.removeConsole, removeConsole: config.compiler?.removeConsole,
......
...@@ -398,7 +398,6 @@ export default async function exportApp( ...@@ -398,7 +398,6 @@ export default async function exportApp(
disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading, disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
// Exported pages do not currently support dynamic HTML. // Exported pages do not currently support dynamic HTML.
supportsDynamicHTML: false, supportsDynamicHTML: false,
runtime: nextConfig.experimental.runtime,
crossOrigin: nextConfig.crossOrigin, crossOrigin: nextConfig.crossOrigin,
optimizeCss: nextConfig.experimental.optimizeCss, optimizeCss: nextConfig.experimental.optimizeCss,
nextConfigOutput: nextConfig.output, nextConfigOutput: nextConfig.output,
......
...@@ -412,12 +412,10 @@ export default abstract class Server<ServerOptions extends Options = Options> { ...@@ -412,12 +412,10 @@ export default abstract class Server<ServerOptions extends Options = Options> {
optimizeCss: this.nextConfig.experimental.optimizeCss, optimizeCss: this.nextConfig.experimental.optimizeCss,
nextConfigOutput: this.nextConfig.output, nextConfigOutput: this.nextConfig.output,
nextScriptWorkers: this.nextConfig.experimental.nextScriptWorkers, nextScriptWorkers: this.nextConfig.experimental.nextScriptWorkers,
disableOptimizedLoading: this.nextConfig.experimental.runtime disableOptimizedLoading:
? true this.nextConfig.experimental.disableOptimizedLoading,
: this.nextConfig.experimental.disableOptimizedLoading,
domainLocales: this.nextConfig.i18n?.domains, domainLocales: this.nextConfig.i18n?.domains,
distDir: this.distDir, distDir: this.distDir,
runtime: this.nextConfig.experimental.runtime,
serverComponents, serverComponents,
crossOrigin: this.nextConfig.crossOrigin crossOrigin: this.nextConfig.crossOrigin
? this.nextConfig.crossOrigin ? this.nextConfig.crossOrigin
......
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