From 7df9116f0271ba5ffcdd9b3160859f9887349167 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 24 Jul 2024 23:09:34 +0200 Subject: [PATCH 1/2] update turbopack --- Cargo.lock | 74 +++++++++++++++++++------------------- Cargo.toml | 6 ++-- packages/next/package.json | 2 +- pnpm-lock.yaml | 10 +++--- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18828bebd386d..55d6f19edbe6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "serde", "smallvec", @@ -3090,7 +3090,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "serde", @@ -6888,12 +6888,12 @@ dependencies = [ [[package]] name = "turbo-prehash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-trait", @@ -6927,7 +6927,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "cargo-lock", @@ -6940,7 +6940,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "bytes", @@ -6954,7 +6954,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "dotenvs", @@ -6968,7 +6968,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "lazy_static", @@ -6984,7 +6984,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "auto-hash-map", @@ -7015,7 +7015,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "md4", "turbo-tasks-macros", @@ -7025,7 +7025,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "either", @@ -7040,7 +7040,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "proc-macro2", "quote", @@ -7050,7 +7050,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "mimalloc", ] @@ -7058,7 +7058,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "auto-hash-map", @@ -7086,7 +7086,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-recursion", @@ -7116,7 +7116,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "auto-hash-map", "mdxjs", @@ -7157,7 +7157,7 @@ dependencies = [ [[package]] name = "turbopack-browser" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7180,7 +7180,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "clap", @@ -7197,7 +7197,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-recursion", @@ -7226,7 +7226,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7253,7 +7253,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-compression", @@ -7289,7 +7289,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-trait", @@ -7324,7 +7324,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "serde", "serde_json", @@ -7335,7 +7335,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-trait", @@ -7360,7 +7360,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indoc", @@ -7376,7 +7376,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7392,7 +7392,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "base64 0.21.4", @@ -7411,7 +7411,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "serde", @@ -7426,7 +7426,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "mdxjs", @@ -7441,7 +7441,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "async-stream", @@ -7475,7 +7475,7 @@ dependencies = [ [[package]] name = "turbopack-nodejs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7495,7 +7495,7 @@ dependencies = [ [[package]] name = "turbopack-resolve" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7513,7 +7513,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "serde", @@ -7529,7 +7529,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "swc_core", "turbo-tasks", @@ -7540,7 +7540,7 @@ dependencies = [ [[package]] name = "turbopack-trace-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "either", @@ -7560,7 +7560,7 @@ dependencies = [ [[package]] name = "turbopack-trace-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "crossbeam-channel", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240722.3#7677ac8f23775c5ff10bf23fa43b2097975a7f85" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240724.2#f32ebe9618ff7f3b45c7d086918185412cb4668b" dependencies = [ "anyhow", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index bed1d551671b1..28b2e5e336a27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,11 +38,11 @@ swc_core = { version = "0.96.9", features = [ testing = { version = "0.36.0" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240722.3" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240724.2" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240722.3" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240724.2" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240722.3" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240724.2" } # General Deps diff --git a/packages/next/package.json b/packages/next/package.json index c3bfebf315483..da4bfe10dc4e4 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -206,7 +206,7 @@ "@types/ws": "8.2.0", "@vercel/ncc": "0.34.0", "@vercel/nft": "0.27.1", - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240724.2", "acorn": "8.11.3", "amphtml-validator": "1.0.35", "anser": "1.4.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 92a1c53860268..5e2165c98d77c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1119,8 +1119,8 @@ importers: specifier: 0.27.1 version: 0.27.1(encoding@0.1.13) '@vercel/turbopack-ecmascript-runtime': - specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3 - version: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3 + specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240724.2 + version: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240724.2 acorn: specifier: 8.11.3 version: 8.11.3 @@ -5234,8 +5234,8 @@ packages: resolution: {integrity: sha512-OTe0KE37F5Y2eTys6eMnfopC+P4qr2ooXUTFyFPTplYSPwowmFk/HLD1FXtbKLjqsIH0SgekcJWad+C5uX4nkg==} engines: {node: '>=16'} - '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3} + '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240724.2': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240724.2} version: 0.0.0 '@webassemblyjs/ast@1.11.6': @@ -19827,7 +19827,7 @@ snapshots: satori: 0.10.9 yoga-wasm-web: 0.3.3 - '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240722.3': + '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240724.2': dependencies: '@types/node': 20.12.3 From c021d487ac358b75c7bafdacc8e2fecd535aa54e Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 24 Jul 2024 10:22:14 +0200 Subject: [PATCH 2/2] use failsafe_parse to avoid large invalidations on parse errors --- crates/next-api/src/dynamic_imports.rs | 2 +- crates/next-api/src/server_actions.rs | 2 +- crates/next-core/src/util.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/next-api/src/dynamic_imports.rs b/crates/next-api/src/dynamic_imports.rs index fea92c76dfaa7..ca6e10bf3ed15 100644 --- a/crates/next-api/src/dynamic_imports.rs +++ b/crates/next-api/src/dynamic_imports.rs @@ -272,7 +272,7 @@ async fn build_dynamic_imports_map_for_module( // https://github.com/vercel/next.js/pull/56389#discussion_r1349336374 // don't emit specific error as we expect there's a parse error already reported - let ParseResult::Ok { program, .. } = &*ecmascript_asset.parse().await? else { + let ParseResult::Ok { program, .. } = &*ecmascript_asset.failsafe_parse().await? else { return Ok(Vc::cell(None)); }; diff --git a/crates/next-api/src/server_actions.rs b/crates/next-api/src/server_actions.rs index 172c62fc7e71c..3a16c0f52ff7b 100644 --- a/crates/next-api/src/server_actions.rs +++ b/crates/next-api/src/server_actions.rs @@ -301,7 +301,7 @@ async fn parse_actions(module: Vc>) -> Result>) -> Result