Unverified Commit 451810f3 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Remove experimental.sharedPool (#56021)

`experimental.sharedPool` is `true` by default for a long time, changing
it to the default behavior
parent b596de89
...@@ -444,7 +444,6 @@ pub struct ExperimentalConfig { ...@@ -444,7 +444,6 @@ pub struct ExperimentalConfig {
output_file_tracing_root: Option<String>, output_file_tracing_root: Option<String>,
proxy_timeout: Option<f64>, proxy_timeout: Option<f64>,
scroll_restoration: Option<bool>, scroll_restoration: Option<bool>,
shared_pool: Option<bool>,
sri: Option<serde_json::Value>, sri: Option<serde_json::Value>,
swc_minify_debug_options: Option<serde_json::Value>, swc_minify_debug_options: Option<serde_json::Value>,
swc_trace_profiling: Option<bool>, swc_trace_profiling: Option<bool>,
......
...@@ -1172,10 +1172,7 @@ export default async function build( ...@@ -1172,10 +1172,7 @@ export default async function build(
: undefined : undefined
const timeout = config.staticPageGenerationTimeout || 0 const timeout = config.staticPageGenerationTimeout || 0
const sharedPool = config.experimental.sharedPool || false const staticWorkerPath = require.resolve('./worker')
const staticWorkerPath = sharedPool
? require.resolve('./worker')
: require.resolve('./utils')
let appPathsManifest: Record<string, string> = {} let appPathsManifest: Record<string, string> = {}
const appPathRoutes: Record<string, string> = {} const appPathRoutes: Record<string, string> = {}
...@@ -1259,18 +1256,12 @@ export default async function build( ...@@ -1259,18 +1256,12 @@ export default async function build(
}, },
}, },
enableWorkerThreads: config.experimental.workerThreads, enableWorkerThreads: config.experimental.workerThreads,
exposedMethods: sharedPool exposedMethods: [
? [ 'hasCustomGetInitialProps',
'hasCustomGetInitialProps', 'isPageStatic',
'isPageStatic', 'getDefinedNamedExports',
'getDefinedNamedExports', 'exportPage',
'exportPage', ],
]
: [
'hasCustomGetInitialProps',
'isPageStatic',
'getDefinedNamedExports',
],
}) as Worker & }) as Worker &
Pick< Pick<
typeof import('./worker'), typeof import('./worker'),
...@@ -1817,11 +1808,6 @@ export default async function build( ...@@ -1817,11 +1808,6 @@ export default async function build(
hasNonStaticErrorPage: nonStaticErrorPage, hasNonStaticErrorPage: nonStaticErrorPage,
} }
if (!sharedPool) {
pagesStaticWorkers.end()
appStaticWorkers?.end()
}
return returnValue return returnValue
}) })
...@@ -2630,18 +2616,14 @@ export default async function build( ...@@ -2630,18 +2616,14 @@ export default async function build(
pages: combinedPages, pages: combinedPages,
outdir: path.join(distDir, 'export'), outdir: path.join(distDir, 'export'),
statusMessage: 'Generating static pages', statusMessage: 'Generating static pages',
exportAppPageWorker: sharedPool exportAppPageWorker:
? appStaticWorkers?.exportPage.bind(appStaticWorkers) appStaticWorkers?.exportPage.bind(appStaticWorkers),
: undefined, exportPageWorker:
exportPageWorker: sharedPool pagesStaticWorkers.exportPage.bind(pagesStaticWorkers),
? pagesStaticWorkers.exportPage.bind(pagesStaticWorkers) endWorker: async () => {
: undefined, await pagesStaticWorkers.end()
endWorker: sharedPool await appStaticWorkers?.end()
? async () => { },
await pagesStaticWorkers.end()
await appStaticWorkers?.end()
}
: undefined,
} }
await exportApp(dir, exportOptions, nextBuildSpan) await exportApp(dir, exportOptions, nextBuildSpan)
...@@ -3373,18 +3355,12 @@ export default async function build( ...@@ -3373,18 +3355,12 @@ export default async function build(
silent: true, silent: true,
threads: config.experimental.cpus, threads: config.experimental.cpus,
outdir: path.join(dir, configOutDir), outdir: path.join(dir, configOutDir),
exportAppPageWorker: sharedPool exportAppPageWorker: appWorker.exportPage.bind(appWorker),
? appWorker.exportPage.bind(appWorker) exportPageWorker: pagesWorker.exportPage.bind(pagesWorker),
: undefined, endWorker: async () => {
exportPageWorker: sharedPool await pagesWorker.end()
? pagesWorker.exportPage.bind(pagesWorker) await appWorker.end()
: undefined, },
endWorker: sharedPool
? async () => {
await pagesWorker.end()
await appWorker.end()
}
: undefined,
} }
await exportApp(dir, options, nextBuildSpan) await exportApp(dir, options, nextBuildSpan)
......
...@@ -44,7 +44,6 @@ const supportedTurbopackNextConfigOptions = [ ...@@ -44,7 +44,6 @@ const supportedTurbopackNextConfigOptions = [
'excludeDefaultMomentLocales', 'excludeDefaultMomentLocales',
'experimental.clientRouterFilterRedirects', 'experimental.clientRouterFilterRedirects',
'experimental.cpus', 'experimental.cpus',
'experimental.sharedPool',
'experimental.proxyTimeout', 'experimental.proxyTimeout',
'experimental.isrFlushToDisk', 'experimental.isrFlushToDisk',
'experimental.workerThreads', 'experimental.workerThreads',
......
...@@ -400,9 +400,6 @@ const configSchema = { ...@@ -400,9 +400,6 @@ const configSchema = {
scrollRestoration: { scrollRestoration: {
type: 'boolean', type: 'boolean',
}, },
sharedPool: {
type: 'boolean',
},
sri: { sri: {
properties: { properties: {
algorithm: { algorithm: {
......
...@@ -188,7 +188,6 @@ export interface ExperimentalConfig { ...@@ -188,7 +188,6 @@ export interface ExperimentalConfig {
swcMinify?: boolean swcMinify?: boolean
cpus?: number cpus?: number
memoryBasedWorkersCount?: boolean memoryBasedWorkersCount?: boolean
sharedPool?: boolean
proxyTimeout?: number proxyTimeout?: number
isrFlushToDisk?: boolean isrFlushToDisk?: boolean
workerThreads?: boolean workerThreads?: boolean
...@@ -741,7 +740,6 @@ export const defaultConfig: NextConfig = { ...@@ -741,7 +740,6 @@ export const defaultConfig: NextConfig = {
(os.cpus() || { length: 1 }).length) - 1 (os.cpus() || { length: 1 }).length) - 1
), ),
memoryBasedWorkersCount: false, memoryBasedWorkersCount: false,
sharedPool: true,
isrFlushToDisk: true, isrFlushToDisk: true,
workerThreads: false, workerThreads: false,
proxyTimeout: undefined, proxyTimeout: undefined,
......
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