Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Nov 29, 2024
1 parent 6467f21 commit cde5aa6
Show file tree
Hide file tree
Showing 121 changed files with 857 additions and 560 deletions.
10 changes: 5 additions & 5 deletions crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,10 +1457,10 @@ impl AppEndpoint {
let evaluatable = ResolvedVc::try_sidecast(app_entry.rsc_entry)
.await?
.context("Entry module must be evaluatable")?;
evaluatable_assets.push(*evaluatable);
evaluatable_assets.push(evaluatable);

if let Some(server_action_manifest_loader) = server_action_manifest_loader {
evaluatable_assets.push(server_action_manifest_loader);
evaluatable_assets.push(server_action_manifest_loader.to_resolved().await?);
}

{
Expand All @@ -1483,7 +1483,7 @@ impl AppEndpoint {
this.app_project.rsc_runtime_entries().await?.clone_value();

if let Some(server_action_manifest_loader) = server_action_manifest_loader {
evaluatable_assets.push(server_action_manifest_loader);
evaluatable_assets.push(server_action_manifest_loader.to_resolved().await?);
}

let EntryChunkGroupResult {
Expand Down Expand Up @@ -1511,7 +1511,7 @@ impl AppEndpoint {
.await?;

current_chunks = current_chunks
.concatenate(chunk_group.assets)
.concatenate(*chunk_group.assets)
.resolve()
.await?;
current_availability_info = chunk_group.availability_info;
Expand Down Expand Up @@ -1545,7 +1545,7 @@ impl AppEndpoint {
.await?;

current_chunks = current_chunks
.concatenate(chunk_group.assets)
.concatenate(*chunk_group.assets)
.resolve()
.await?;
current_availability_info = chunk_group.availability_info;
Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/dynamic_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub(crate) async fn collect_evaluated_chunk_group(
if let Some(module) = Vc::try_resolve_downcast::<Box<dyn EvaluatableAsset>>(module).await? {
Ok(chunking_context.evaluated_chunk_group_assets(
module.ident(),
Vc::cell(vec![Vc::upcast(module)]),
Vc::cell(vec![ResolvedVc::upcast(module.to_resolved().await?)]),
Value::new(AvailabilityInfo::Root),
))
} else {
Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl InstrumentationEndpoint {
let Some(evaluatable) = ResolvedVc::try_sidecast(module).await? else {
bail!("Entry module must be evaluatable");
};
evaluatable_assets.push(*evaluatable);
evaluatable_assets.push(evaluatable);

let edge_chunking_context = this.project.edge_chunking_context(false);

Expand Down
7 changes: 4 additions & 3 deletions crates/next-api/src/versioned_content_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ impl VersionedContentMap {
self: Vc<Self>,
path: Vc<FileSystemPath>,
) -> Result<Vc<OptionVersionedContent>> {
Ok(Vc::cell(
(*self.get_asset(path).await?).map(|a| a.versioned_content()),
))
Ok(Vc::cell(match (*self.get_asset(path).await?) {
Some(asset) => Some(asset.versioned_content().to_resolved().await?),
None => None,
}))
}

#[turbo_tasks::function]
Expand Down
13 changes: 9 additions & 4 deletions crates/next-core/src/app_segment_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ impl Issue for NextSegmentConfigParsingIssue {
format from which some properties can be statically parsed at compiled-time."
.into(),
)
.cell(),
.resolved_cell(),
))
}

#[turbo_tasks::function]
fn detail(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(*self.detail))
Vc::cell(Some(self.detail))
}

#[turbo_tasks::function]
Expand All @@ -221,8 +221,13 @@ impl Issue for NextSegmentConfigParsingIssue {
}

#[turbo_tasks::function]
fn source(&self) -> Vc<OptionIssueSource> {
Vc::cell(Some(self.source.resolve_source_map(self.ident.path())))
async fn source(&self) -> Result<Vc<OptionIssueSource>> {
Ok(Vc::cell(Some(
self.source
.resolve_source_map(self.ident.path())
.to_resolved()
.await?,
)))
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/src/app_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,6 @@ impl Issue for DirectoryTreeIssue {

#[turbo_tasks::function]
fn description(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(*self.message))
Vc::cell(Some(self.message))
}
}
10 changes: 6 additions & 4 deletions crates/next-core/src/hmr_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ impl Module for HmrEntryModule {
}

#[turbo_tasks::function]
fn references(&self) -> Vc<ModuleReferences> {
Vc::cell(vec![Vc::upcast(HmrEntryModuleReference::new(Vc::upcast(
*self.module,
)))])
async fn references(&self) -> Result<Vc<ModuleReferences>> {
Ok(Vc::cell(vec![ResolvedVc::upcast(
HmrEntryModuleReference::new(Vc::upcast(*self.module))
.to_resolved()
.await?,
)]))
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/next-core/src/next_app/app_client_references_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pub async fn get_app_client_references_chunks(
let client_chunk_group = client_chunk_group.await?;

let client_chunks =
current_client_chunks.concatenate(client_chunk_group.assets);
current_client_chunks.concatenate(*client_chunk_group.assets);
let client_chunks = client_chunks.to_resolved().await?;

if is_layout {
Expand All @@ -286,7 +286,7 @@ pub async fn get_app_client_references_chunks(
if let Some(ssr_chunk_group) = ssr_chunk_group {
let ssr_chunk_group = ssr_chunk_group.await?;

let ssr_chunks = current_ssr_chunks.concatenate(ssr_chunk_group.assets);
let ssr_chunks = current_ssr_chunks.concatenate(*ssr_chunk_group.assets);
let ssr_chunks = ssr_chunks.to_resolved().await?;

if is_layout {
Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/src/next_app/app_client_shared_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub async fn get_app_client_shared_chunk_group(
) -> Result<Vc<ChunkGroupResult>> {
if app_client_runtime_entries.await?.is_empty() {
return Ok(ChunkGroupResult {
assets: OutputAssets::empty(),
assets: OutputAssets::empty().to_resolved().await?,
availability_info: AvailabilityInfo::Root,
}
.cell());
Expand Down
4 changes: 2 additions & 2 deletions crates/next-core/src/next_app/include_modules_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ impl Module for IncludeModulesModule {
self.modules
.iter()
.map(|&module| async move {
Ok(Vc::upcast(
IncludedModuleReference::new(*module).resolve().await?,
Ok(ResolvedVc::upcast(
IncludedModuleReference::new(*module).to_resolved().await?,
))
})
.try_join()
Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/src/next_client/runtime_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl RuntimeEntry {
if let Some(entry) =
ResolvedVc::try_downcast::<Box<dyn EvaluatableAsset>>(module).await?
{
runtime_entries.push(*entry);
runtime_entries.push(entry);
} else {
bail!(
"runtime reference resolved to an asset ({}) that cannot be evaluated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,27 @@ impl Module for EcmascriptClientReferenceModule {
}

#[turbo_tasks::function]
fn references(&self) -> Vc<ModuleReferences> {
async fn references(&self) -> Result<Vc<ModuleReferences>> {
let client_module = ResolvedVc::upcast(self.client_module);
let ssr_module = ResolvedVc::upcast(self.ssr_module);
Vc::cell(vec![
Vc::upcast(SingleModuleReference::new(
*client_module,
ecmascript_client_reference_client_ref_modifier(),
)),
Vc::upcast(SingleModuleReference::new(
*ssr_module,
ecmascript_client_reference_ssr_ref_modifier(),
)),
])
Ok(Vc::cell(vec![
ResolvedVc::upcast(
SingleModuleReference::new(
*client_module,
ecmascript_client_reference_client_ref_modifier(),
)
.to_resolved()
.await?,
),
ResolvedVc::upcast(
SingleModuleReference::new(
*ssr_module,
ecmascript_client_reference_ssr_ref_modifier(),
)
.to_resolved()
.await?,
),
]))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,18 @@ impl Module for EcmascriptClientReferenceProxyModule {
.await?
.iter()
.copied()
.chain(once(Vc::upcast(SingleModuleReference::new(
Vc::upcast(EcmascriptClientReferenceModule::new(
**server_module_ident,
**client_module,
**ssr_module,
)),
client_reference_description(),
))))
.chain(once(ResolvedVc::upcast(
SingleModuleReference::new(
Vc::upcast(EcmascriptClientReferenceModule::new(
**server_module_ident,
**client_module,
**ssr_module,
)),
client_reference_description(),
)
.to_resolved()
.await?,
)))
.collect();

Ok(Vc::cell(references))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Transition for NextEcmascriptClientReferenceTransition {
.replace("next/dist/esm/", "next/dist/")
.into(),
);
Vc::upcast(FileSource::new_with_query(path, ident_ref.query))
Vc::upcast(FileSource::new_with_query(path, *ident_ref.query))
} else {
source
};
Expand Down
4 changes: 3 additions & 1 deletion crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,8 @@ impl Issue for OutdatedConfigIssue {

#[turbo_tasks::function]
fn description(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(StyledString::Text(self.description.clone()).cell()))
Vc::cell(Some(
StyledString::Text(self.description.clone()).resolved_cell(),
))
}
}
2 changes: 1 addition & 1 deletion crates/next-core/src/next_font/issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ impl Issue for NextFontIssue {

#[turbo_tasks::function]
fn description(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(*self.description))
Vc::cell(Some(self.description))
}
}
2 changes: 1 addition & 1 deletion crates/next-core/src/next_server/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ impl Issue for ExternalizeIssue {
]),
StyledString::Line(self.reason.clone()),
])
.cell(),
.resolved_cell(),
)))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ impl Module for NextServerComponentModule {
}

#[turbo_tasks::function]
fn references(&self) -> Vc<ModuleReferences> {
Vc::cell(vec![Vc::upcast(NextServerComponentModuleReference::new(
Vc::upcast(*self.module),
))])
async fn references(&self) -> Result<Vc<ModuleReferences>> {
Ok(Vc::cell(vec![ResolvedVc::upcast(
NextServerComponentModuleReference::new(Vc::upcast(*self.module))
.to_resolved()
.await?,
)]))
}

#[turbo_tasks::function]
Expand Down Expand Up @@ -112,11 +114,9 @@ impl ChunkableModule for NextServerComponentModule {
impl EcmascriptChunkPlaceable for NextServerComponentModule {
#[turbo_tasks::function]
async fn get_exports(&self) -> Result<Vc<EcmascriptExports>> {
let module_reference = ResolvedVc::upcast(
NextServerComponentModuleReference::new(Vc::upcast(*self.module))
.to_resolved()
.await?,
);
let module_reference = Vc::upcast(NextServerComponentModuleReference::new(Vc::upcast(
*self.module,
)));

let mut exports = BTreeMap::new();
exports.insert(
Expand Down
8 changes: 4 additions & 4 deletions crates/next-core/src/next_shared/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Issue for InvalidImportModuleIssue {
.map(|v| StyledString::Text(format!("{}\n", v).into()))
.collect::<Vec<StyledString>>(),
)
.cell(),
.resolved_cell(),
)))
}
}
Expand Down Expand Up @@ -252,7 +252,7 @@ impl AfterResolvePlugin for NextExternalResolvePlugin {
ty: ExternalType::CommonJs,
traced: ExternalTraced::Traced,
})
.into(),
.resolved_cell(),
)))
}
}
Expand Down Expand Up @@ -329,7 +329,7 @@ impl AfterResolvePlugin for NextNodeSharedRuntimeResolvePlugin {
ResolveResult::source(ResolvedVc::upcast(
FileSource::new(new_path).to_resolved().await?,
))
.cell(),
.resolved_cell(),
)))
}
}
Expand Down Expand Up @@ -431,7 +431,7 @@ impl AfterResolvePlugin for NextSharedRuntimeResolvePlugin {
ResolveResult::source(ResolvedVc::upcast(
FileSource::new(new_path).to_resolved().await?,
))
.cell(),
.resolved_cell(),
)))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl Issue for PageStaticInfoIssue {
.map(|v| StyledString::Text(format!("{}\n", v).into()))
.collect::<Vec<StyledString>>(),
)
.cell(),
.resolved_cell(),
))
}
}
2 changes: 1 addition & 1 deletion crates/next-core/src/next_shared/webpack_rules/babel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ impl Issue for BabelIssue {

#[turbo_tasks::function]
fn description(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(*self.description))
Vc::cell(Some(self.description))
}
}
4 changes: 2 additions & 2 deletions crates/next-core/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ impl Issue for NextSourceConfigParsingIssue {
format from which some properties can be statically parsed at compiled-time."
.into(),
)
.cell(),
.resolved_cell(),
))
}

#[turbo_tasks::function]
fn detail(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(*self.detail))
Vc::cell(Some(self.detail))
}
}

Expand Down
4 changes: 2 additions & 2 deletions turbopack/crates/turbo-tasks-fetch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ impl Issue for FetchIssue {
}
FetchErrorKind::Other => format!("There was an issue requesting {}", url).into(),
})
.cell(),
.resolved_cell(),
)))
}

#[turbo_tasks::function]
fn detail(&self) -> Vc<OptionStyledString> {
Vc::cell(Some(*self.detail))
Vc::cell(Some(self.detail))
}
}
Loading

0 comments on commit cde5aa6

Please sign in to comment.