From 805bfa45e0c638366e55f1039908fc10634d495c Mon Sep 17 00:00:00 2001 From: Alex Kirszenberg Date: Mon, 3 Jul 2023 11:03:37 +0200 Subject: [PATCH] Remove EnvironmentIntention (#51965) See https://github.com/vercel/turbo/pull/5420 # Turbopack changes * https://github.com/vercel/turbo/pull/5420 * https://github.com/vercel/turbo/pull/5387 --- Cargo.lock | 70 +++++++++---------- Cargo.toml | 6 +- .../next-build/src/next_pages/page_chunks.rs | 2 +- .../next-swc/crates/next-core/js/package.json | 4 +- .../crates/next-core/src/app_source.rs | 26 ++----- .../next-core/src/next_client/context.rs | 13 ++-- .../crates/next-core/src/next_edge/context.rs | 13 ++-- .../next-core/src/next_server/context.rs | 23 ++---- .../crates/next-core/src/page_source.rs | 10 +-- .../next-swc/crates/next-core/src/router.rs | 5 +- .../crates/next-core/src/web_entry_source.rs | 13 ++-- pnpm-lock.yaml | 33 +++------ 12 files changed, 81 insertions(+), 137 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e80fa00604a5..9513d4a9828e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -412,7 +412,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "serde", ] @@ -3550,7 +3550,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "serde", @@ -7210,7 +7210,7 @@ dependencies = [ [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "auto-hash-map", @@ -7241,7 +7241,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "cargo-lock", @@ -7253,7 +7253,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "bytes", @@ -7268,7 +7268,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "dotenvy", @@ -7282,7 +7282,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "indexmap", @@ -7299,7 +7299,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "auto-hash-map", @@ -7329,7 +7329,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "base16", "hex", @@ -7341,7 +7341,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7355,7 +7355,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "proc-macro2", "quote", @@ -7365,7 +7365,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "mimalloc", ] @@ -7373,7 +7373,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "auto-hash-map", @@ -7396,7 +7396,7 @@ dependencies = [ [[package]] name = "turbo-tasks-testing" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "auto-hash-map", @@ -7408,7 +7408,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-recursion", @@ -7438,7 +7438,7 @@ dependencies = [ [[package]] name = "turbopack-bench" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "chromiumoxide", @@ -7468,7 +7468,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "auto-hash-map", "mdxjs", @@ -7510,7 +7510,7 @@ dependencies = [ [[package]] name = "turbopack-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "indexmap", @@ -7530,7 +7530,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "clap 4.1.11", @@ -7554,7 +7554,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-trait", @@ -7582,7 +7582,7 @@ dependencies = [ [[package]] name = "turbopack-create-test-app" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "clap 4.1.11", @@ -7595,7 +7595,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-trait", @@ -7617,7 +7617,7 @@ dependencies = [ [[package]] name = "turbopack-dev" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "indexmap", @@ -7641,7 +7641,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-compression", @@ -7677,7 +7677,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-trait", @@ -7710,7 +7710,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-trait", @@ -7733,7 +7733,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "indoc", @@ -7750,7 +7750,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "indexmap", @@ -7766,7 +7766,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "base64 0.21.0", @@ -7786,7 +7786,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "serde", @@ -7801,7 +7801,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "mdxjs", @@ -7816,7 +7816,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "async-stream", @@ -7851,7 +7851,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "serde", @@ -7867,7 +7867,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "swc_core", "turbo-tasks", @@ -7878,7 +7878,7 @@ dependencies = [ [[package]] name = "turbopack-test-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230630.2#b36c4140a11fb2530b5a70f5c44d8a95206f9ef1" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230702.1#c51c7abdcd4f5092ba2ab492b3cdc78c1a16b144" dependencies = [ "anyhow", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 77922464d56c6..a2ff8575638f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,11 +42,11 @@ swc_core = { version = "0.78.24" } testing = { version = "0.33.19" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230630.2" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230702.1" } # [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-230630.2" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230702.1" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230630.2" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230702.1" } # General Deps diff --git a/packages/next-swc/crates/next-build/src/next_pages/page_chunks.rs b/packages/next-swc/crates/next-build/src/next_pages/page_chunks.rs index e5da8658e9767..179c2572c80db 100644 --- a/packages/next-swc/crates/next-build/src/next_pages/page_chunks.rs +++ b/packages/next-swc/crates/next-build/src/next_pages/page_chunks.rs @@ -122,7 +122,7 @@ pub async fn get_page_chunks( ) .into(); - let node_compile_time_info = get_server_compile_time_info(node_ty, mode, env, node_addr); + let node_compile_time_info = get_server_compile_time_info(mode, env, node_addr); let node_resolve_options_context = get_server_resolve_options_context( project_root, node_ty, diff --git a/packages/next-swc/crates/next-core/js/package.json b/packages/next-swc/crates/next-core/js/package.json index 95af8717a72a1..efea13e8a861c 100644 --- a/packages/next-swc/crates/next-core/js/package.json +++ b/packages/next-swc/crates/next-core/js/package.json @@ -10,8 +10,8 @@ "check": "tsc --noEmit" }, "dependencies": { - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230630.2", - "@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230630.2", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230702.1", + "@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230702.1", "anser": "^2.1.1", "css.escape": "^1.5.1", "next": "*", diff --git a/packages/next-swc/crates/next-core/src/app_source.rs b/packages/next-swc/crates/next-core/src/app_source.rs index 7fd06bdb60c13..770f077a03628 100644 --- a/packages/next-swc/crates/next-core/src/app_source.rs +++ b/packages/next-swc/crates/next-core/src/app_source.rs @@ -17,7 +17,7 @@ use turbopack_binding::{ chunk::{EvaluatableAssetVc, EvaluatableAssetsVc}, compile_time_info::CompileTimeInfoVc, context::{AssetContext, AssetContextVc}, - environment::{EnvironmentIntention, ServerAddrVc}, + environment::ServerAddrVc, issue::{Issue, IssueSeverity, IssueSeverityVc, IssueVc}, reference_type::{ EcmaScriptModulesReferenceSubType, EntryReferenceSubType, InnerAssetsVc, @@ -198,7 +198,7 @@ fn next_ssr_client_module_transition( next_config, execution_context, ), - ssr_environment: get_server_compile_time_info(ty, mode, process_env, server_addr), + ssr_environment: get_server_compile_time_info(mode, process_env, server_addr), } .cell() .into() @@ -216,7 +216,7 @@ fn next_server_component_transition( ) -> TransitionVc { let ty = Value::new(ServerContextType::AppRSC { app_dir }); let mode = NextMode::Development; - let rsc_compile_time_info = get_server_compile_time_info(ty, mode, process_env, server_addr); + let rsc_compile_time_info = get_server_compile_time_info(mode, process_env, server_addr); let rsc_resolve_options_context = get_server_resolve_options_context(project_path, ty, mode, next_config, execution_context); let rsc_module_options_context = @@ -243,11 +243,7 @@ fn next_edge_server_component_transition( ) -> TransitionVc { let ty = Value::new(ServerContextType::AppRSC { app_dir }); let mode = NextMode::Development; - let rsc_compile_time_info = get_edge_compile_time_info( - project_path, - server_addr, - Value::new(EnvironmentIntention::ServerRendering), - ); + let rsc_compile_time_info = get_edge_compile_time_info(project_path, server_addr); let rsc_resolve_options_context = get_edge_resolve_options_context(project_path, ty, next_config, execution_context); let rsc_module_options_context = @@ -275,11 +271,7 @@ fn next_edge_route_transition( ) -> TransitionVc { let server_ty = Value::new(ServerContextType::AppRoute { app_dir }); - let edge_compile_time_info = get_edge_compile_time_info( - project_path, - server_addr, - Value::new(EnvironmentIntention::Api), - ); + let edge_compile_time_info = get_edge_compile_time_info(project_path, server_addr); let edge_chunking_context = DevChunkingContextVc::builder( project_path, @@ -319,11 +311,7 @@ fn next_edge_page_transition( ) -> TransitionVc { let server_ty = Value::new(ServerContextType::AppRoute { app_dir }); - let edge_compile_time_info = get_edge_compile_time_info( - project_path, - server_addr, - Value::new(EnvironmentIntention::ServerRendering), - ); + let edge_compile_time_info = get_edge_compile_time_info(project_path, server_addr); let edge_chunking_context = DevChunkingContextVc::builder( project_path, @@ -460,7 +448,7 @@ fn app_context( let ssr_ty = Value::new(ServerContextType::AppSSR { app_dir }); ModuleAssetContextVc::new( TransitionsByNameVc::cell(transitions), - get_server_compile_time_info(ssr_ty, mode, env, server_addr), + get_server_compile_time_info(mode, env, server_addr), get_server_module_options_context( project_path, execution_context, diff --git a/packages/next-swc/crates/next-core/src/next_client/context.rs b/packages/next-swc/crates/next-core/src/next_client/context.rs index 8d845969f3661..6dce2e83f2de1 100644 --- a/packages/next-swc/crates/next-core/src/next_client/context.rs +++ b/packages/next-swc/crates/next-core/src/next_client/context.rs @@ -15,9 +15,7 @@ use turbopack_binding::{ FreeVarReference, FreeVarReferencesVc, }, context::AssetContextVc, - environment::{ - BrowserEnvironment, EnvironmentIntention, EnvironmentVc, ExecutionEnvironment, - }, + environment::{BrowserEnvironment, EnvironmentVc, ExecutionEnvironment}, free_var_references, resolve::{parse::RequestVc, pattern::Pattern}, }, @@ -107,8 +105,8 @@ async fn next_client_free_vars(mode: NextMode) -> Result { #[turbo_tasks::function] pub fn get_client_compile_time_info(mode: NextMode, browserslist_query: &str) -> CompileTimeInfoVc { - CompileTimeInfo::builder(EnvironmentVc::new( - Value::new(ExecutionEnvironment::Browser( + CompileTimeInfo::builder(EnvironmentVc::new(Value::new( + ExecutionEnvironment::Browser( BrowserEnvironment { dom: true, web_worker: false, @@ -116,9 +114,8 @@ pub fn get_client_compile_time_info(mode: NextMode, browserslist_query: &str) -> browserslist_query: browserslist_query.to_owned(), } .into(), - )), - Value::new(EnvironmentIntention::Client), - )) + ), + ))) .defines(next_client_defines(mode)) .free_var_references(next_client_free_vars(mode)) .cell() diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 1557ac231c8eb..01ca566179918 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -10,8 +10,7 @@ use turbopack_binding::{ FreeVarReference, FreeVarReferencesVc, }, environment::{ - EdgeWorkerEnvironment, EnvironmentIntention, EnvironmentVc, ExecutionEnvironment, - ServerAddrVc, + EdgeWorkerEnvironment, EnvironmentVc, ExecutionEnvironment, ServerAddrVc, }, free_var_references, }, @@ -64,14 +63,10 @@ fn next_edge_free_vars(project_path: FileSystemPathVc) -> FreeVarReferencesVc { pub fn get_edge_compile_time_info( project_path: FileSystemPathVc, server_addr: ServerAddrVc, - intention: Value, ) -> CompileTimeInfoVc { - CompileTimeInfo::builder(EnvironmentVc::new( - Value::new(ExecutionEnvironment::EdgeWorker( - EdgeWorkerEnvironment { server_addr }.into(), - )), - intention, - )) + CompileTimeInfo::builder(EnvironmentVc::new(Value::new( + ExecutionEnvironment::EdgeWorker(EdgeWorkerEnvironment { server_addr }.into()), + ))) .defines(next_edge_defines()) .free_var_references(next_edge_free_vars(project_path)) .cell() diff --git a/packages/next-swc/crates/next-core/src/next_server/context.rs b/packages/next-swc/crates/next-core/src/next_server/context.rs index beedcb31a7fee..93ac6ae40bc55 100644 --- a/packages/next-swc/crates/next-core/src/next_server/context.rs +++ b/packages/next-swc/crates/next-core/src/next_server/context.rs @@ -10,10 +10,7 @@ use turbopack_binding::{ CompileTimeDefines, CompileTimeDefinesVc, CompileTimeInfo, CompileTimeInfoVc, FreeVarReferencesVc, }, - environment::{ - EnvironmentIntention, EnvironmentVc, ExecutionEnvironment, NodeJsEnvironmentVc, - ServerAddrVc, - }, + environment::{EnvironmentVc, ExecutionEnvironment, NodeJsEnvironmentVc, ServerAddrVc}, free_var_references, }, ecmascript::TransformPluginVc, @@ -245,25 +242,13 @@ async fn next_server_free_vars(mode: NextMode) -> Result { #[turbo_tasks::function] pub fn get_server_compile_time_info( - ty: Value, mode: NextMode, process_env: ProcessEnvVc, server_addr: ServerAddrVc, ) -> CompileTimeInfoVc { - CompileTimeInfo::builder(EnvironmentVc::new( - Value::new(ExecutionEnvironment::NodeJsLambda( - NodeJsEnvironmentVc::current(process_env, server_addr), - )), - match ty.into_value() { - ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } => { - Value::new(EnvironmentIntention::ServerRendering) - } - ServerContextType::AppSSR { .. } => Value::new(EnvironmentIntention::Prerendering), - ServerContextType::AppRSC { .. } => Value::new(EnvironmentIntention::ServerRendering), - ServerContextType::AppRoute { .. } => Value::new(EnvironmentIntention::Api), - ServerContextType::Middleware => Value::new(EnvironmentIntention::Middleware), - }, - )) + CompileTimeInfo::builder(EnvironmentVc::new(Value::new( + ExecutionEnvironment::NodeJsLambda(NodeJsEnvironmentVc::current(process_env, server_addr)), + ))) .defines(next_server_defines(mode)) .free_var_references(next_server_free_vars(mode)) .cell() diff --git a/packages/next-swc/crates/next-core/src/page_source.rs b/packages/next-swc/crates/next-core/src/page_source.rs index 80c349349a18b..e3aa8398c00ec 100644 --- a/packages/next-swc/crates/next-core/src/page_source.rs +++ b/packages/next-swc/crates/next-core/src/page_source.rs @@ -16,7 +16,7 @@ use turbopack_binding::{ asset::{AssetVc, AssetsVc}, chunk::{ChunkingContextVc, EvaluatableAssetVc, EvaluatableAssetsVc}, context::{AssetContext, AssetContextVc}, - environment::{EnvironmentIntention, ServerAddrVc}, + environment::ServerAddrVc, reference_type::{EntryReferenceSubType, InnerAssetsVc, ReferenceType}, source_asset::SourceAssetVc, }, @@ -152,11 +152,7 @@ pub async fn create_page_source( .cell() .into(); - let edge_compile_time_info = get_edge_compile_time_info( - project_root, - server_addr, - Value::new(EnvironmentIntention::Api), - ); + let edge_compile_time_info = get_edge_compile_time_info(project_root, server_addr); let edge_chunking_context = DevChunkingContextVc::builder( project_root, @@ -186,7 +182,7 @@ pub async fn create_page_source( .cell() .into(); - let server_compile_time_info = get_server_compile_time_info(server_ty, mode, env, server_addr); + let server_compile_time_info = get_server_compile_time_info(mode, env, server_addr); let server_resolve_options_context = get_server_resolve_options_context( project_root, server_ty, diff --git a/packages/next-swc/crates/next-core/src/router.rs b/packages/next-swc/crates/next-core/src/router.rs index fc56edbb36395..bdeb8c58770f9 100644 --- a/packages/next-swc/crates/next-core/src/router.rs +++ b/packages/next-swc/crates/next-core/src/router.rs @@ -20,7 +20,7 @@ use turbopack_binding::{ changed::any_content_changed, chunk::ChunkingContext, context::{AssetContext, AssetContextVc}, - environment::{EnvironmentIntention::Middleware, ServerAddrVc, ServerInfo}, + environment::{ServerAddrVc, ServerInfo}, ident::AssetIdentVc, issue::IssueVc, reference_type::{EcmaScriptModulesReferenceSubType, InnerAssetsVc, ReferenceType}, @@ -240,8 +240,7 @@ fn edge_transition_map( next_config: NextConfigVc, execution_context: ExecutionContextVc, ) -> TransitionsByNameVc { - let edge_compile_time_info = - get_edge_compile_time_info(project_path, server_addr, Value::new(Middleware)); + let edge_compile_time_info = get_edge_compile_time_info(project_path, server_addr); let edge_chunking_context = DevChunkingContextVc::builder( project_path, diff --git a/packages/next-swc/crates/next-core/src/web_entry_source.rs b/packages/next-swc/crates/next-core/src/web_entry_source.rs index 16307596c2a82..19d87a4f28763 100644 --- a/packages/next-swc/crates/next-core/src/web_entry_source.rs +++ b/packages/next-swc/crates/next-core/src/web_entry_source.rs @@ -12,9 +12,7 @@ use turbopack_binding::{ CompileTimeDefines, CompileTimeDefinesVc, CompileTimeInfo, CompileTimeInfoVc, FreeVarReferencesVc, }, - environment::{ - BrowserEnvironment, EnvironmentIntention, EnvironmentVc, ExecutionEnvironment, - }, + environment::{BrowserEnvironment, EnvironmentVc, ExecutionEnvironment}, free_var_references, reference_type::{EntryReferenceSubType, ReferenceType}, resolve::{origin::PlainResolveOriginVc, parse::RequestVc}, @@ -62,8 +60,8 @@ async fn web_free_vars() -> Result { #[turbo_tasks::function] pub fn get_compile_time_info(browserslist_query: &str) -> CompileTimeInfoVc { - CompileTimeInfo::builder(EnvironmentVc::new( - Value::new(ExecutionEnvironment::Browser( + CompileTimeInfo::builder(EnvironmentVc::new(Value::new( + ExecutionEnvironment::Browser( BrowserEnvironment { dom: true, web_worker: false, @@ -71,9 +69,8 @@ pub fn get_compile_time_info(browserslist_query: &str) -> CompileTimeInfoVc { browserslist_query: browserslist_query.to_owned(), } .into(), - )), - Value::new(EnvironmentIntention::Client), - )) + ), + ))) .defines(web_defines()) .free_var_references(web_free_vars()) .cell() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cba72f6dbaf11..87901bb8c5b2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -992,8 +992,8 @@ importers: '@types/react': 18.2.7 '@types/react-dom': 18.2.4 '@vercel/ncc': ^0.36.0 - '@vercel/turbopack-ecmascript-runtime': https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230630.2 - '@vercel/turbopack-node': https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230630.2 + '@vercel/turbopack-ecmascript-runtime': https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230702.1 + '@vercel/turbopack-node': https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230702.1 anser: ^2.1.1 css.escape: ^1.5.1 find-up: ^6.3.0 @@ -1005,8 +1005,8 @@ importers: stacktrace-parser: ^0.1.10 strip-ansi: ^7.0.1 dependencies: - '@vercel/turbopack-ecmascript-runtime': '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230630.2_react-refresh@0.12.0' - '@vercel/turbopack-node': '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230630.2' + '@vercel/turbopack-ecmascript-runtime': '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230702.1_react-refresh@0.12.0' + '@vercel/turbopack-node': '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230702.1' anser: 2.1.1 css.escape: 1.5.1 next: link:../../../../next @@ -6136,7 +6136,7 @@ packages: dependencies: '@mdx-js/mdx': 2.2.1 source-map: 0.7.3 - webpack: 5.86.0 + webpack: 5.86.0_@swc+core@1.3.55 transitivePeerDependencies: - supports-color @@ -6810,7 +6810,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-darwin-x64/1.3.55: @@ -6819,7 +6818,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm-gnueabihf/1.3.55: @@ -6828,7 +6826,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-gnu/1.3.55: @@ -6837,7 +6834,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-musl/1.3.55: @@ -6846,7 +6842,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-gnu/1.3.55: @@ -6855,7 +6850,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-musl/1.3.55: @@ -6864,7 +6858,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-win32-arm64-msvc/1.3.55: @@ -6873,7 +6866,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-ia32-msvc/1.3.55: @@ -6882,7 +6874,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-x64-msvc/1.3.55: @@ -6891,7 +6882,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core/1.3.55_@swc+helpers@0.5.1: @@ -6916,7 +6906,6 @@ packages: '@swc/core-win32-arm64-msvc': 1.3.55 '@swc/core-win32-ia32-msvc': 1.3.55 '@swc/core-win32-x64-msvc': 1.3.55 - dev: true /@swc/helpers/0.4.14: resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} @@ -23819,7 +23808,6 @@ packages: serialize-javascript: 6.0.1 terser: 5.17.7 webpack: 5.86.0_@swc+core@1.3.55 - dev: true /terser/5.10.0: resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} @@ -25177,7 +25165,6 @@ packages: - '@swc/core' - esbuild - uglify-js - dev: true /websocket-driver/0.7.3: resolution: {integrity: sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==} @@ -25586,9 +25573,9 @@ packages: /zwitch/2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230630.2_react-refresh@0.12.0': - resolution: {tarball: https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230630.2} - id: '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230630.2' + '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230702.1_react-refresh@0.12.0': + resolution: {tarball: https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230702.1} + id: '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230702.1' name: '@vercel/turbopack-ecmascript-runtime' version: 0.0.0 dependencies: @@ -25599,8 +25586,8 @@ packages: - webpack dev: false - '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230630.2': - resolution: {tarball: https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230630.2} + '@gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230702.1': + resolution: {tarball: https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230702.1} name: '@vercel/turbopack-node' version: 0.0.0 dependencies: