Skip to content

Commit d569edf

Browse files
committed
Merge branch 'canary' into reafactor/misc-export-typescript-updates
2 parents d6e4ac4 + 11b01e0 commit d569edf

File tree

28 files changed

+264
-166
lines changed

28 files changed

+264
-166
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"version": "13.5.4-canary.9"
19+
"version": "13.5.4"
2020
}

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "13.5.4-canary.9",
13+
"@next/eslint-plugin-next": "13.5.4",
1414
"@rushstack/eslint-patch": "^1.3.3",
1515
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
1616
"eslint-import-resolver-node": "^0.3.6",

packages/eslint-plugin-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"description": "ESLint plugin for Next.js.",
55
"main": "dist/index.js",
66
"license": "MIT",

packages/font/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/font",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/font"

packages/next-bundle-analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"license": "MIT",

packages/next-codemod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

packages/next-env/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/env",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"keywords": [
55
"react",
66
"next",

packages/next-mdx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/mdx",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-plugin-storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-storybook",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-storybook"

packages/next-polyfill-module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-module",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
55
"main": "dist/polyfill-module.js",
66
"license": "MIT",

packages/next-polyfill-nomodule/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-nomodule",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"description": "A polyfill for non-dead, nomodule browsers.",
55
"main": "dist/polyfill-nomodule.js",
66
"license": "MIT",

packages/next-swc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/swc",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"private": true,
55
"scripts": {
66
"clean": "node ../../scripts/rm.mjs native",

packages/next/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next",
3-
"version": "13.5.4-canary.9",
3+
"version": "13.5.4",
44
"description": "The React Framework",
55
"main": "./dist/server/next.js",
66
"license": "MIT",
@@ -90,7 +90,7 @@
9090
]
9191
},
9292
"dependencies": {
93-
"@next/env": "13.5.4-canary.9",
93+
"@next/env": "13.5.4",
9494
"@swc/helpers": "0.5.2",
9595
"busboy": "1.6.0",
9696
"caniuse-lite": "^1.0.30001406",
@@ -144,11 +144,11 @@
144144
"@mswjs/interceptors": "0.23.0",
145145
"@napi-rs/cli": "2.16.2",
146146
"@napi-rs/triples": "1.1.0",
147-
"@next/polyfill-module": "13.5.4-canary.9",
148-
"@next/polyfill-nomodule": "13.5.4-canary.9",
149-
"@next/react-dev-overlay": "13.5.4-canary.9",
150-
"@next/react-refresh-utils": "13.5.4-canary.9",
151-
"@next/swc": "13.5.4-canary.9",
147+
"@next/polyfill-module": "13.5.4",
148+
"@next/polyfill-nomodule": "13.5.4",
149+
"@next/react-dev-overlay": "13.5.4",
150+
"@next/react-refresh-utils": "13.5.4",
151+
"@next/swc": "13.5.4",
152152
"@opentelemetry/api": "1.4.1",
153153
"@playwright/test": "^1.35.1",
154154
"@segment/ajv-human-errors": "2.1.2",

packages/next/src/build/build-context.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { __ApiPreviewProps } from '../server/api-utils'
55
import type { NextConfigComplete } from '../server/config-shared'
66
import type { Span } from '../trace'
77
import type getBaseWebpackConfig from './webpack-config'
8-
import type { PagesManifest } from './webpack/plugins/pages-manifest-plugin'
98
import type { TelemetryPlugin } from './webpack/plugins/telemetry-plugin'
109

1110
// A layer for storing data that is used by plugins to communicate with each
@@ -48,12 +47,6 @@ export function getPluginState() {
4847
export const NextBuildContext: Partial<{
4948
compilerIdx?: number
5049
pluginState: Record<string, any>
51-
serializedPagesManifestEntries: {
52-
edgeServerPages?: PagesManifest
53-
nodeServerPages?: PagesManifest
54-
edgeServerAppPaths?: PagesManifest
55-
nodeServerAppPaths?: PagesManifest
56-
}
5750
// core fields
5851
dir: string
5952
buildId: string

packages/next/src/build/collect-build-traces.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Span } from '../trace'
1+
import { Span } from '../trace'
22
import type { NextConfigComplete } from '../server/config-shared'
33

44
import {
@@ -18,20 +18,23 @@ import { PageInfo } from './utils'
1818
import { loadBindings } from './swc'
1919
import { nonNullable } from '../lib/non-nullable'
2020
import * as ciEnvironment from '../telemetry/ci-info'
21+
import debugOriginal from 'next/dist/compiled/debug'
2122
import { isMatch } from 'next/dist/compiled/micromatch'
2223
import { defaultOverrides } from '../server/require-hook'
2324
import { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'
2425
import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'
2526
import { normalizeAppPath } from '../shared/lib/router/utils/app-paths'
2627

28+
const debug = debugOriginal('next:build:build-traces')
29+
2730
export async function collectBuildTraces({
2831
dir,
2932
config,
3033
distDir,
3134
pageKeys,
3235
pageInfos,
3336
staticPages,
34-
nextBuildSpan,
37+
nextBuildSpan = new Span({ name: 'build' }),
3538
hasSsrAmpPages,
3639
buildTraceContext,
3740
outputFileTracingRoot,
@@ -42,14 +45,16 @@ export async function collectBuildTraces({
4245
app?: string[]
4346
pages: string[]
4447
}
45-
staticPages: Set<string>
48+
staticPages: string[]
4649
hasSsrAmpPages: boolean
4750
outputFileTracingRoot: string
48-
pageInfos: Map<string, PageInfo>
49-
nextBuildSpan: Span
51+
pageInfos: [string, PageInfo][]
52+
nextBuildSpan?: Span
5053
config: NextConfigComplete
5154
buildTraceContext?: BuildTraceContext
5255
}) {
56+
const startTime = Date.now()
57+
debug('starting build traces')
5358
let turboTasksForTrace: unknown
5459
let bindings = await loadBindings()
5560

@@ -99,7 +104,7 @@ export async function collectBuildTraces({
99104
// The turbo trace doesn't provide the traced file type and reason at present
100105
// let's write the traced files into the first [entry].nft.json
101106
const [[, entryName]] = Array.from<[string, string]>(
102-
entryNameMap.entries()
107+
Object.entries(entryNameMap)
103108
).filter(([k]) => k.startsWith(buildTraceContextAppDir))
104109
const traceOutputPath = path.join(
105110
outputPath,
@@ -119,7 +124,7 @@ export async function collectBuildTraces({
119124
const outputPagesPath = path.join(outputPath, '..', 'pages')
120125
return (
121126
!f.startsWith(outputPagesPath) ||
122-
!staticPages.has(
127+
!staticPages.includes(
123128
// strip `outputPagesPath` and file ext from absolute
124129
f.substring(outputPagesPath.length, f.length - 3)
125130
)
@@ -369,10 +374,13 @@ export async function collectBuildTraces({
369374
}
370375
}
371376

377+
const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}
378+
372379
await Promise.all(
373380
[
374-
...(buildTraceContext?.chunksTrace?.entryNameFilesMap.entries() ||
375-
new Map()),
381+
...(entryNameFilesMap
382+
? Object.entries(entryNameFilesMap)
383+
: new Map()),
376384
].map(async ([entryName, entryNameFiles]) => {
377385
const isApp = entryName.startsWith('app/')
378386
const isPages = entryName.startsWith('pages/')
@@ -387,7 +395,7 @@ export async function collectBuildTraces({
387395

388396
// we don't need to trace for automatically statically optimized
389397
// pages as they don't have server bundles
390-
if (staticPages.has(route)) {
398+
if (staticPages.includes(route)) {
391399
return
392400
}
393401
const entryOutputPath = path.join(
@@ -504,7 +512,7 @@ export async function collectBuildTraces({
504512

505513
for (let page of pageKeys.pages) {
506514
// edge routes have no trace files
507-
const pageInfo = pageInfos.get(page)
515+
const [, pageInfo] = pageInfos.find((item) => item[0] === page) || []
508516
if (pageInfo?.runtime === 'edge') {
509517
continue
510518
}
@@ -584,4 +592,6 @@ export async function collectBuildTraces({
584592
)
585593
}
586594
})
595+
596+
debug(`finished build tracing ${Date.now() - startTime}ms`)
587597
}

packages/next/src/build/handle-externals.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ export function makeExternalHandler({
301301
return resolveResult.localRes
302302
}
303303

304-
if (request === 'styled-jsx/style' && !isAppLayer) {
305-
return `commonjs ${defaultOverrides['styled-jsx/style']}`
304+
// Forcedly resolve the styled-jsx installed by next.js,
305+
// since `resolveExternal` cannot find the styled-jsx dep with pnpm
306+
if (request === 'styled-jsx/style') {
307+
resolveResult.res = defaultOverrides['styled-jsx/style']
306308
}
307309

308310
const { res, isEsm } = resolveResult

0 commit comments

Comments
 (0)