diff --git a/crates/next-api/src/module_graph.rs b/crates/next-api/src/module_graph.rs index 47f26e6a852996..e570a9a21dcad0 100644 --- a/crates/next-api/src/module_graph.rs +++ b/crates/next-api/src/module_graph.rs @@ -23,8 +23,8 @@ use turbo_tasks::{ debug::ValueDebugFormat, graph::{AdjacencyMap, GraphTraversal, Visit, VisitControlFlow, VisitedNodes}, trace::{TraceRawVcs, TraceRawVcsContext}, - CollectiblesSource, FxIndexMap, ReadRef, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, - ValueToString, Vc, + CollectiblesSource, FxIndexMap, NonLocalValue, ReadRef, ResolvedVc, TryFlatJoinIterExt, + TryJoinIterExt, ValueToString, Vc, }; use turbopack_core::{ chunk::ChunkingType, @@ -52,7 +52,7 @@ pub enum GraphTraversalAction { Skip, } -#[derive(Clone, Debug, Serialize, Deserialize, TraceRawVcs)] +#[derive(Clone, Debug, Serialize, Deserialize, TraceRawVcs, NonLocalValue)] pub struct SingleModuleGraphNode { pub module: ResolvedVc>, pub issues: Vec>>, diff --git a/crates/next-core/src/next_client_reference/visit_client_reference.rs b/crates/next-core/src/next_client_reference/visit_client_reference.rs index 611d51fe2606ba..8c706f1c54c1cc 100644 --- a/crates/next-core/src/next_client_reference/visit_client_reference.rs +++ b/crates/next-core/src/next_client_reference/visit_client_reference.rs @@ -8,7 +8,7 @@ use turbo_tasks::{ debug::ValueDebugFormat, graph::{AdjacencyMap, GraphTraversal, Visit, VisitControlFlow, VisitedNodes}, trace::TraceRawVcs, - FxIndexMap, FxIndexSet, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, + FxIndexMap, FxIndexSet, NonLocalValue, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, }; use turbo_tasks_fs::FileSystemPath; use turbopack::css::CssModuleAsset; @@ -21,7 +21,17 @@ use crate::{ }; #[derive( - Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize, Debug, ValueDebugFormat, TraceRawVcs, + Copy, + Clone, + Eq, + PartialEq, + Hash, + Serialize, + Deserialize, + Debug, + ValueDebugFormat, + TraceRawVcs, + NonLocalValue, )] pub struct ClientReference { server_component: Option>, @@ -39,7 +49,17 @@ impl ClientReference { } #[derive( - Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize, Debug, ValueDebugFormat, TraceRawVcs, + Copy, + Clone, + Eq, + PartialEq, + Hash, + Serialize, + Deserialize, + Debug, + ValueDebugFormat, + TraceRawVcs, + NonLocalValue, )] pub enum ClientReferenceType { EcmascriptClientReference { @@ -302,7 +322,16 @@ impl VisitClientReferenceNodeState { } #[derive( - Clone, Eq, PartialEq, Hash, Serialize, Deserialize, Debug, ValueDebugFormat, TraceRawVcs, + Clone, + Eq, + PartialEq, + Hash, + Serialize, + Deserialize, + Debug, + ValueDebugFormat, + TraceRawVcs, + NonLocalValue, )] enum VisitClientReferenceNodeType { ClientReference(ClientReference, ReadRef), diff --git a/turbopack/crates/turbopack-core/src/chunk/mod.rs b/turbopack/crates/turbopack-core/src/chunk/mod.rs index cf3c2b9839d5a8..9e4c9d213a6b75 100644 --- a/turbopack/crates/turbopack-core/src/chunk/mod.rs +++ b/turbopack/crates/turbopack-core/src/chunk/mod.rs @@ -165,6 +165,7 @@ pub trait OutputChunk: Asset { Eq, PartialEq, ValueDebugFormat, + NonLocalValue, )] pub enum ChunkingType { /// Module is placed in the same chunk group and is loaded in parallel. It diff --git a/turbopack/crates/turbopack-core/src/reference_type.rs b/turbopack/crates/turbopack-core/src/reference_type.rs index 5a920758f26dbb..d58cc7ce56827d 100644 --- a/turbopack/crates/turbopack-core/src/reference_type.rs +++ b/turbopack/crates/turbopack-core/src/reference_type.rs @@ -27,20 +27,20 @@ impl InnerAssets { // TODO when plugins are supported, replace u8 with a trait that defines the // behavior. -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum CommonJsReferenceSubType { Custom(u8), Undefined, } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum ImportWithType { Json, } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Default, Clone, Hash)] pub enum EcmaScriptModulesReferenceSubType { ImportPart(ResolvedVc), @@ -163,7 +163,7 @@ impl ImportContext { } } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum CssReferenceSubType { AtImport(Option>), @@ -178,7 +178,7 @@ pub enum CssReferenceSubType { Undefined, } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum UrlReferenceSubType { EcmaScriptNewUrl, @@ -187,14 +187,14 @@ pub enum UrlReferenceSubType { Undefined, } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum TypeScriptReferenceSubType { Custom(u8), Undefined, } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum WorkerReferenceSubType { WebWorker, @@ -206,7 +206,7 @@ pub enum WorkerReferenceSubType { // TODO(sokra) this was next.js specific values. We want to solve this in a // different way. -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum EntryReferenceSubType { Web, @@ -222,7 +222,7 @@ pub enum EntryReferenceSubType { Undefined, } -#[turbo_tasks::value(serialization = "auto_for_input")] +#[turbo_tasks::value(serialization = "auto_for_input", non_local)] #[derive(Debug, Clone, Hash)] pub enum ReferenceType { CommonJs(CommonJsReferenceSubType), diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs index 1b3cedc323547f..feea41955cd439 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs @@ -14,7 +14,7 @@ use swc_core::{ }, }; use turbo_rcstr::RcStr; -use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, TaskInput, Vc}; +use turbo_tasks::{trace::TraceRawVcs, NonLocalValue, ResolvedVc, TaskInput, Vc}; use turbopack_core::chunk::ChunkingContext; use super::EsmAssetReference; @@ -38,7 +38,9 @@ impl EsmBindings { } } -#[derive(Hash, Clone, Debug, TaskInput, Serialize, Deserialize, PartialEq, Eq, TraceRawVcs)] +#[derive( + Hash, Clone, Debug, TaskInput, Serialize, Deserialize, PartialEq, Eq, TraceRawVcs, NonLocalValue, +)] pub struct EsmBinding { pub reference: ResolvedVc, pub export: Option, diff --git a/turbopack/crates/turbopack/src/module_options/module_rule.rs b/turbopack/crates/turbopack/src/module_options/module_rule.rs index 0c5c40fd964912..76a3e32a701475 100644 --- a/turbopack/crates/turbopack/src/module_options/module_rule.rs +++ b/turbopack/crates/turbopack/src/module_options/module_rule.rs @@ -1,6 +1,6 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, Vc}; +use turbo_tasks::{trace::TraceRawVcs, NonLocalValue, ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ reference_type::ReferenceType, source::Source, source_transform::SourceTransforms, @@ -11,7 +11,7 @@ use turbopack_wasm::source::WebAssemblySourceType; use super::{match_mode::MatchMode, CustomModuleType, RuleCondition}; -#[derive(Debug, Clone, Serialize, Deserialize, TraceRawVcs, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, TraceRawVcs, PartialEq, Eq, NonLocalValue)] pub struct ModuleRule { condition: RuleCondition, effects: Vec, @@ -61,7 +61,7 @@ impl ModuleRule { } } -#[turbo_tasks::value(shared)] +#[turbo_tasks::value(shared, non_local)] #[derive(Debug, Clone)] pub enum ModuleRuleEffect { ModuleType(ModuleType), @@ -75,7 +75,7 @@ pub enum ModuleRuleEffect { SourceTransforms(ResolvedVc), } -#[turbo_tasks::value(serialization = "auto_for_input", shared)] +#[turbo_tasks::value(serialization = "auto_for_input", shared, non_local)] #[derive(Hash, Debug, Copy, Clone)] pub enum ModuleType { Ecmascript { diff --git a/turbopack/crates/turbopack/src/module_options/rule_condition.rs b/turbopack/crates/turbopack/src/module_options/rule_condition.rs index b963b869a9dda2..0bc997281b2c42 100644 --- a/turbopack/crates/turbopack/src/module_options/rule_condition.rs +++ b/turbopack/crates/turbopack/src/module_options/rule_condition.rs @@ -1,12 +1,12 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use turbo_tasks::{primitives::Regex, trace::TraceRawVcs, ReadRef, Vc}; +use turbo_tasks::{primitives::Regex, trace::TraceRawVcs, NonLocalValue, ReadRef, Vc}; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; use turbopack_core::{ reference_type::ReferenceType, source::Source, virtual_source::VirtualSource, }; -#[derive(Debug, Clone, Serialize, Deserialize, TraceRawVcs, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, TraceRawVcs, PartialEq, Eq, NonLocalValue)] pub enum RuleCondition { All(Vec), Any(Vec),