LongYinan 2023-02-01 23:36:43 +08:00 committed by GitHub
parent f2d95da75b
commit 221692b32e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 70 additions and 61 deletions

View file

@ -100,10 +100,12 @@ module.exports = {
contextDirectory?: string
// if there is `process.cwd()` expression in your code, you can set this option to tell `turbotrace` the value of `process.cwd()` while tracing.
// for example the require(process.cwd() + '/package.json') will be traced as require('/path/to/cwd/package.json')
processCwd?: string,
processCwd?: string
// control the maximum number of files that are passed to the `turbotrace`
// default is 128
maxFiles?: number;
maxFiles?: number
// control the maximum memory usage of the `turbotrace`, in `MB`
memoryLimit?: number
},
},
}

View file

@ -71,6 +71,9 @@ name = "anyhow"
version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
dependencies = [
"backtrace",
]
[[package]]
name = "arrayref"
@ -123,7 +126,7 @@ dependencies = [
[[package]]
name = "auto-hash-map"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"serde",
]
@ -2152,9 +2155,9 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389"
[[package]]
name = "napi"
version = "2.10.9"
version = "2.10.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b60e2bc632f89dad5d47da61591bd468f87f5dbfc85af27aa876772c89d8c4e4"
checksum = "a6d58a7870622e4351385b9987a87476efda841e0a2cf66e7bbd01a79ec2e5f5"
dependencies = [
"anyhow",
"bitflags",
@ -2175,9 +2178,9 @@ checksum = "882a73d9ef23e8dc2ebbffb6a6ae2ef467c0f18ac10711e4cc59c5485d41df0e"
[[package]]
name = "napi-derive"
version = "2.9.5"
version = "2.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47bff5a8ed70117bce55053a74ff8f423f90c48c704030609272e6e3bde1c5a4"
checksum = "4f73dd4ddd118bd87756c72fead4c727dc4ee6ba3af3cd98d8490eb09b5a8573"
dependencies = [
"convert_case 0.6.0",
"napi-derive-backend",
@ -2188,9 +2191,9 @@ dependencies = [
[[package]]
name = "napi-derive-backend"
version = "1.0.41"
version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13b412301aeebee17724fff6d73536e9ecb8387f10bbbf317a9f7a006cc1c5b"
checksum = "57e4e6bb1ee73ec3938a8dfd2ce81955954b8e48c3a40c839918a9735feb0d61"
dependencies = [
"convert_case 0.6.0",
"once_cell",
@ -2303,7 +2306,7 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
[[package]]
name = "next-binding"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"mdxjs",
"modularize_imports",
@ -2319,7 +2322,7 @@ dependencies = [
[[package]]
name = "next-core"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"auto-hash-map",
@ -2329,7 +2332,6 @@ dependencies = [
"once_cell",
"qstring",
"regex",
"reqwest",
"serde",
"serde_json",
"swc_core",
@ -2350,7 +2352,7 @@ dependencies = [
[[package]]
name = "next-dev"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"futures",
@ -2375,7 +2377,7 @@ dependencies = [
[[package]]
name = "next-font"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"fxhash",
"serde",
@ -2426,7 +2428,7 @@ dependencies = [
[[package]]
name = "next-transform-dynamic"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"pathdiff",
"swc_core",
@ -2435,7 +2437,7 @@ dependencies = [
[[package]]
name = "next-transform-strip-page-exports"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"fxhash",
"swc_core",
@ -2445,7 +2447,7 @@ dependencies = [
[[package]]
name = "node-file-trace"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"clap",
@ -3207,12 +3209,10 @@ dependencies = [
"tokio",
"tokio-native-tls",
"tokio-rustls",
"tokio-util",
"tower-service",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
"wasm-streams",
"web-sys",
"webpki-roots",
"winreg",
@ -5458,7 +5458,7 @@ dependencies = [
[[package]]
name = "turbo-malloc"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"mimalloc",
]
@ -5466,7 +5466,7 @@ dependencies = [
[[package]]
name = "turbo-tasks"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"auto-hash-map",
@ -5495,7 +5495,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-build"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"cargo-lock",
@ -5507,7 +5507,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-env"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"dotenvy",
@ -5521,7 +5521,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-fetch"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"indexmap",
@ -5538,7 +5538,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-fs"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"auto-hash-map",
@ -5563,7 +5563,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-hash"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"base16",
"hex",
@ -5575,7 +5575,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-macros"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"convert_case 0.5.0",
@ -5589,7 +5589,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-macros-shared"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"proc-macro2",
"quote",
@ -5599,7 +5599,7 @@ dependencies = [
[[package]]
name = "turbo-tasks-memory"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"auto-hash-map",
@ -5621,7 +5621,7 @@ dependencies = [
[[package]]
name = "turbopack"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"indexmap",
@ -5646,7 +5646,7 @@ dependencies = [
[[package]]
name = "turbopack-cli-utils"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"clap",
@ -5662,7 +5662,7 @@ dependencies = [
[[package]]
name = "turbopack-core"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"async-trait",
@ -5688,7 +5688,7 @@ dependencies = [
[[package]]
name = "turbopack-css"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"async-trait",
@ -5707,7 +5707,7 @@ dependencies = [
[[package]]
name = "turbopack-dev-server"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"futures",
@ -5736,7 +5736,7 @@ dependencies = [
[[package]]
name = "turbopack-ecmascript"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"async-trait",
@ -5773,7 +5773,7 @@ dependencies = [
[[package]]
name = "turbopack-env"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"serde",
@ -5788,7 +5788,7 @@ dependencies = [
[[package]]
name = "turbopack-json"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"serde",
@ -5803,7 +5803,7 @@ dependencies = [
[[package]]
name = "turbopack-mdx"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"mdxjs",
@ -5818,7 +5818,7 @@ dependencies = [
[[package]]
name = "turbopack-node"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"futures",
@ -5840,7 +5840,7 @@ dependencies = [
[[package]]
name = "turbopack-static"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"anyhow",
"serde",
@ -5856,7 +5856,7 @@ dependencies = [
[[package]]
name = "turbopack-swc-utils"
version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230126.1#3bbbc471d3f8b9f6c141d620ae6f18dd206fd8cd"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230201.1#125c68323e7dfca427d7f38a1ba7f0898f77fe98"
dependencies = [
"swc_core",
"turbo-tasks",
@ -5870,7 +5870,7 @@ version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
"cfg-if 1.0.0",
"cfg-if 0.1.10",
"rand",
"static_assertions",
]
@ -6162,19 +6162,6 @@ dependencies = [
"leb128",
]
[[package]]
name = "wasm-streams"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078"
dependencies = [
"futures-util",
"js-sys",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "wasmer"
version = "2.3.0"

View file

@ -19,7 +19,7 @@ serde = "1"
serde_json = "1"
tracing = { version = "0.1.37", features = ["release_max_level_info"] }
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230126.1", features = [
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230201.1", features = [
"__swc_core",
"__swc_core_next_core",
"__swc_transform_styled_jsx",
@ -29,7 +29,7 @@ next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-2
] }
[dev-dependencies]
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230126.1", features = [
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230201.1", features = [
"__swc_core_testing_transform",
"__swc_testing",
] }

View file

@ -39,7 +39,7 @@ tracing = { version = "0.1.37", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9"
tracing-chrome = "0.5.0"
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230126.1", features = [
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230201.1", features = [
"__swc_core_binding_napi",
"__turbo_next_dev_server",
"__turbo_node_file_trace",

View file

@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8"
getrandom = { version = "0.2.5", optional = true, default-features = false }
js-sys = "0.3.59"
serde-wasm-bindgen = "0.4.3"
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230126.1", features = [
next-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230201.1", features = [
"__swc_core_binding_wasm",
"__feature_mdx_rs",
] }

View file

@ -60,6 +60,7 @@ import {
SUBRESOURCE_INTEGRITY_MANIFEST,
MIDDLEWARE_BUILD_MANIFEST,
MIDDLEWARE_REACT_LOADABLE_MANIFEST,
TURBO_TRACE_DEFAULT_MEMORY_LIMIT,
} from '../shared/lib/constants'
import { getSortedRoutes, isDynamicRoute } from '../shared/lib/router/utils'
import { __ApiPreviewProps } from '../server/api-utils'
@ -1768,6 +1769,9 @@ export default async function build(
processCwd: config.experimental.turbotrace.processCwd,
logDetail: config.experimental.turbotrace.logDetail,
showAll: config.experimental.turbotrace.logAll,
memoryLimit:
config.experimental.turbotrace.memoryLimit ??
TURBO_TRACE_DEFAULT_MEMORY_LIMIT,
})
} else {
const ignores = [

View file

@ -7,7 +7,10 @@ import {
nodeFileTrace,
NodeFileTraceReasons,
} from 'next/dist/compiled/@vercel/nft'
import { TRACE_OUTPUT_VERSION } from '../../../shared/lib/constants'
import {
TRACE_OUTPUT_VERSION,
TURBO_TRACE_DEFAULT_MEMORY_LIMIT,
} from '../../../shared/lib/constants'
import { webpack, sources } from 'next/dist/compiled/webpack/webpack'
import {
NODE_ESM_RESOLVE_OPTIONS,
@ -430,6 +433,9 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
this.turbotrace?.processCwd ?? this.appDir,
logLevel: this.turbotrace?.logLevel,
showAll: this.turbotrace?.logAll,
memoryLimit:
this.turbotrace?.memoryLimit ??
TURBO_TRACE_DEFAULT_MEMORY_LIMIT,
})
)
chunks = restChunks
@ -831,6 +837,9 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
processCwd: this.turbotrace?.processCwd ?? this.appDir,
showAll: this.turbotrace?.logAll,
logLevel: this.turbotrace?.logLevel,
memoryLimit:
this.turbotrace?.memoryLimit ??
TURBO_TRACE_DEFAULT_MEMORY_LIMIT,
})
chunks = restChunks
if (restChunks.length) {
@ -846,7 +855,7 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
version: TRACE_OUTPUT_VERSION,
files: [],
}))
console.log(this.turbotraceOutputPath, this.turbotraceFiles)
existedNftFile.files.push(...this.turbotraceFiles)
const filesSet = new Set(existedNftFile.files)
existedNftFile.files = [...filesSet]

View file

@ -472,6 +472,9 @@ const configSchema = {
maxFiles: {
type: 'integer',
},
memoryLimit: {
type: 'integer',
},
},
},
},

View file

@ -175,6 +175,7 @@ export interface ExperimentalConfig {
contextDirectory?: string
processCwd?: string
maxFiles?: number
memoryLimit?: number
}
mdxRs?: boolean
}

View file

@ -113,6 +113,8 @@ export const DEFAULT_SANS_SERIF_FONT = {
}
export const STATIC_STATUS_PAGES = ['/500']
export const TRACE_OUTPUT_VERSION = 1
// in `MB`
export const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000
export const RSC_MODULE_TYPES = {
client: 'client',

View file

@ -22,6 +22,7 @@ module.exports = {
experimental: {
turbotrace: {
contextDirectory: path.join(__dirname, '..', '..', '..', '..'),
memoryLimit: 4096,
},
},
}