Skip to content

Commit

Permalink
Merge branch 'canary' into refactor/await-params
Browse files Browse the repository at this point in the history
  • Loading branch information
hyungjikim authored Nov 25, 2024
2 parents 01c6ffc + 084bc4a commit 924db94
Show file tree
Hide file tree
Showing 103 changed files with 6,368 additions and 4,618 deletions.
4 changes: 2 additions & 2 deletions examples/reproduction-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"dependencies": {
"next": "canary",
"react": "19.0.0-rc-380f5d67-20241113",
"react-dom": "19.0.0-rc-380f5d67-20241113"
"react": "19.0.0-rc-b01722d5-20241114",
"react-dom": "19.0.0-rc-b01722d5-20241114"
},
"devDependencies": {
"@types/node": "20.12.12",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "15.0.4-canary.25"
"version": "15.0.4-canary.27"
}
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,19 @@
"pretty-bytes": "5.3.0",
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "19.0.0-rc-380f5d67-20241113",
"react": "19.0.0-rc-b01722d5-20241114",
"react-17": "npm:[email protected]",
"react-builtin": "npm:[email protected]380f5d67-20241113",
"react-dom": "19.0.0-rc-380f5d67-20241113",
"react-builtin": "npm:[email protected]b01722d5-20241114",
"react-dom": "19.0.0-rc-b01722d5-20241114",
"react-dom-17": "npm:[email protected]",
"react-dom-builtin": "npm:[email protected]380f5d67-20241113",
"react-dom-experimental-builtin": "npm:[email protected]380f5d67-20241113",
"react-experimental-builtin": "npm:[email protected]380f5d67-20241113",
"react-is-builtin": "npm:[email protected]380f5d67-20241113",
"react-server-dom-turbopack": "19.0.0-rc-380f5d67-20241113",
"react-server-dom-turbopack-experimental": "npm:[email protected]380f5d67-20241113",
"react-server-dom-webpack": "19.0.0-rc-380f5d67-20241113",
"react-server-dom-webpack-experimental": "npm:[email protected]380f5d67-20241113",
"react-dom-builtin": "npm:[email protected]b01722d5-20241114",
"react-dom-experimental-builtin": "npm:[email protected]b01722d5-20241114",
"react-experimental-builtin": "npm:[email protected]b01722d5-20241114",
"react-is-builtin": "npm:[email protected]b01722d5-20241114",
"react-server-dom-turbopack": "19.0.0-rc-b01722d5-20241114",
"react-server-dom-turbopack-experimental": "npm:[email protected]b01722d5-20241114",
"react-server-dom-webpack": "19.0.0-rc-b01722d5-20241114",
"react-server-dom-webpack-experimental": "npm:[email protected]b01722d5-20241114",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -231,8 +231,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.9",
"scheduler-builtin": "npm:[email protected]380f5d67-20241113",
"scheduler-experimental-builtin": "npm:[email protected]380f5d67-20241113",
"scheduler-builtin": "npm:[email protected]b01722d5-20241114",
"scheduler-experimental-builtin": "npm:[email protected]b01722d5-20241114",
"seedrandom": "3.0.5",
"semver": "7.3.7",
"shell-quote": "1.7.3",
Expand Down Expand Up @@ -272,10 +272,10 @@
"@babel/traverse": "7.22.5",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"react": "19.0.0-rc-380f5d67-20241113",
"react-dom": "19.0.0-rc-380f5d67-20241113",
"react-is": "19.0.0-rc-380f5d67-20241113",
"scheduler": "0.25.0-rc-380f5d67-20241113"
"react": "19.0.0-rc-b01722d5-20241114",
"react-dom": "19.0.0-rc-b01722d5-20241114",
"react-is": "19.0.0-rc-b01722d5-20241114",
"scheduler": "0.25.0-rc-b01722d5-20241114"
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { GetTemplateFileArgs, InstallTemplateArgs } from "./types";

// Do not rename or format. sync-react script relies on this line.
// prettier-ignore
const nextjsReactPeerVersion = "19.0.0-rc-380f5d67-20241113";
const nextjsReactPeerVersion = "19.0.0-rc-b01722d5-20241114";

/**
* Get the file path for a given file in a template, e.g. "next.config.js".
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "15.0.4-canary.25",
"@next/eslint-plugin-next": "15.0.4-canary.27",
"@rushstack/eslint-patch": "^1.10.3",
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/font",
"private": true,
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
18 changes: 9 additions & 9 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "15.0.4-canary.25",
"version": "15.0.4-canary.27",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -97,7 +97,7 @@
]
},
"dependencies": {
"@next/env": "15.0.4-canary.25",
"@next/env": "15.0.4-canary.27",
"@swc/counter": "0.1.3",
"@swc/helpers": "0.5.13",
"busboy": "1.6.0",
Expand All @@ -109,8 +109,8 @@
"@opentelemetry/api": "^1.1.0",
"@playwright/test": "^1.41.2",
"babel-plugin-react-compiler": "*",
"react": "^18.2.0 || 19.0.0-rc-380f5d67-20241113",
"react-dom": "^18.2.0 || 19.0.0-rc-380f5d67-20241113",
"react": "^18.2.0 || 19.0.0-rc-b01722d5-20241114",
"react-dom": "^18.2.0 || 19.0.0-rc-b01722d5-20241114",
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
Expand Down Expand Up @@ -161,11 +161,11 @@
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/font": "15.0.4-canary.25",
"@next/polyfill-module": "15.0.4-canary.25",
"@next/polyfill-nomodule": "15.0.4-canary.25",
"@next/react-refresh-utils": "15.0.4-canary.25",
"@next/swc": "15.0.4-canary.25",
"@next/font": "15.0.4-canary.27",
"@next/polyfill-module": "15.0.4-canary.27",
"@next/polyfill-nomodule": "15.0.4-canary.27",
"@next/react-refresh-utils": "15.0.4-canary.27",
"@next/swc": "15.0.4-canary.27",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.41.2",
"@swc/core": "1.9.2-nightly-20241111.1",
Expand Down
12 changes: 11 additions & 1 deletion packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ import { inlineStaticEnv } from './flying-shuttle/inline-static-env'
import { FallbackMode, fallbackModeToFallbackField } from '../lib/fallback'
import { RenderingMode } from './rendering-mode'
import { getParamKeys } from '../server/request/fallback-params'
import {
formatNodeOptions,
getParsedNodeOptionsWithoutInspect,
} from '../server/lib/utils'

type Fallback = null | boolean | string

Expand Down Expand Up @@ -684,6 +688,12 @@ export function createStaticWorker(
clear: () => void
}
): StaticWorker {
// Get the node options without inspect and also remove the
// --max-old-space-size flag as it can cause memory issues.
const nodeOptions = getParsedNodeOptionsWithoutInspect()
delete nodeOptions['max-old-space-size']
delete nodeOptions['max_old_space_size']

return new Worker(staticWorkerPath, {
logger: Log,
numWorkers: getNumberOfWorkers(config),
Expand All @@ -694,7 +704,7 @@ export function createStaticWorker(
progress?.clear()
},
forkOptions: {
env: process.env,
env: { ...process.env, NODE_OPTIONS: formatNodeOptions(nodeOptions) },
},
enableWorkerThreads: config.experimental.workerThreads,
exposedMethods: staticWorkerExposedMethods,
Expand Down
36 changes: 21 additions & 15 deletions packages/next/src/build/webpack-build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { Worker } from '../../lib/worker'
import origDebug from 'next/dist/compiled/debug'
import path from 'path'
import { exportTraceState, recordTraceEvents } from '../../trace'
import {
formatNodeOptions,
getParsedNodeOptionsWithoutInspect,
} from '../../server/lib/utils'

const debug = origDebug('next:build:webpack-build')

Expand Down Expand Up @@ -37,24 +41,27 @@ async function webpackBuildWithWorker(

prunedBuildContext.pluginState = pluginState

const worker = new Worker(path.join(__dirname, 'impl.js'), {
exposedMethods: ['workerMain'],
numWorkers: 1,
maxRetries: 0,
forkOptions: {
env: {
...process.env,
NEXT_PRIVATE_BUILD_WORKER: '1',
},
},
}) as Worker & typeof import('./impl')

const combinedResult = {
duration: 0,
buildTraceContext: {} as BuildTraceContext,
}

const nodeOptions = getParsedNodeOptionsWithoutInspect()

for (const compilerName of compilerNames) {
const worker = new Worker(path.join(__dirname, 'impl.js'), {
exposedMethods: ['workerMain'],
numWorkers: 1,
maxRetries: 0,
forkOptions: {
env: {
...process.env,
NEXT_PRIVATE_BUILD_WORKER: '1',
NODE_OPTIONS: formatNodeOptions(nodeOptions),
},
},
}) as Worker & typeof import('./impl')

const curResult = await worker.workerMain({
buildContext: prunedBuildContext,
compilerName,
Expand All @@ -67,6 +74,8 @@ async function webpackBuildWithWorker(
if (nextBuildSpan && curResult.debugTraceEvents) {
recordTraceEvents(curResult.debugTraceEvents)
}
// destroy worker so it's not sticking around using memory
await worker.end()

// Update plugin state
pluginState = deepMerge(pluginState, curResult.pluginState)
Expand Down Expand Up @@ -102,9 +111,6 @@ async function webpackBuildWithWorker(
}
}

// destroy worker so it's not sticking around using memory
worker.end()

if (compilerNames.length === 3) {
Log.event('Compiled successfully')
}
Expand Down
Loading

0 comments on commit 924db94

Please sign in to comment.