Unverified Commit 4a3774c2 authored by Sam Poder's avatar Sam Poder Committed by GitHub

[turbopack] Only use the shared runtime by default on canary (#97208)

This should not be on in 16.3.1.
parent 59aa000d
...@@ -2645,7 +2645,7 @@ impl NextConfig { ...@@ -2645,7 +2645,7 @@ impl NextConfig {
// The shared runtime / inlined bootstrap is a production-only optimization; in // The shared runtime / inlined bootstrap is a production-only optimization; in
// development the per-route runtime is required for HMR. // development the per-route runtime is required for HMR.
NextMode::Development => false, NextMode::Development => false,
NextMode::Build => self.experimental.turbopack_shared_runtime.unwrap_or(true), NextMode::Build => self.experimental.turbopack_shared_runtime.unwrap_or(false),
})) }))
} }
......
...@@ -169,8 +169,9 @@ export function getDefineEnv({ ...@@ -169,8 +169,9 @@ export function getDefineEnv({
'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean( 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(
config.experimental.appNavFailHandling config.experimental.appNavFailHandling
), ),
'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': Boolean(
config.experimental.turbopackSharedRuntime !== false, config.experimental.turbopackSharedRuntime
),
'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled, 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled,
'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean( 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean(
config.experimental.cachedNavigations config.experimental.cachedNavigations
......
...@@ -12,6 +12,7 @@ import type { NextParsedUrlQuery } from './request-meta' ...@@ -12,6 +12,7 @@ import type { NextParsedUrlQuery } from './request-meta'
import type { SizeLimit } from '../types' import type { SizeLimit } from '../types'
import type { SupportedTestRunners } from '../cli/next-test' import type { SupportedTestRunners } from '../cli/next-test'
import { INFINITE_CACHE } from '../lib/constants' import { INFINITE_CACHE } from '../lib/constants'
import { isStableBuild } from '../shared/lib/errors/canary-only-config-error'
import type { FallbackRouteParam } from '../build/static-paths/types' import type { FallbackRouteParam } from '../build/static-paths/types'
import type { MemoryEvictionMode } from '../build/swc/types' import type { MemoryEvictionMode } from '../build/swc/types'
import type { CacheLife } from './use-cache/cache-life' import type { CacheLife } from './use-cache/cache-life'
...@@ -794,7 +795,8 @@ export interface ExperimentalConfig { ...@@ -794,7 +795,8 @@ export interface ExperimentalConfig {
/** /**
* Share the browser runtime across routes in a single `runtime.js` asset and inline the * Share the browser runtime across routes in a single `runtime.js` asset and inline the
* per-route chunk-group bootstrap into the HTML, dropping the per-route runtime. Defaults to * per-route chunk-group bootstrap into the HTML, dropping the per-route runtime. Defaults to
* true. Only applies to production builds; has no effect in development mode. * true on canary releases and false on stable releases. Only applies to production builds; has
* no effect in development mode.
*/ */
turbopackSharedRuntime?: boolean turbopackSharedRuntime?: boolean
...@@ -2291,6 +2293,7 @@ export const defaultConfig = Object.freeze({ ...@@ -2291,6 +2293,7 @@ export const defaultConfig = Object.freeze({
turbopackFileSystemCacheForBuild: true, turbopackFileSystemCacheForBuild: true,
turbopackInferModuleSideEffects: true, turbopackInferModuleSideEffects: true,
turbopackPluginRuntimeStrategy: 'childProcesses', turbopackPluginRuntimeStrategy: 'childProcesses',
turbopackSharedRuntime: !isStableBuild(),
}, },
htmlLimitedBots: undefined, htmlLimitedBots: undefined,
bundlePagesRouterDependencies: false, bundlePagesRouterDependencies: false,
......
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