From 0ffba2d9999dbf2ee19086b06b9fd80fe80986b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:56:12 +0900 Subject: [PATCH 01/59] ResolvedVc --- turbopack/crates/turbopack-dev-server/src/introspect/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs index e675d44fae666..0e2b30eff3f71 100644 --- a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::HashSet, fmt::Display}; use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{ReadRef, TryJoinIterExt, Vc}; +use turbo_tasks::{ReadRef, ResolvedVc, TryJoinIterExt, Vc}; use turbo_tasks_fs::{json::parse_json_with_source_context, File}; use turbopack_core::{ asset::AssetContent, @@ -18,7 +18,7 @@ use crate::source::{ #[turbo_tasks::value(shared)] pub struct IntrospectionSource { - pub roots: HashSet>>, + pub roots: HashSet>>, } #[turbo_tasks::value_impl] From 33cbc2d4629a2fc481c8f167e2f201f8f21625f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:56:28 +0900 Subject: [PATCH 02/59] ResolvedVc --- .../crates/turbopack-dev-server/src/source/conditional.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 26b64bf7884a4..7e7b75cd0e571 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{Completion, State, Value, Vc}; +use turbo_tasks::{Completion, ResolvedVc, State, Value, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{ @@ -67,7 +67,7 @@ impl ContentSource for ConditionalContentSource { #[turbo_tasks::value] struct ConditionalContentSourceMapper { - source: Vc, + source: ResolvedVc, } #[turbo_tasks::value_impl] @@ -152,8 +152,8 @@ impl Introspectable for ConditionalContentSource { #[turbo_tasks::value(serialization = "none", eq = "manual", cell = "new")] struct ActivateOnGetContentSource { - source: Vc, - get_content: Vc>, + source: ResolvedVc, + get_content: ResolvedVc>, } #[turbo_tasks::value_impl] From 0cf45410167af474ca182353f7b362b6d8951dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:56:43 +0900 Subject: [PATCH 03/59] ResolvedVc --- .../crates/turbopack-dev-server/src/source/asset_graph.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index cd257fb8d30e7..a607ab2a59a1d 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -29,8 +29,8 @@ type ExpandedState = State>; #[turbo_tasks::value(serialization = "none", eq = "manual", cell = "new")] pub struct AssetGraphContentSource { - root_path: Vc, - root_assets: Vc, + root_path: ResolvedVc, + root_assets: ResolvedVc, expanded: Option, } @@ -237,9 +237,9 @@ impl ContentSource for AssetGraphContentSource { #[turbo_tasks::value] struct AssetGraphGetContentSourceContent { - source: Vc, + source: ResolvedVc, path: RcStr, - asset: Vc>, + asset: ResolvedVc>, } #[turbo_tasks::value_impl] From 8c8e2d8c193c185448c2d224de8b2f642d7d9b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:56:53 +0900 Subject: [PATCH 04/59] ResolvedVc --- turbopack/crates/turbopack-dev-server/src/source/combined.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/combined.rs b/turbopack/crates/turbopack-dev-server/src/source/combined.rs index 4ae58f8834e50..afe19bb85604f 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/combined.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/combined.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{TryJoinIterExt, Vc}; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{ @@ -15,7 +15,7 @@ use crate::source::ContentSources; /// not a [ContentSourceContent::NotFound]) will be returned. #[turbo_tasks::value(shared)] pub struct CombinedContentSource { - pub sources: Vec>>, + pub sources: Vec>>, } impl CombinedContentSource { From 2b7f4e00204732f7f99655bc93db0b7fb3b7fa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:57:00 +0900 Subject: [PATCH 05/59] ResolvedVc --- .../turbopack-dev-server/src/source/issue_context.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index 23ea78abe0628..13e07c20f1372 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{Value, Vc}; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ introspect::{Introspectable, IntrospectableChildren}, @@ -15,9 +15,9 @@ use super::{ #[turbo_tasks::value] pub struct IssueFilePathContentSource { - file_path: Option>, + file_path: Option>, description: RcStr, - source: Vc>, + source: ResolvedVc>, } #[turbo_tasks::value_impl] @@ -70,7 +70,7 @@ impl ContentSource for IssueFilePathContentSource { #[turbo_tasks::value] struct IssueContextContentSourceMapper { - source: Vc, + source: ResolvedVc, } #[turbo_tasks::value_impl] @@ -92,8 +92,8 @@ impl MapGetContentSourceContent for IssueContextContentSourceMapper { #[turbo_tasks::value] struct IssueContextGetContentSourceContent { - get_content: Vc>, - source: Vc, + get_content: ResolvedVc>, + source: ResolvedVc, } #[turbo_tasks::value_impl] From 6a456afc76cdec06d798f144b575a09b901458fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:57:07 +0900 Subject: [PATCH 06/59] ResolvedVc --- .../turbopack-dev-server/src/source/lazy_instantiated.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs b/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs index 22ec8c51fa0cf..78de3a4331e86 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::Vc; +use turbo_tasks::{ResolvedVc, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{route_tree::RouteTree, ContentSource}; @@ -17,7 +17,7 @@ pub trait GetContentSource { /// actually used. #[turbo_tasks::value(shared)] pub struct LazyInstantiatedContentSource { - pub get_source: Vc>, + pub get_source: ResolvedVc>, } #[turbo_tasks::value_impl] From 90291b9390ff66c12e0ac9165f9c993aa79af574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:57:19 +0900 Subject: [PATCH 07/59] ResolvedVc --- .../crates/turbopack-dev-server/src/source/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/mod.rs b/turbopack/crates/turbopack-dev-server/src/source/mod.rs index 670cdd3301ec1..3f872bb059afe 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/mod.rs @@ -75,13 +75,13 @@ pub trait GetContentSourceContent { } #[turbo_tasks::value(transparent)] -pub struct GetContentSourceContents(Vec>>); +pub struct GetContentSourceContents(Vec>>); #[turbo_tasks::value] pub struct StaticContent { - pub content: Vc>, + pub content: ResolvedVc>, pub status_code: u16, - pub headers: Vc, + pub headers: ResolvedVc, } #[turbo_tasks::value(shared)] @@ -200,7 +200,7 @@ pub struct ContentSourceData { /// requested. pub raw_headers: Option>, /// Request body, if requested. - pub body: Option>, + pub body: Option>, /// See [ContentSourceDataVary::cache_buster]. pub cache_buster: u64, } @@ -443,7 +443,7 @@ where } #[turbo_tasks::value(transparent)] -pub struct ContentSources(Vec>>); +pub struct ContentSources(Vec>>); #[turbo_tasks::value_impl] impl ContentSources { From 8f0e36f8acb435532c0c666cbb8bae56f5829307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:57:41 +0900 Subject: [PATCH 08/59] ResolvedVc --- .../turbopack-dev-server/src/source/route_tree.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 9d1bb93b18122..7a2b206428d03 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -41,7 +41,7 @@ impl BaseSegment { /// lead to creating new tasks over and over. A celled list leads to task reuse /// and faster operation. #[turbo_tasks::value(transparent)] -pub struct RouteTrees(Vec>); +pub struct RouteTrees(Vec>); #[turbo_tasks::value_impl] impl RouteTrees { @@ -101,12 +101,12 @@ impl RouteTrees { #[derive(Default, Clone, Debug)] pub struct RouteTree { base: Vec, - sources: Vec>>, - static_segments: FxIndexMap>, + sources: Vec>>, + static_segments: FxIndexMap>, dynamic_segments: Vec>, - catch_all_sources: Vec>>, - fallback_sources: Vec>>, - not_found_sources: Vec>>, + catch_all_sources: Vec>>, + fallback_sources: Vec>>, + not_found_sources: Vec>>, } impl RouteTree { From 733bf55375a357469586ef416d508b9feb8bf91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:57:57 +0900 Subject: [PATCH 09/59] ResolvedVc --- .../turbopack-dev-server/src/source/wrapping_source.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 e32c4d6ba733f..8f9ce16e55bd8 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{Value, Vc}; +use turbo_tasks::{ResolvedVc, Value, Vc}; use super::{ ContentSourceContent, ContentSourceData, ContentSourceDataVary, GetContentSourceContent, @@ -25,8 +25,8 @@ pub trait ContentSourceProcessor { #[turbo_tasks::value] pub struct WrappedGetContentSourceContent { - inner: Vc>, - processor: Vc>, + inner: ResolvedVc>, + processor: ResolvedVc>, } #[turbo_tasks::value_impl] From 32c5d1b7a8034820d242b76467767fc02dc9a1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:58:06 +0900 Subject: [PATCH 10/59] ResolvedVc --- turbopack/crates/turbopack-dev-server/src/update/stream.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/update/stream.rs b/turbopack/crates/turbopack-dev-server/src/update/stream.rs index 165236598b953..4b7d95b2ea0d1 100644 --- a/turbopack/crates/turbopack-dev-server/src/update/stream.rs +++ b/turbopack/crates/turbopack-dev-server/src/update/stream.rs @@ -6,7 +6,7 @@ use tokio::sync::mpsc::Sender; use tokio_stream::wrappers::ReceiverStream; use tracing::Instrument; use turbo_rcstr::RcStr; -use turbo_tasks::{IntoTraitRef, ReadRef, TransientInstance, Vc}; +use turbo_tasks::{IntoTraitRef, ReadRef, ResolvedVc, TransientInstance, Vc}; use turbo_tasks_fs::{FileSystem, FileSystemPath}; use turbopack_core::{ error::PrettyPrintError, @@ -282,7 +282,7 @@ pub enum UpdateStreamItem { #[turbo_tasks::value(serialization = "none")] struct FatalStreamIssue { - description: Vc, + description: ResolvedVc, resource: RcStr, } From 970cbd598c8d11e637dacbf86cd9c54d48b48881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:58:12 +0900 Subject: [PATCH 11/59] ResolvedVc --- .../turbopack-dev-server/src/source/router.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index 80fe13c5ce17a..5252a4e0981fe 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -2,7 +2,7 @@ use std::iter::once; use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{TryJoinIterExt, Value, Vc}; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Value, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{ @@ -19,9 +19,9 @@ use crate::source::{route_tree::MapGetContentSourceContent, ContentSources}; /// other subpaths, including if the request path does not include the prefix. #[turbo_tasks::value(shared)] pub struct PrefixedRouterContentSource { - pub prefix: Vc, - pub routes: Vec<(RcStr, Vc>)>, - pub fallback: Vc>, + pub prefix: ResolvedVc, + pub routes: Vec<(RcStr, ResolvedVc>)>, + pub fallback: ResolvedVc>, } #[turbo_tasks::value_impl] @@ -121,7 +121,7 @@ impl ContentSource for PrefixedRouterContentSource { #[turbo_tasks::value] struct PrefixedRouterContentSourceMapper { - prefix: Vc, + prefix: ResolvedVc, path: RcStr, } @@ -144,8 +144,8 @@ impl MapGetContentSourceContent for PrefixedRouterContentSourceMapper { #[turbo_tasks::value] struct PrefixedRouterGetContentSourceContent { - mapper: Vc, - get_content: Vc>, + mapper: ResolvedVc, + get_content: ResolvedVc>, } #[turbo_tasks::value_impl] From 4b23f616da07daa6fd18f508107c5af7e6ee37db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:58:19 +0900 Subject: [PATCH 12/59] ResolvedVc --- .../turbopack-dev-server/src/source/static_assets.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs index 443b35fd81c3e..7765cb4d5e00d 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{Value, Vc}; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemPath}; use turbopack_core::{ asset::Asset, @@ -16,8 +16,8 @@ use super::{ #[turbo_tasks::value(shared)] pub struct StaticAssetsContentSource { - pub prefix: Vc, - pub dir: Vc, + pub prefix: ResolvedVc, + pub dir: ResolvedVc, } #[turbo_tasks::value_impl] @@ -82,7 +82,7 @@ impl ContentSource for StaticAssetsContentSource { #[turbo_tasks::value] struct StaticAssetsContentSourceItem { - path: Vc, + path: ResolvedVc, } #[turbo_tasks::value_impl] From ac389a6619ef987a70ae4459cadd99061da9640f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 11:58:24 +0900 Subject: [PATCH 13/59] ResolvedVc --- turbopack/crates/turbopack-dev-server/src/html.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/html.rs b/turbopack/crates/turbopack-dev-server/src/html.rs index 3688a31c6e256..32b5c77c563f5 100644 --- a/turbopack/crates/turbopack-dev-server/src/html.rs +++ b/turbopack/crates/turbopack-dev-server/src/html.rs @@ -30,7 +30,7 @@ type DevHtmlEntry = ( #[turbo_tasks::value(shared)] #[derive(Clone)] pub struct DevHtmlAsset { - path: Vc, + path: ResolvedVc, entries: Vec, body: Option, } From ff7ed1d30a0d2a6919a5e37302f05b9d6c57e42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:13:15 +0900 Subject: [PATCH 14/59] Fix more --- turbopack/crates/turbopack-dev-server/src/update/stream.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/update/stream.rs b/turbopack/crates/turbopack-dev-server/src/update/stream.rs index 4b7d95b2ea0d1..73cb8d3d4959e 100644 --- a/turbopack/crates/turbopack-dev-server/src/update/stream.rs +++ b/turbopack/crates/turbopack-dev-server/src/update/stream.rs @@ -310,6 +310,6 @@ impl Issue for FatalStreamIssue { #[turbo_tasks::function] fn description(&self) -> Vc { - Vc::cell(Some(self.description)) + Vc::cell(Some(*self.description)) } } From 32377454f2c4fb1d9e35fd03e35aab783c7b9abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:13:54 +0900 Subject: [PATCH 15/59] Fix more --- .../crates/turbopack-dev-server/src/source/wrapping_source.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 8f9ce16e55bd8..783154c74cd99 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs @@ -33,8 +33,8 @@ pub struct WrappedGetContentSourceContent { impl WrappedGetContentSourceContent { #[turbo_tasks::function] pub fn new( - inner: Vc>, - processor: Vc>, + inner: ResolvedVc>, + processor: ResolvedVc>, ) -> Vc { WrappedGetContentSourceContent { inner, processor }.cell() } From acae2b22383d98b17a45f1d85fb8c16952f48a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:15:00 +0900 Subject: [PATCH 16/59] Fix more --- .../crates/turbopack-dev-server/src/source/route_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 7a2b206428d03..9fabea7ded7ce 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -53,7 +53,7 @@ impl RouteTrees { return Ok(RouteTree::default().cell()); } if trees.len() == 1 { - return Ok(*trees.iter().next().unwrap()); + return Ok(**trees.iter().next().unwrap()); } // Find common base @@ -81,7 +81,7 @@ impl RouteTrees { if tree_values[i].base.len() > common_base { tree.with_base_len(common_base) } else { - *tree + **tree } }) .collect::>(); From 593e9b65e515115e172ca5b7474dbd9cb0805f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:15:49 +0900 Subject: [PATCH 17/59] Fix more --- .../crates/turbopack-dev-server/src/source/route_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 9fabea7ded7ce..45d47568e3c81 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -114,7 +114,7 @@ impl RouteTree { pub fn new_route_ref( base_segments: Vec, route_type: RouteType, - source: Vc>, + source: ResolvedVc>, ) -> Self { match route_type { RouteType::Exact => Self { @@ -250,7 +250,7 @@ impl RouteTree { pub fn new_route( base_segments: Vec, route_type: RouteType, - source: Vc>, + source: ResolvedVc>, ) -> Vc { RouteTree::new_route_ref(base_segments, route_type, source).cell() } From 05872e7b0e1248bdbdec0d31f21fbe5504d2eab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:16:32 +0900 Subject: [PATCH 18/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/combined.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/combined.rs b/turbopack/crates/turbopack-dev-server/src/source/combined.rs index afe19bb85604f..211d99ea4db8c 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/combined.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/combined.rs @@ -86,13 +86,13 @@ impl Introspectable for CombinedContentSource { .iter() .copied() .map(|s| async move { - Ok(Vc::try_resolve_sidecast::>(s).await?) + Ok(ResolvedVc::try_sidecast::>(s).await?) }) .try_join() .await? .into_iter() .flatten() - .map(|i| (source, i)) + .map(|i| (source, *i)) .collect(), )) } From ef676989a12b67fc86fdd2200ce73f2847904c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:17:09 +0900 Subject: [PATCH 19/59] Fix more --- .../turbopack-dev-server/src/source/issue_context.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index 13e07c20f1372..522140bb39b99 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -119,7 +119,7 @@ impl GetContentSourceContent for IssueContextGetContentSourceContent { let result = self .get_content .get(path, data) - .issue_file_path(source.file_path, &*source.description) + .issue_file_path(*source.file_path, &*source.description) .await?; Ok(result) } @@ -131,7 +131,7 @@ impl Introspectable for IssueFilePathContentSource { async fn ty(&self) -> Result> { Ok( if let Some(source) = - Vc::try_resolve_sidecast::>(self.source).await? + ResolvedVc::try_sidecast::>(self.source).await? { source.ty() } else { @@ -144,7 +144,7 @@ impl Introspectable for IssueFilePathContentSource { async fn title(&self) -> Result> { Ok( if let Some(source) = - Vc::try_resolve_sidecast::>(self.source).await? + ResolvedVc::try_sidecast::>(self.source).await? { let title = source.title().await?; Vc::cell(format!("{}: {}", self.description, title).into()) @@ -158,7 +158,7 @@ impl Introspectable for IssueFilePathContentSource { async fn details(&self) -> Result> { Ok( if let Some(source) = - Vc::try_resolve_sidecast::>(self.source).await? + ResolvedVc::try_sidecast::>(self.source).await? { source.details() } else { @@ -171,7 +171,7 @@ impl Introspectable for IssueFilePathContentSource { async fn children(&self) -> Result> { Ok( if let Some(source) = - Vc::try_resolve_sidecast::>(self.source).await? + ResolvedVc::try_sidecast::>(self.source).await? { source.children() } else { From 45357ccd73f33e342320a2b293ab8920835f8411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:18:21 +0900 Subject: [PATCH 20/59] Fix more --- .../crates/turbopack-dev-server/src/source/asset_graph.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index a607ab2a59a1d..064660b6ff9a6 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -246,9 +246,9 @@ struct AssetGraphGetContentSourceContent { impl AssetGraphGetContentSourceContent { #[turbo_tasks::function] pub fn new( - source: Vc, + source: ResolvedVc, path: RcStr, - asset: Vc>, + asset: ResolvedVc>, ) -> Vc { Self::cell(AssetGraphGetContentSourceContent { source, From 7ab304dfee9b1106f488dbaddb460b8186e5ac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:19:45 +0900 Subject: [PATCH 21/59] Fix more --- .../crates/turbopack-dev-server/src/source/asset_graph.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index 064660b6ff9a6..7d65bdb61138d 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -230,7 +230,9 @@ impl ContentSource for AssetGraphContentSource { )), ) }) - .collect(); + .map(|v| async move { v.await }) + .try_join() + .await?; Ok(Vc::::cell(routes).merge()) } } From 1a6cf9055794a2be1d678ed46dc6f71490a251d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:20:05 +0900 Subject: [PATCH 22/59] Fix more --- .../turbopack-dev-server/src/source/asset_graph.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index 7d65bdb61138d..48390f3541f77 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -39,7 +39,7 @@ impl AssetGraphContentSource { /// Serves all assets references by root_asset. #[turbo_tasks::function] pub fn new_eager( - root_path: Vc, + root_path: ResolvedVc, root_asset: ResolvedVc>, ) -> Vc { Self::cell(AssetGraphContentSource { @@ -53,7 +53,7 @@ impl AssetGraphContentSource { /// asset when it has served its content before. #[turbo_tasks::function] pub fn new_lazy( - root_path: Vc, + root_path: ResolvedVc, root_asset: ResolvedVc>, ) -> Vc { Self::cell(AssetGraphContentSource { @@ -66,8 +66,8 @@ impl AssetGraphContentSource { /// Serves all assets references by all root_assets. #[turbo_tasks::function] pub fn new_eager_multiple( - root_path: Vc, - root_assets: Vc, + root_path: ResolvedVc, + root_assets: ResolvedVc, ) -> Vc { Self::cell(AssetGraphContentSource { root_path, @@ -80,8 +80,8 @@ impl AssetGraphContentSource { /// of an asset when it has served its content before. #[turbo_tasks::function] pub fn new_lazy_multiple( - root_path: Vc, - root_assets: Vc, + root_path: ResolvedVc, + root_assets: ResolvedVc, ) -> Vc { Self::cell(AssetGraphContentSource { root_path, From 9e29d258c8c1e3e3e69ba535677f75df07cf9011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:20:54 +0900 Subject: [PATCH 23/59] Fix more --- .../crates/turbopack-dev-server/src/source/issue_context.rs | 4 ++-- .../crates/turbopack-dev-server/src/source/route_tree.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index 522140bb39b99..460fe9e053b0b 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -50,12 +50,12 @@ impl IssueFilePathContentSource { #[turbo_tasks::value_impl] impl ContentSource for IssueFilePathContentSource { #[turbo_tasks::function] - async fn get_routes(self: Vc) -> Result> { + async fn get_routes(self: ResolvedVc) -> Result> { let this = self.await?; let routes = this .source .get_routes() - .issue_file_path(this.file_path, &*this.description) + .issue_file_path(*this.file_path, &*this.description) .await?; Ok(routes.map_routes(Vc::upcast( IssueContextContentSourceMapper { source: self }.cell(), diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 45d47568e3c81..097347aaebadd 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -172,7 +172,7 @@ impl RouteTree { if value.len() == 1 { value.into_iter().next().unwrap() } else { - Vc::::cell(value).merge().resolve().await? + Vc::::cell(value).merge().to_resolved().await? }, )) }) From dc3749ab7dc51efbf85d2be7bb0f47dbc0179443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:22:13 +0900 Subject: [PATCH 24/59] Fix more --- .../turbopack-dev-server/src/source/issue_context.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index 460fe9e053b0b..82d1657651ed8 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -24,9 +24,9 @@ pub struct IssueFilePathContentSource { impl IssueFilePathContentSource { #[turbo_tasks::function] pub fn new_file_path( - file_path: Vc, + file_path: ResolvedVc, description: RcStr, - source: Vc>, + source: ResolvedVc>, ) -> Vc { IssueFilePathContentSource { file_path: Some(file_path), @@ -37,7 +37,10 @@ impl IssueFilePathContentSource { } #[turbo_tasks::function] - pub fn new_description(description: RcStr, source: Vc>) -> Vc { + pub fn new_description( + description: RcStr, + source: ResolvedVc>, + ) -> Vc { IssueFilePathContentSource { file_path: None, description, @@ -78,7 +81,7 @@ impl MapGetContentSourceContent for IssueContextContentSourceMapper { #[turbo_tasks::function] fn map_get_content( &self, - get_content: Vc>, + get_content: ResolvedVc>, ) -> Vc> { Vc::upcast( IssueContextGetContentSourceContent { From 947d936d72110692ae5f71ae6ff117e3444339ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:23:49 +0900 Subject: [PATCH 25/59] Fix more --- .../crates/turbopack-dev-server/src/source/conditional.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 7e7b75cd0e571..b4811377daed0 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -23,8 +23,8 @@ use crate::source::{ContentSourceContent, ContentSources}; /// served once. #[turbo_tasks::value(serialization = "none", eq = "manual", cell = "new")] pub struct ConditionalContentSource { - activator: Vc>, - action: Vc>, + activator: ResolvedVc>, + action: ResolvedVc>, activated: State, } @@ -32,8 +32,8 @@ pub struct ConditionalContentSource { impl ConditionalContentSource { #[turbo_tasks::function] pub fn new( - activator: Vc>, - action: Vc>, + activator: ResolvedVc>, + action: ResolvedVc>, ) -> Vc { ConditionalContentSource { activator, From 62950cca3281cb99e2692b844d3ec37dfde38d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:26:15 +0900 Subject: [PATCH 26/59] Fix more --- .../crates/turbopack-dev-server/src/source/asset_graph.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index 48390f3541f77..54f9448e617bd 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -44,7 +44,7 @@ impl AssetGraphContentSource { ) -> Vc { Self::cell(AssetGraphContentSource { root_path, - root_assets: Vc::cell(fxindexset! { root_asset }), + root_assets: ResolvedVc::cell(fxindexset! { root_asset }), expanded: None, }) } @@ -58,7 +58,7 @@ impl AssetGraphContentSource { ) -> Vc { Self::cell(AssetGraphContentSource { root_path, - root_assets: Vc::cell(fxindexset! { root_asset }), + root_assets: ResolvedVc::cell(fxindexset! { root_asset }), expanded: Some(State::new(HashSet::new())), }) } From 6d1cc287a197b468fcaad1ff2e92c11a1eb1a95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:26:20 +0900 Subject: [PATCH 27/59] Fix more --- .../crates/turbopack-dev-server/src/source/issue_context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index 82d1657651ed8..2c98f8f79aea7 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -107,7 +107,7 @@ impl GetContentSourceContent for IssueContextGetContentSourceContent { let result = self .get_content .vary() - .issue_file_path(source.file_path, &*source.description) + .issue_file_path(*source.file_path, &*source.description) .await?; Ok(result) } From 7b69678815e861b00e47b79fecafc87cb69c1ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:28:10 +0900 Subject: [PATCH 28/59] Fix more --- .../crates/turbopack-dev-server/src/source/static_assets.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs index 7765cb4d5e00d..096ed13cc0548 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs @@ -30,8 +30,8 @@ impl StaticAssetsContentSource { #[turbo_tasks::function] pub async fn with_prefix( - prefix: Vc, - dir: Vc, + prefix: ResolvedVc, + dir: ResolvedVc, ) -> Result> { if cfg!(debug_assertions) { let prefix_string = prefix.await?; From 63ca0bdbe64e8ef56746744cbf1741592403c485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:28:26 +0900 Subject: [PATCH 29/59] Fix more --- turbopack/crates/turbopack-dev-server/src/html.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/html.rs b/turbopack/crates/turbopack-dev-server/src/html.rs index 32b5c77c563f5..321908a222da6 100644 --- a/turbopack/crates/turbopack-dev-server/src/html.rs +++ b/turbopack/crates/turbopack-dev-server/src/html.rs @@ -44,7 +44,7 @@ fn dev_html_chunk_reference_description() -> Vc { impl OutputAsset for DevHtmlAsset { #[turbo_tasks::function] fn ident(&self) -> Vc { - AssetIdent::from_path(self.path) + AssetIdent::from_path(*self.path) } #[turbo_tasks::function] @@ -68,7 +68,7 @@ impl Asset for DevHtmlAsset { impl DevHtmlAsset { /// Create a new dev HTML asset. - pub fn new(path: Vc, entries: Vec) -> Vc { + pub fn new(path: ResolvedVc, entries: Vec) -> Vc { DevHtmlAsset { path, entries, @@ -79,7 +79,7 @@ impl DevHtmlAsset { /// Create a new dev HTML asset. pub fn new_with_body( - path: Vc, + path: ResolvedVc, entries: Vec, body: RcStr, ) -> Vc { @@ -95,7 +95,7 @@ impl DevHtmlAsset { #[turbo_tasks::value_impl] impl DevHtmlAsset { #[turbo_tasks::function] - pub async fn with_path(self: Vc, path: Vc) -> Result> { + pub async fn with_path(self: Vc, path: ResolvedVc) -> Result> { let mut html: DevHtmlAsset = self.await?.clone_value(); html.path = path; Ok(html.cell()) From 94c7322157264d16016d33581c8bc4a1ae0926fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:32:47 +0900 Subject: [PATCH 30/59] Fix more --- .../turbopack-dev-server/src/source/route_tree.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 097347aaebadd..054ba1bcf3a55 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -370,19 +370,19 @@ impl RouteTree { } = &mut this; for s in sources.iter_mut() { - *s = mapper.map_get_content(*s); + *s = mapper.map_get_content(**s).to_resolved().await?; } for s in catch_all_sources.iter_mut() { - *s = mapper.map_get_content(*s); + *s = mapper.map_get_content(**s).to_resolved().await?; } for s in fallback_sources.iter_mut() { - *s = mapper.map_get_content(*s); + *s = mapper.map_get_content(**s).to_resolved().await?; } for s in not_found_sources.iter_mut() { - *s = mapper.map_get_content(*s); + *s = mapper.map_get_content(**s).to_resolved().await?; } for r in static_segments.values_mut() { - *r = r.map_routes(mapper); + *r = r.map_routes(mapper).to_resolved().await?; } for r in dynamic_segments.iter_mut() { *r = r.map_routes(mapper).to_resolved().await?; From 01a592cca0f1e9c4e339326daeba8dae3e558efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:33:50 +0900 Subject: [PATCH 31/59] Fix more --- turbopack/crates/turbopack-dev-server/src/introspect/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs index 0e2b30eff3f71..e0bc65299da53 100644 --- a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs @@ -89,7 +89,7 @@ impl ContentSource for IntrospectionSource { impl GetContentSourceContent for IntrospectionSource { #[turbo_tasks::function] async fn get( - self: Vc, + self: ResolvedVc, path: RcStr, _data: turbo_tasks::Value, ) -> Result> { @@ -100,12 +100,12 @@ impl GetContentSourceContent for IntrospectionSource { if roots.len() == 1 { *roots.iter().next().unwrap() } else { - Vc::upcast(self) + ResolvedVc::upcast(self) } } else { parse_json_with_source_context(path)? }; - let internal_ty = Vc::debug_identifier(introspectable).await?; + let internal_ty = Vc::debug_identifier(*introspectable).await?; fn str_or_err(s: &Result>) -> Cow<'_, str> { s.as_ref().map_or_else( |e| Cow::<'_, str>::Owned(format!("ERROR: {:?}", e)), From bd04ea482b760eb8094aa2d6b978b3a8cd68c67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:34:02 +0900 Subject: [PATCH 32/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/router.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index 5252a4e0981fe..58f9fc2786d70 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -129,8 +129,8 @@ struct PrefixedRouterContentSourceMapper { impl MapGetContentSourceContent for PrefixedRouterContentSourceMapper { #[turbo_tasks::function] fn map_get_content( - self: Vc, - get_content: Vc>, + self: ResolvedVc, + get_content: ResolvedVc>, ) -> Vc> { Vc::upcast( PrefixedRouterGetContentSourceContent { From 6071f8b79d7a0b62a6d7eacb4ce3c48b83b94cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:36:59 +0900 Subject: [PATCH 33/59] Fix more --- .../turbopack-dev-server/src/source/conditional.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index b4811377daed0..2cda6ff66e5eb 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -47,15 +47,18 @@ impl ConditionalContentSource { #[turbo_tasks::value_impl] impl ContentSource for ConditionalContentSource { #[turbo_tasks::function] - async fn get_routes(self: Vc) -> Result> { + async fn get_routes(self: ResolvedVc) -> Result> { let this = self.await?; Ok(if !*this.activated.get() { this.activator.get_routes().map_routes(Vc::upcast( ConditionalContentSourceMapper { source: self }.cell(), )) } else { - Vc::::cell(vec![this.activator.get_routes(), this.action.get_routes()]) - .merge() + Vc::::cell(vec![ + this.activator.get_routes().to_resolved().await?, + this.action.get_routes().to_resolved().await?, + ]) + .merge() }) } @@ -75,7 +78,7 @@ impl MapGetContentSourceContent for ConditionalContentSourceMapper { #[turbo_tasks::function] fn map_get_content( &self, - get_content: Vc>, + get_content: ResolvedVc>, ) -> Vc> { Vc::upcast( ActivateOnGetContentSource { From 4dcd17e2a8e9a19c4aeff08ea978a4f3b1ed44d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:37:51 +0900 Subject: [PATCH 34/59] Fix more --- .../crates/turbopack-dev-server/src/source/conditional.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 2cda6ff66e5eb..4753c30933018 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -139,10 +139,10 @@ impl Introspectable for ConditionalContentSource { async fn children(&self) -> Result> { Ok(Vc::cell( [ - Vc::try_resolve_sidecast::>(self.activator) + ResolvedVc::try_sidecast::>(self.activator) .await? .map(|i| (activator_key(), i)), - Vc::try_resolve_sidecast::>(self.action) + ResolvedVc::try_sidecast::>(self.action) .await? .map(|i| (action_key(), i)), ] From 6721f8dbaf6685fa446c61772fa554686769034b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:52:59 +0900 Subject: [PATCH 35/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/conditional.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 4753c30933018..2764008a84600 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -127,7 +127,7 @@ impl Introspectable for ConditionalContentSource { #[turbo_tasks::function] async fn title(&self) -> Result> { if let Some(activator) = - Vc::try_resolve_sidecast::>(self.activator).await? + ResolvedVc::try_sidecast::>(self.activator).await? { Ok(activator.title()) } else { From ae846813dff0d3efd9484f72ae6f0c8e9dc85536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:54:51 +0900 Subject: [PATCH 36/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/mod.rs | 2 +- .../crates/turbopack-dev-server/src/source/static_assets.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/mod.rs b/turbopack/crates/turbopack-dev-server/src/source/mod.rs index 3f872bb059afe..2d42a299d7a24 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/mod.rs @@ -124,7 +124,7 @@ impl ContentSourceContent { ) -> Vc { ContentSourceContent::Static( StaticContent { - content: *content, + content, status_code: 200, headers: HeaderList::empty(), } diff --git a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs index 096ed13cc0548..1a6ed945168d3 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs @@ -76,7 +76,7 @@ impl ContentSource for StaticAssetsContentSource { async fn get_routes(&self) -> Result> { let prefix = self.prefix.await?; let prefix = BaseSegment::from_static_pathname(prefix.as_str()).collect::>(); - Ok(get_routes_from_directory(self.dir).with_prepended_base(prefix)) + Ok(get_routes_from_directory(*self.dir).with_prepended_base(prefix)) } } @@ -88,7 +88,7 @@ struct StaticAssetsContentSourceItem { #[turbo_tasks::value_impl] impl StaticAssetsContentSourceItem { #[turbo_tasks::function] - pub fn new(path: Vc) -> Vc { + pub fn new(path: ResolvedVc) -> Vc { StaticAssetsContentSourceItem { path }.cell() } } From e6d527910b3ed5ac52c16066259d40fc9852c109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:56:03 +0900 Subject: [PATCH 37/59] Fix more --- .../crates/turbopack-dev-server/src/source/static_assets.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs index 1a6ed945168d3..ae84cd64b3333 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs @@ -97,7 +97,7 @@ impl StaticAssetsContentSourceItem { impl GetContentSourceContent for StaticAssetsContentSourceItem { #[turbo_tasks::function] fn get(&self, _path: RcStr, _data: Value) -> Vc { - let content = Vc::upcast::>(FileSource::new(self.path)).content(); + let content = Vc::upcast::>(FileSource::new(*self.path)).content(); ContentSourceContent::static_content(content.versioned()) } } From 757a1255e967edf410c6906c16fb1d036f4de3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:57:59 +0900 Subject: [PATCH 38/59] Fix more --- .../crates/turbopack-dev-server/src/source/static_assets.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs index ae84cd64b3333..5e90c6c183a69 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{ResolvedVc, Value, Vc}; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Value, Vc}; use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemPath}; use turbopack_core::{ asset::Asset, @@ -66,7 +66,9 @@ async fn get_routes_from_directory(dir: Vc) -> Result None, }) - .collect(); + .map(|v| async move { v.to_resolved().await }) + .try_join() + .await?; Ok(Vc::::cell(routes).merge()) } From 3033b503eeff08af0a565442b4e3ad5d26813259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 12:59:25 +0900 Subject: [PATCH 39/59] Fix more --- .../src/source/wrapping_source.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 783154c74cd99..19e128a86ce40 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::{ResolvedVc, Value, Vc}; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Value, Vc}; use super::{ ContentSourceContent, ContentSourceData, ContentSourceDataVary, GetContentSourceContent, @@ -68,12 +68,16 @@ impl GetContentSourceContent for WrappedGetContentSourceContent { .await? .iter() .map(|s| { - Vc::upcast(WrappedGetContentSourceContent::new( - *s, - self.processor, - )) + Vc::upcast::>( + WrappedGetContentSourceContent::new( + **s, + *self.processor, + ), + ) }) - .collect(), + .map(|v| async move { v.to_resolved().await }) + .try_join() + .await?, ), }, }, From cdfe9e793424d08921d9328a91ee7ca5d84891c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:00:27 +0900 Subject: [PATCH 40/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/route_tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 054ba1bcf3a55..7837f137cea6e 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -335,7 +335,7 @@ impl RouteTree { match selector_segment { BaseSegment::Static(value) => Ok(RouteTree { base, - static_segments: fxindexmap! { value => inner.cell() }, + static_segments: fxindexmap! { value => inner.resolved_cell() }, ..Default::default() } .cell()), From 0da9eab88228a4615eca13cc964587b1079277f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:00:50 +0900 Subject: [PATCH 41/59] Fix more --- turbopack/crates/turbopack-dev-server/src/introspect/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs index e0bc65299da53..cafa3bc4f9918 100644 --- a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs @@ -36,7 +36,7 @@ impl Introspectable for IntrospectionSource { #[turbo_tasks::function] fn children(&self) -> Vc { let name = Vc::cell("root".into()); - Vc::cell(self.roots.iter().map(|root| (name, *root)).collect()) + Vc::cell(self.roots.iter().map(|root| (name, **root)).collect()) } } From 2abafd5da8ad84c5c2f10235fdff223ddd09a029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:03:42 +0900 Subject: [PATCH 42/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/router.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index 58f9fc2786d70..4b7c0ea342225 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -28,9 +28,9 @@ pub struct PrefixedRouterContentSource { impl PrefixedRouterContentSource { #[turbo_tasks::function] pub fn new( - prefix: Vc, - routes: Vec<(RcStr, Vc>)>, - fallback: Vc>, + prefix: ResolvedVc, + routes: Vec<(RcStr, ResolvedVc>)>, + fallback: ResolvedVc>, ) -> Vc { PrefixedRouterContentSource { prefix, From 5a1d959cc159b417b6c3a20abacb87206abfdf03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:04:33 +0900 Subject: [PATCH 43/59] Fix more --- .../crates/turbopack-dev-server/src/source/router.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index 4b7c0ea342225..4c448aba2f0b2 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -42,8 +42,8 @@ impl PrefixedRouterContentSource { } fn get_children( - routes: &[(RcStr, Vc>)], - fallback: &Vc>, + routes: &[(RcStr, ResolvedVc>)], + fallback: &ResolvedVc>, ) -> Vc { Vc::cell( routes @@ -55,8 +55,8 @@ fn get_children( } async fn get_introspection_children( - routes: &[(RcStr, Vc>)], - fallback: &Vc>, + routes: &[(RcStr, ResolvedVc>)], + fallback: &ResolvedVc>, ) -> Result> { Ok(Vc::cell( routes From dda53efcf76a691e4cadc0aa7710aec6849cb9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:20:07 +0900 Subject: [PATCH 44/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/router.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index 4c448aba2f0b2..edaf50135766f 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -64,7 +64,7 @@ async fn get_introspection_children( .cloned() .chain(std::iter::once((RcStr::default(), *fallback))) .map(|(path, source)| async move { - Ok(Vc::try_resolve_sidecast::>(source) + Ok(ResolvedVc::try_sidecast::>(source) .await? .map(|i| (Vc::cell(path), i))) }) From 84b4f36a456c99f8210721f1e29267dc06f2c1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:20:15 +0900 Subject: [PATCH 45/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/combined.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/combined.rs b/turbopack/crates/turbopack-dev-server/src/source/combined.rs index 211d99ea4db8c..00bddff408f75 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/combined.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/combined.rs @@ -19,7 +19,7 @@ pub struct CombinedContentSource { } impl CombinedContentSource { - pub fn new(sources: Vec>>) -> Vc { + pub fn new(sources: Vec>>) -> Vc { CombinedContentSource { sources }.cell() } } From 8e40e502bae1dec46a989ddd467ec1d564145dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:20:21 +0900 Subject: [PATCH 46/59] Fix more --- turbopack/crates/turbopack-dev-server/src/update/stream.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/update/stream.rs b/turbopack/crates/turbopack-dev-server/src/update/stream.rs index 73cb8d3d4959e..b7a2594333b91 100644 --- a/turbopack/crates/turbopack-dev-server/src/update/stream.rs +++ b/turbopack/crates/turbopack-dev-server/src/update/stream.rs @@ -58,7 +58,7 @@ async fn get_update_stream_item( FatalStreamIssue { resource, description: StyledString::Text(format!("{}", PrettyPrintError(&e)).into()) - .cell(), + .resolved_cell(), } .cell() .into_plain(OptionIssueProcessingPathItems::none()) From 70ef0620d1f373aa25e91841394e72014b09f5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 13:21:57 +0900 Subject: [PATCH 47/59] Fix more --- .../crates/turbopack-dev-server/src/source/conditional.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 2764008a84600..400705bad41bb 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -141,10 +141,10 @@ impl Introspectable for ConditionalContentSource { [ ResolvedVc::try_sidecast::>(self.activator) .await? - .map(|i| (activator_key(), i)), + .map(|i| (activator_key(), *i)), ResolvedVc::try_sidecast::>(self.action) .await? - .map(|i| (action_key(), i)), + .map(|i| (action_key(), *i)), ] .into_iter() .flatten() From 208515c093310ba9e35605ef8ca43cf80f38d081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:13:51 +0900 Subject: [PATCH 48/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index 54f9448e617bd..a032862795d0e 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -230,7 +230,7 @@ impl ContentSource for AssetGraphContentSource { )), ) }) - .map(|v| async move { v.await }) + .map(|v| async move { v.to_resolved().await }) .try_join() .await?; Ok(Vc::::cell(routes).merge()) From e233d0543decbef5dc97ddafd05513da1f0a8312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:17:31 +0900 Subject: [PATCH 49/59] Fix more --- .../turbopack-dev-server/src/introspect/mod.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs index cafa3bc4f9918..e69b0104aee4f 100644 --- a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs @@ -76,12 +76,16 @@ impl Display for HtmlStringEscaped { #[turbo_tasks::value_impl] impl ContentSource for IntrospectionSource { #[turbo_tasks::function] - fn get_routes(self: Vc) -> Vc { - Vc::::cell(vec![ - RouteTree::new_route(Vec::new(), RouteType::Exact, Vc::upcast(self)), - RouteTree::new_route(Vec::new(), RouteType::CatchAll, Vc::upcast(self)), + async fn get_routes(self: Vc) -> Result> { + Ok(Vc::::cell(vec![ + RouteTree::new_route(Vec::new(), RouteType::Exact, Vc::upcast(self)) + .to_resolved() + .await?, + RouteTree::new_route(Vec::new(), RouteType::CatchAll, Vc::upcast(self)) + .to_resolved() + .await?, ]) - .merge() + .merge()) } } From 289ffdd8a5dbaa1114d5a5560c0450d25a321416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:18:19 +0900 Subject: [PATCH 50/59] Fix more --- .../turbopack-dev-server/src/source/combined.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/combined.rs b/turbopack/crates/turbopack-dev-server/src/source/combined.rs index 00bddff408f75..c0198ac528a49 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/combined.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/combined.rs @@ -27,9 +27,14 @@ impl CombinedContentSource { #[turbo_tasks::value_impl] impl ContentSource for CombinedContentSource { #[turbo_tasks::function] - fn get_routes(&self) -> Vc { - let all_routes = self.sources.iter().map(|s| s.get_routes()).collect(); - Vc::::cell(all_routes).merge() + async fn get_routes(&self) -> Result> { + let all_routes = self + .sources + .iter() + .map(|s| async move { s.get_routes().to_resolved().await }) + .try_join() + .await?; + Ok(Vc::::cell(all_routes).merge()) } #[turbo_tasks::function] From 10bdb65fcffac2e979d4864e13d278f980caaf58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:18:41 +0900 Subject: [PATCH 51/59] Fix more --- .../crates/turbopack-dev-server/src/source/issue_context.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index 2c98f8f79aea7..4fbcbbc0d4e96 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -58,7 +58,7 @@ impl ContentSource for IssueFilePathContentSource { let routes = this .source .get_routes() - .issue_file_path(*this.file_path, &*this.description) + .issue_file_path(this.file_path.map(|v| *v), &*this.description) .await?; Ok(routes.map_routes(Vc::upcast( IssueContextContentSourceMapper { source: self }.cell(), @@ -107,7 +107,7 @@ impl GetContentSourceContent for IssueContextGetContentSourceContent { let result = self .get_content .vary() - .issue_file_path(*source.file_path, &*source.description) + .issue_file_path(source.file_path.map(|v| *v), &*source.description) .await?; Ok(result) } @@ -122,7 +122,7 @@ impl GetContentSourceContent for IssueContextGetContentSourceContent { let result = self .get_content .get(path, data) - .issue_file_path(*source.file_path, &*source.description) + .issue_file_path(source.file_path.map(|v| *v), &*source.description) .await?; Ok(result) } From 2242a8768b4c749a62bbe0064e80e8bfa1b7e374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:18:58 +0900 Subject: [PATCH 52/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/mod.rs b/turbopack/crates/turbopack-dev-server/src/source/mod.rs index 2d42a299d7a24..258199cce9024 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/mod.rs @@ -141,9 +141,9 @@ impl ContentSourceContent { ) -> Vc { ContentSourceContent::Static( StaticContent { - content: *content, + content, status_code, - headers: *headers, + headers, } .resolved_cell(), ) From 5abde8ad0f046494612cc06ba42454a8684ed4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:28:49 +0900 Subject: [PATCH 53/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/combined.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/combined.rs b/turbopack/crates/turbopack-dev-server/src/source/combined.rs index c0198ac528a49..a3409d858c8ad 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/combined.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/combined.rs @@ -58,7 +58,7 @@ impl Introspectable for CombinedContentSource { .map(|&source| async move { Ok( if let Some(source) = - Vc::try_resolve_sidecast::>(source).await? + ResolvedVc::try_sidecast::>(source).await? { Some(source.title().await?) } else { From b144a4a7571216287e75f92e618ad719f2d170f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:29:23 +0900 Subject: [PATCH 54/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/resolve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/resolve.rs b/turbopack/crates/turbopack-dev-server/src/source/resolve.rs index 33c0ee65f4f99..fa79fd00683d7 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/resolve.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/resolve.rs @@ -146,7 +146,7 @@ async fn request_to_data( data.original_url = Some(original_request.uri.to_string().into()); } if vary.body { - data.body = Some(request.body.clone().into()); + data.body = Some(request.body.clone().resolved_cell()); } if vary.raw_query { data.raw_query = Some(request.uri.query().unwrap_or("").into()); From 2174ccb8d2b44c3c7986495c981db2a0678ee1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:29:55 +0900 Subject: [PATCH 55/59] Fix more --- turbopack/crates/turbopack-dev-server/src/source/router.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index edaf50135766f..59b586c3d51e5 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -66,7 +66,7 @@ async fn get_introspection_children( .map(|(path, source)| async move { Ok(ResolvedVc::try_sidecast::>(source) .await? - .map(|i| (Vc::cell(path), i))) + .map(|i| (Vc::cell(path), *i))) }) .try_join() .await? @@ -108,7 +108,9 @@ impl ContentSource for PrefixedRouterContentSource { Ok(Vc::::cell( inner_trees .chain(once(self.fallback.get_routes())) - .collect(), + .map(|v| async move { v.to_resolved().await }) + .try_join() + .await?, ) .merge()) } From 397f4968927d2d5ba9a06fa7229dccccae07975d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:30:09 +0900 Subject: [PATCH 56/59] Fix more --- .../crates/turbopack-dev-server/src/source/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/turbopack/crates/turbopack-dev-server/src/source/mod.rs b/turbopack/crates/turbopack-dev-server/src/source/mod.rs index 258199cce9024..18b7cb0c90676 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/mod.rs @@ -119,18 +119,18 @@ impl GetContentSourceContent for ContentSourceContent { #[turbo_tasks::value_impl] impl ContentSourceContent { #[turbo_tasks::function] - pub fn static_content( + pub async fn static_content( content: ResolvedVc>, - ) -> Vc { - ContentSourceContent::Static( + ) -> Result> { + Ok(ContentSourceContent::Static( StaticContent { content, status_code: 200, - headers: HeaderList::empty(), + headers: HeaderList::empty().to_resolved().await?, } .resolved_cell(), ) - .cell() + .cell()) } #[turbo_tasks::function] From d3e26afb35b706cdd08abd2921ba8812c04b57d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:30:44 +0900 Subject: [PATCH 57/59] Fix more --- turbopack/crates/turbopack-node/src/render/node_api_source.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-node/src/render/node_api_source.rs b/turbopack/crates/turbopack-node/src/render/node_api_source.rs index 1ef5dd0cacbca..06377f26e9003 100644 --- a/turbopack/crates/turbopack-node/src/render/node_api_source.rs +++ b/turbopack/crates/turbopack-node/src/render/node_api_source.rs @@ -150,7 +150,7 @@ impl GetContentSourceContent for NodeApiContentSource { data: Some(self.render_data.await?), } .cell(), - *body, + **body, self.debug, ) .to_resolved() From ceb354f7c77dfa734287f1c8c1e3e1f00dd72b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:31:01 +0900 Subject: [PATCH 58/59] Fix more --- .../crates/turbopack-node/src/render/rendered_source.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-node/src/render/rendered_source.rs b/turbopack/crates/turbopack-node/src/render/rendered_source.rs index b05ce9d12abfd..8aaad3a3617dc 100644 --- a/turbopack/crates/turbopack-node/src/render/rendered_source.rs +++ b/turbopack/crates/turbopack-node/src/render/rendered_source.rs @@ -68,12 +68,12 @@ pub fn create_node_rendered_source( render_data, debug, } - .cell(); + .resolved_cell(); Vc::upcast(ConditionalContentSource::new( - Vc::upcast(source), + Vc::upcast(*source), Vc::upcast( LazyInstantiatedContentSource { - get_source: Vc::upcast(source), + get_source: ResolvedVc::upcast(source), } .cell(), ), From fe4b0bf7b00a17e85763dc9dba654e13884f0334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 27 Nov 2024 11:38:04 +0900 Subject: [PATCH 59/59] Fix more --- turbopack/crates/turbopack-cli/src/dev/mod.rs | 27 +++++++++++-------- .../turbopack-cli/src/dev/web_entry_source.rs | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/turbopack/crates/turbopack-cli/src/dev/mod.rs b/turbopack/crates/turbopack-cli/src/dev/mod.rs index 9d92107093c0e..00b4c1a90ae0c 100644 --- a/turbopack/crates/turbopack-cli/src/dev/mod.rs +++ b/turbopack/crates/turbopack-cli/src/dev/mod.rs @@ -14,7 +14,7 @@ use owo_colors::OwoColorize; use turbo_rcstr::RcStr; use turbo_tasks::{ util::{FormatBytes, FormatDuration}, - TransientInstance, TurboTasks, UpdateInfo, Value, Vc, + ResolvedVc, TransientInstance, TurboTasks, UpdateInfo, Value, Vc, }; use turbo_tasks_fs::FileSystem; use turbo_tasks_malloc::TurboMalloc; @@ -301,23 +301,28 @@ async fn source( eager_compile, NodeEnv::Development.cell(), browserslist_query, + ) + .to_resolved() + .await?; + let static_source = ResolvedVc::upcast( + StaticAssetsContentSource::new(Default::default(), project_path.join("public".into())) + .to_resolved() + .await?, ); - let static_source = Vc::upcast(StaticAssetsContentSource::new( - Default::default(), - project_path.join("public".into()), - )); - let main_source = CombinedContentSource::new(vec![static_source, web_source]); - let introspect = Vc::upcast( + let main_source = CombinedContentSource::new(vec![static_source, web_source]) + .to_resolved() + .await?; + let introspect = ResolvedVc::upcast( IntrospectionSource { - roots: HashSet::from([Vc::upcast(main_source)]), + roots: HashSet::from([ResolvedVc::upcast(main_source)]), } - .cell(), + .resolved_cell(), ); - let main_source = Vc::upcast(main_source); + let main_source = ResolvedVc::upcast(main_source); Ok(Vc::upcast(PrefixedRouterContentSource::new( Default::default(), vec![("__turbopack__".into(), introspect)], - main_source, + *main_source, ))) } diff --git a/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs b/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs index 0dfcce7d295d0..a105030c24a62 100644 --- a/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs +++ b/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs @@ -157,7 +157,7 @@ pub async fn create_web_entry_source( .await?; let entry_asset = Vc::upcast(DevHtmlAsset::new( - server_root.join("index.html".into()), + server_root.join("index.html".into()).to_resolved().await?, entries, ));