Skip to content

Commit

Permalink
Merge branch 'canary' into fix/x-forwarded-headers-middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 1, 2023
2 parents 52f7021 + f2efb50 commit 964c185
Show file tree
Hide file tree
Showing 121 changed files with 372 additions and 264 deletions.
15 changes: 0 additions & 15 deletions errors/webpack-build-worker-opt-out.mdx

This file was deleted.

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": "14.0.2-canary.2"
"version": "14.0.2-canary.3"
}
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,16 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-canary-0c6348758-20231030",
"react-builtin": "npm:react@18.3.0-canary-08a39539f-20231031",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-0c6348758-20231030",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-0c6348758-20231030",
"react-experimental-builtin": "npm:react@0.0.0-experimental-0c6348758-20231030",
"react-server-dom-turbopack": "18.3.0-canary-0c6348758-20231030",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-0c6348758-20231030",
"react-server-dom-webpack": "18.3.0-canary-0c6348758-20231030",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-0c6348758-20231030",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-08a39539f-20231031",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-08a39539f-20231031",
"react-experimental-builtin": "npm:react@0.0.0-experimental-08a39539f-20231031",
"react-server-dom-turbopack": "18.3.0-canary-08a39539f-20231031",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-08a39539f-20231031",
"react-server-dom-webpack": "18.3.0-canary-08a39539f-20231031",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-08a39539f-20231031",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -212,8 +212,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.6",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-0c6348758-20231030",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-0c6348758-20231030",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-08a39539f-20231031",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-08a39539f-20231031",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"keywords": [
"react",
"next",
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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "14.0.2-canary.2",
"@next/eslint-plugin-next": "14.0.2-canary.3",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
"eslint-import-resolver-node": "^0.3.6",
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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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,6 +1,6 @@
{
"name": "@next/font",
"version": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"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": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "14.0.2-canary.2",
"version": "14.0.2-canary.3",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -92,7 +92,7 @@
]
},
"dependencies": {
"@next/env": "14.0.2-canary.2",
"@next/env": "14.0.2-canary.3",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
Expand Down Expand Up @@ -146,11 +146,11 @@
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "14.0.2-canary.2",
"@next/polyfill-nomodule": "14.0.2-canary.2",
"@next/react-dev-overlay": "14.0.2-canary.2",
"@next/react-refresh-utils": "14.0.2-canary.2",
"@next/swc": "14.0.2-canary.2",
"@next/polyfill-module": "14.0.2-canary.3",
"@next/polyfill-nomodule": "14.0.2-canary.3",
"@next/react-dev-overlay": "14.0.2-canary.3",
"@next/react-refresh-utils": "14.0.2-canary.3",
"@next/swc": "14.0.2-canary.3",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "^1.35.1",
"@taskr/clear": "1.1.0",
Expand Down
33 changes: 8 additions & 25 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,35 +1061,16 @@ export default async function build(
})

const [duration] = process.hrtime(turboNextBuildStart)
return { duration, buildTraceContext: undefined }
return { duration, buildTraceContext: null }
}
let buildTraceContext: undefined | BuildTraceContext
let buildTracesPromise: Promise<any> | undefined = undefined

// if the option is set, we respect it, otherwise we check if the user
// has a custom webpack config and disable the build worker by default.
const useBuildWorker =
config.experimental.webpackBuildWorker || !config.webpack
nextBuildSpan.setAttribute(
'has-custom-webpack-config',
String(!!config.webpack)
)
nextBuildSpan.setAttribute('use-build-worker', String(useBuildWorker))

if (
config.webpack &&
config.experimental.webpackBuildWorker === undefined
) {
Log.warn(
'Custom webpack configuration is detected. When using a custom webpack configuration, the Webpack build worker is disabled by default. To force enable it, set the "experimental.webpackBuildWorker" option to "true". Read more: https://nextjs.org/docs/messages/webpack-build-worker-opt-out'
)
}

if (!isGenerate) {
if (isCompile && useBuildWorker) {
if (isCompile && config.experimental.webpackBuildWorker) {
let durationInSeconds = 0

await webpackBuild(true, ['server']).then((res) => {
await webpackBuild(['server']).then((res) => {
buildTraceContext = res.buildTraceContext
durationInSeconds += res.duration
const buildTraceWorker = new Worker(
Expand Down Expand Up @@ -1118,11 +1099,11 @@ export default async function build(
})
})

await webpackBuild(true, ['edge-server']).then((res) => {
await webpackBuild(['edge-server']).then((res) => {
durationInSeconds += res.duration
})

await webpackBuild(true, ['client']).then((res) => {
await webpackBuild(['client']).then((res) => {
durationInSeconds += res.duration
})

Expand All @@ -1138,7 +1119,7 @@ export default async function build(
} else {
const { duration: webpackBuildDuration, ...rest } = turboNextBuild
? await turbopackBuild()
: await webpackBuild(false)
: await webpackBuild()

buildTraceContext = rest.buildTraceContext

Expand Down Expand Up @@ -1387,6 +1368,7 @@ export default async function build(
async () =>
hasCustomErrorPage &&
pagesStaticWorkers.isPageStatic({
dir,
page: '/_error',
distDir,
configFileName,
Expand Down Expand Up @@ -1586,6 +1568,7 @@ export default async function build(
? appStaticWorkers
: pagesStaticWorkers
)!.isPageStatic({
dir,
page,
originalAppPath,
distDir,
Expand Down
9 changes: 8 additions & 1 deletion packages/next/src/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,7 @@ export const collectGenerateParams = async (
}

export async function buildAppStaticPaths({
dir,
page,
distDir,
configFileName,
Expand All @@ -1229,6 +1230,7 @@ export async function buildAppStaticPaths({
serverHooks,
ppr,
}: {
dir: string
page: string
configFileName: string
generateParams: GenerateParams
Expand All @@ -1252,7 +1254,9 @@ export async function buildAppStaticPaths({
let CacheHandler: any

if (incrementalCacheHandlerPath) {
CacheHandler = require(incrementalCacheHandlerPath)
CacheHandler = require(path.isAbsolute(incrementalCacheHandlerPath)
? incrementalCacheHandlerPath
: path.join(dir, incrementalCacheHandlerPath))
CacheHandler = CacheHandler.default || CacheHandler
}

Expand Down Expand Up @@ -1379,6 +1383,7 @@ export async function buildAppStaticPaths({
}

export async function isPageStatic({
dir,
page,
distDir,
configFileName,
Expand All @@ -1396,6 +1401,7 @@ export async function isPageStatic({
incrementalCacheHandlerPath,
ppr,
}: {
dir: string
page: string
distDir: string
configFileName: string
Expand Down Expand Up @@ -1565,6 +1571,7 @@ export async function isPageStatic({
fallback: prerenderFallback,
encodedPaths: encodedPrerenderRoutes,
} = await buildAppStaticPaths({
dir,
page,
serverHooks,
staticGenerationAsyncStorage,
Expand Down
13 changes: 7 additions & 6 deletions packages/next/src/build/webpack-build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,17 @@ async function webpackBuildWithWorker(
return combinedResult
}

export function webpackBuild(
withWorker: boolean,
export async function webpackBuild(
compilerNames?: typeof ORDERED_COMPILER_NAMES
): ReturnType<typeof webpackBuildWithWorker> {
if (withWorker) {
) {
const config = NextBuildContext.config!

if (config.experimental.webpackBuildWorker) {
debug('using separate compiler workers')
return webpackBuildWithWorker(compilerNames)
return await webpackBuildWithWorker(compilerNames)
} else {
debug('building all compilers in same process')
const webpackBuildImpl = require('./impl').webpackBuildImpl
return webpackBuildImpl()
return await webpackBuildImpl()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-0c6348758-20231030';
var ReactVersion = '18.3.0-experimental-08a39539f-20231031';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');
var stream = require('stream');

var ReactVersion = '18.3.0-experimental-0c6348758-20231030';
var ReactVersion = '18.3.0-experimental-08a39539f-20231031';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function printWarning(level, format, args) {
}
}

var ReactVersion = '18.3.0-experimental-0c6348758-20231030';
var ReactVersion = '18.3.0-experimental-08a39539f-20231031';

var Internals = {
usingClientEntryPoint: false,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 964c185

Please sign in to comment.