Skip to content

Commit

Permalink
Merge branch 'canary' into cacheflightmanifest
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage authored Sep 26, 2024
2 parents ba1f2a5 + 0b926ff commit 853a2ac
Show file tree
Hide file tree
Showing 302 changed files with 8,070 additions and 7,490 deletions.
103 changes: 49 additions & 54 deletions crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,26 @@ impl AppProject {
}

#[turbo_tasks::function]
async fn client_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_client_module_options_context(
fn client_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_client_module_options_context(
self.project().project_path(),
self.project().execution_context(),
self.project().client_compile_time_info().environment(),
Value::new(self.client_ty()),
self.project().next_mode(),
self.project().next_config(),
))
)
}

#[turbo_tasks::function]
async fn client_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_client_resolve_options_context(
fn client_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_client_resolve_options_context(
self.project().project_path(),
Value::new(self.client_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
Expand All @@ -180,103 +180,101 @@ impl AppProject {
}

#[turbo_tasks::function]
async fn client_transition(self: Vc<Self>) -> Result<Vc<FullContextTransition>> {
fn client_transition(self: Vc<Self>) -> Vc<FullContextTransition> {
let module_context = self.client_module_context();
Ok(FullContextTransition::new(module_context))
FullContextTransition::new(module_context)
}

#[turbo_tasks::function]
async fn rsc_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_server_module_options_context(
fn rsc_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_server_module_options_context(
self.project().project_path(),
self.project().execution_context(),
Value::new(self.rsc_ty()),
self.project().next_mode(),
self.project().next_config(),
NextRuntime::NodeJs,
))
)
}

#[turbo_tasks::function]
async fn edge_rsc_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_server_module_options_context(
fn edge_rsc_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_server_module_options_context(
self.project().project_path(),
self.project().execution_context(),
Value::new(self.rsc_ty()),
self.project().next_mode(),
self.project().next_config(),
NextRuntime::Edge,
))
)
}

#[turbo_tasks::function]
async fn route_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_server_module_options_context(
fn route_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_server_module_options_context(
self.project().project_path(),
self.project().execution_context(),
Value::new(self.route_ty()),
self.project().next_mode(),
self.project().next_config(),
NextRuntime::NodeJs,
))
)
}

#[turbo_tasks::function]
async fn edge_route_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_server_module_options_context(
fn edge_route_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_server_module_options_context(
self.project().project_path(),
self.project().execution_context(),
Value::new(self.route_ty()),
self.project().next_mode(),
self.project().next_config(),
NextRuntime::Edge,
))
)
}

#[turbo_tasks::function]
async fn rsc_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_server_resolve_options_context(
fn rsc_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_server_resolve_options_context(
self.project().project_path(),
Value::new(self.rsc_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
async fn edge_rsc_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_edge_resolve_options_context(
fn edge_rsc_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_edge_resolve_options_context(
self.project().project_path(),
Value::new(self.rsc_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
async fn route_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_server_resolve_options_context(
fn route_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_server_resolve_options_context(
self.project().project_path(),
Value::new(self.route_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
async fn edge_route_resolve_options_context(
self: Vc<Self>,
) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_edge_resolve_options_context(
fn edge_route_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_edge_resolve_options_context(
self.project().project_path(),
Value::new(self.route_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
Expand Down Expand Up @@ -446,49 +444,49 @@ impl AppProject {
}

#[turbo_tasks::function]
async fn ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_server_module_options_context(
fn ssr_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_server_module_options_context(
self.project().project_path(),
self.project().execution_context(),
Value::new(self.ssr_ty()),
self.project().next_mode(),
self.project().next_config(),
NextRuntime::NodeJs,
))
)
}

#[turbo_tasks::function]
async fn edge_ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
Ok(get_server_module_options_context(
fn edge_ssr_module_options_context(self: Vc<Self>) -> Vc<ModuleOptionsContext> {
get_server_module_options_context(
self.project().project_path(),
self.project().execution_context(),
Value::new(self.ssr_ty()),
self.project().next_mode(),
self.project().next_config(),
NextRuntime::Edge,
))
)
}

#[turbo_tasks::function]
async fn ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_server_resolve_options_context(
fn ssr_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_server_resolve_options_context(
self.project().project_path(),
Value::new(self.ssr_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
async fn edge_ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
Ok(get_edge_resolve_options_context(
fn edge_ssr_resolve_options_context(self: Vc<Self>) -> Vc<ResolveOptionsContext> {
get_edge_resolve_options_context(
self.project().project_path(),
Value::new(self.ssr_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
))
)
}

#[turbo_tasks::function]
Expand Down Expand Up @@ -532,11 +530,8 @@ impl AppProject {
}

#[turbo_tasks::function]
async fn runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
Ok(get_server_runtime_entries(
Value::new(self.rsc_ty()),
self.project().next_mode(),
))
fn runtime_entries(self: Vc<Self>) -> Vc<RuntimeEntries> {
get_server_runtime_entries(Value::new(self.rsc_ty()), self.project().next_mode())
}

#[turbo_tasks::function]
Expand All @@ -560,15 +555,15 @@ impl AppProject {
}

#[turbo_tasks::function]
async fn client_runtime_entries(self: Vc<Self>) -> Result<Vc<EvaluatableAssets>> {
Ok(get_client_runtime_entries(
fn client_runtime_entries(self: Vc<Self>) -> Vc<EvaluatableAssets> {
get_client_runtime_entries(
self.project().project_path(),
Value::new(self.client_ty()),
self.project().next_mode(),
self.project().next_config(),
self.project().execution_context(),
)
.resolve_entries(Vc::upcast(self.client_module_context())))
.resolve_entries(Vc::upcast(self.client_module_context()))
}

#[turbo_tasks::function]
Expand Down
6 changes: 2 additions & 4 deletions crates/next-api/src/global_module_id_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ impl GlobalModuleIdStrategyBuilder {
// NOTE(LichuAcu) We can't move this function to `turbopack-core` because we need access to
// `Endpoint`, which is not available there.
#[turbo_tasks::function]
async fn preprocess_module_ids(
endpoint: Vc<Box<dyn Endpoint>>,
) -> Result<Vc<PreprocessedChildrenIdents>> {
fn preprocess_module_ids(endpoint: Vc<Box<dyn Endpoint>>) -> Vc<PreprocessedChildrenIdents> {
let root_modules = endpoint.root_modules();
Ok(children_modules_idents(root_modules))
children_modules_idents(root_modules)
}
6 changes: 3 additions & 3 deletions crates/next-api/src/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl InstrumentationEndpoint {
}

#[turbo_tasks::function]
async fn core_modules(&self) -> Result<Vc<InstrumentationCoreModules>> {
fn core_modules(&self) -> Vc<InstrumentationCoreModules> {
let userland_module = self
.asset_context
.process(
Expand All @@ -81,11 +81,11 @@ impl InstrumentationEndpoint {
"instrumentation".into(),
);

Ok(InstrumentationCoreModules {
InstrumentationCoreModules {
userland_module,
edge_entry_module,
}
.cell())
.cell()
}

#[turbo_tasks::function]
Expand Down
11 changes: 5 additions & 6 deletions crates/next-api/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,13 @@ impl MiddlewareEndpoint {
}

#[turbo_tasks::function]
async fn userland_module(&self) -> Result<Vc<Box<dyn Module>>> {
Ok(self
.asset_context
fn userland_module(&self) -> Vc<Box<dyn Module>> {
self.asset_context
.process(
self.source,
Value::new(ReferenceType::Entry(EntryReferenceSubType::Middleware)),
)
.module())
.module()
}
}

Expand Down Expand Up @@ -311,7 +310,7 @@ impl Endpoint for MiddlewareEndpoint {
}

#[turbo_tasks::function]
fn root_modules(self: Vc<Self>) -> Result<Vc<Modules>> {
Ok(Vc::cell(vec![self.userland_module()]))
fn root_modules(self: Vc<Self>) -> Vc<Modules> {
Vc::cell(vec![self.userland_module()])
}
}
Loading

0 comments on commit 853a2ac

Please sign in to comment.