diff --git a/turbopack/crates/turbopack-dev-server/src/source/mod.rs b/turbopack/crates/turbopack-dev-server/src/source/mod.rs index 3f8c31f03dd3c..ad6023d426000 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/mod.rs @@ -475,33 +475,31 @@ impl ContentSource for NoContentSource { } } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs, NonLocalValue)] pub enum RewriteType { Location { - /// The new path and query used to lookup content. This _does not_ need - /// to be the original path or query. + /// The new path and query used to lookup content. This _does not_ need to be the original + /// path or query. path_and_query: RcStr, }, ContentSource { - /// [Vc>]s from which to restart the lookup - /// process. This _does not_ need to be the original content - /// source. - source: Vc>, + /// [`ContentSource`]s from which to restart the lookup process. This _does not_ need to be + /// the original content source. + source: ResolvedVc>, /// The new path and query used to lookup content. This _does not_ need /// to be the original path or query. path_and_query: RcStr, }, Sources { - /// [GetContentSourceContent]s from which to restart the lookup - /// process. This _does not_ need to be the original content - /// source. - sources: Vc, + /// [`GetContentSourceContent`]s from which to restart the lookup process. This _does not_ + /// need to be the original content source. + sources: ResolvedVc, }, } /// A rewrite returned from a [ContentSource]. This tells the dev server to /// update its parsed url, path, and queries with this new information. -#[turbo_tasks::value(shared, local)] +#[turbo_tasks::value(shared)] #[derive(Debug)] pub struct Rewrite { pub ty: RewriteType, @@ -531,7 +529,7 @@ impl RewriteBuilder { } pub fn new_source_with_path_and_query( - source: Vc>, + source: ResolvedVc>, path_and_query: RcStr, ) -> Self { Self { @@ -546,7 +544,7 @@ impl RewriteBuilder { } } - pub fn new_sources(sources: Vc) -> Self { + pub fn new_sources(sources: ResolvedVc) -> Self { Self { rewrite: Rewrite { ty: RewriteType::Sources { sources }, diff --git a/turbopack/crates/turbopack-dev-server/src/source/resolve.rs b/turbopack/crates/turbopack-dev-server/src/source/resolve.rs index 69e43b91c24a6..9024812922b09 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/resolve.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/resolve.rs @@ -22,7 +22,7 @@ use super::{ /// The result of [`resolve_source_request`]. Similar to a /// `ContentSourceContent`, but without the `Rewrite` variant as this is taken /// care in the function. -#[turbo_tasks::value(serialization = "none", local)] +#[turbo_tasks::value(serialization = "none")] pub enum ResolveSourceRequestResult { NotFound, Static(ResolvedVc, ResolvedVc), @@ -102,7 +102,7 @@ pub async fn resolve_source_request( RewriteType::Sources { sources: new_sources, } => { - sources = *new_sources; + sources = **new_sources; continue 'sources; } } diff --git a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs index 19e128a86ce40..da397cc7dc663 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs @@ -63,7 +63,7 @@ impl GetContentSourceContent for WrappedGetContentSourceContent { "Rewrites for WrappedGetContentSourceContent are not implemented yet" ), RewriteType::Sources { sources } => RewriteType::Sources { - sources: Vc::cell( + sources: ResolvedVc::cell( sources .await? .iter()