Commit ccfe44d3 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

WIP

parent 7e638d8d
...@@ -26,8 +26,8 @@ use next_core::{ ...@@ -26,8 +26,8 @@ use next_core::{
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use turbo_tasks::{ use turbo_tasks::{
FxIndexMap, NonLocalValue, ReadRef, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Vc, FxIndexMap, NonLocalValue, ReadRef, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt,
debug::ValueDebugFormat, trace::TraceRawVcs, ValueDefault, Vc, debug::ValueDebugFormat, trace::TraceRawVcs,
}; };
use turbopack_core::{ use turbopack_core::{
chunk::{ chunk::{
...@@ -107,6 +107,23 @@ pub struct DynamicImportedChunks( ...@@ -107,6 +107,23 @@ pub struct DynamicImportedChunks(
>, >,
); );
#[turbo_tasks::value_impl]
impl DynamicImportedChunks {
#[turbo_tasks::function]
pub async fn concatenate(&self, other: Vc<Self>) -> Result<Vc<Self>> {
let mut chunks = self.0.clone();
chunks.extend(other.await?.iter().map(|(k, v)| (*k, *v)));
Ok(Vc::cell(chunks))
}
}
#[turbo_tasks::value_impl]
impl ValueDefault for DynamicImportedChunks {
#[turbo_tasks::function]
fn value_default() -> Vc<Self> {
Self::default().cell()
}
}
#[derive( #[derive(
Clone, PartialEq, Eq, ValueDebugFormat, Serialize, Deserialize, TraceRawVcs, NonLocalValue, Clone, PartialEq, Eq, ValueDebugFormat, Serialize, Deserialize, TraceRawVcs, NonLocalValue,
)] )]
......
...@@ -16,7 +16,8 @@ use rustc_hash::FxHashMap; ...@@ -16,7 +16,8 @@ use rustc_hash::FxHashMap;
use tracing::Instrument; use tracing::Instrument;
use turbo_rcstr::{RcStr, rcstr}; use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ use turbo_tasks::{
CollectiblesSource, FxIndexMap, FxIndexSet, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Vc, CollectiblesSource, FxIndexMap, FxIndexSet, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt,
ValueToString, Vc,
}; };
use turbo_tasks_fs::FileSystemPath; use turbo_tasks_fs::FileSystemPath;
use turbopack::css::{CssModuleAsset, ModuleCssAsset}; use turbopack::css::{CssModuleAsset, ModuleCssAsset};
...@@ -75,6 +76,25 @@ impl NextDynamicGraph { ...@@ -75,6 +76,25 @@ impl NextDynamicGraph {
async move { async move {
let data = &*self.data.await?; let data = &*self.data.await?;
let graph = &*self.graph.await?; let graph = &*self.graph.await?;
// println!(
// "get {:?} {} {:#?} {:#?} {:#?}",
// entry,
// entry.ident().to_string().await?,
// data.keys()
// .map(|m| m.ident().to_string())
// .try_join()
// .await?,
// graph
// .entry_modules()
// .map(|m| m.ident().to_string())
// .try_join()
// .await?,
// graph
// .enumerate_nodes()
// .map(|n| n.1.module().ident().to_string())
// .try_join()
// .await?
// );
#[derive(Clone, PartialEq, Eq)] #[derive(Clone, PartialEq, Eq)]
enum VisitState { enum VisitState {
......
This diff is collapsed.
...@@ -25,8 +25,8 @@ use crate::{ ...@@ -25,8 +25,8 @@ use crate::{
#[turbo_tasks::value] #[turbo_tasks::value]
pub struct PageSsrEntryModule { pub struct PageSsrEntryModule {
pub ssr_module: ResolvedVc<Box<dyn Module>>, pub ssr_module: ResolvedVc<Box<dyn Module>>,
pub app_module: Option<ResolvedVc<Box<dyn Module>>>, pub app_ssr_module: Option<ResolvedVc<Box<dyn Module>>>,
pub document_module: Option<ResolvedVc<Box<dyn Module>>>, pub document_ssr_module: Option<ResolvedVc<Box<dyn Module>>>,
} }
#[turbo_tasks::function] #[turbo_tasks::function]
...@@ -127,7 +127,7 @@ pub async fn create_page_ssr_entry_module( ...@@ -127,7 +127,7 @@ pub async fn create_page_ssr_entry_module(
let pages_structure_ref = pages_structure.await?; let pages_structure_ref = pages_structure.await?;
let (app_module, document_module) = if is_page { let (app_ssr_module, document_ssr_module) = if is_page {
// We process the document and app modules in the same context and reference type. // We process the document and app modules in the same context and reference type.
let document_module = process_global_item( let document_module = process_global_item(
*pages_structure_ref.document, *pages_structure_ref.document,
...@@ -184,8 +184,8 @@ pub async fn create_page_ssr_entry_module( ...@@ -184,8 +184,8 @@ pub async fn create_page_ssr_entry_module(
Ok(PageSsrEntryModule { Ok(PageSsrEntryModule {
ssr_module: ssr_module.to_resolved().await?, ssr_module: ssr_module.to_resolved().await?,
app_module, app_ssr_module,
document_module, document_ssr_module,
} }
.cell()) .cell())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment