Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove experimental.runtime and emit warning when used #46631

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,6 @@ export default async function build(
enableUndici: config.experimental.enableUndici,
locales: config.i18n?.locales,
defaultLocale: config.i18n?.defaultLocale,
pageRuntime: config.experimental.runtime,
})
)

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ export async function isPageStatic({
parentId?: any
edgeInfo?: any
pageType?: 'pages' | 'app'
pageRuntime: ServerRuntime
pageRuntime?: ServerRuntime
hasServerComponents?: boolean
originalAppPath?: string
}): Promise<{
Expand Down
13 changes: 1 addition & 12 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,17 +686,7 @@ export default async function getBaseWebpackConfig(
if (isClient) {
if (isEdgeRuntime(config.experimental.runtime)) {
Log.warn(
'You are using the experimental Edge Runtime with `experimental.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.'
'You ase using `experimental.runtime` which was removed. Check https://nextjs.org/docs/api-routes/edge-api-routes on how to use edge runtime.'
)
}
}
Expand Down Expand Up @@ -2392,7 +2382,6 @@ export default async function getBaseWebpackConfig(
reactProductionProfiling,
webpack: !!config.webpack,
hasRewrites,
runtime: config.experimental.runtime,
swcMinify: config.swcMinify,
swcLoader: useSWCLoader,
removeConsole: config.compiler?.removeConsole,
Expand Down
1 change: 0 additions & 1 deletion packages/next/src/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ export default async function exportApp(
disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
// Exported pages do not currently support dynamic HTML.
supportsDynamicHTML: false,
runtime: nextConfig.experimental.runtime,
crossOrigin: nextConfig.crossOrigin,
optimizeCss: nextConfig.experimental.optimizeCss,
nextConfigOutput: nextConfig.output,
Expand Down
6 changes: 2 additions & 4 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,10 @@ export default abstract class Server<ServerOptions extends Options = Options> {
optimizeCss: this.nextConfig.experimental.optimizeCss,
nextConfigOutput: this.nextConfig.output,
nextScriptWorkers: this.nextConfig.experimental.nextScriptWorkers,
disableOptimizedLoading: this.nextConfig.experimental.runtime
? true
: this.nextConfig.experimental.disableOptimizedLoading,
disableOptimizedLoading:
this.nextConfig.experimental.disableOptimizedLoading,
domainLocales: this.nextConfig.i18n?.domains,
distDir: this.distDir,
runtime: this.nextConfig.experimental.runtime,
serverComponents,
crossOrigin: this.nextConfig.crossOrigin
? this.nextConfig.crossOrigin
Expand Down