Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunking Refactor Step 1 #56467

Merged
merged 11 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ swc_core = { version = "0.83.28", features = [
testing = { version = "0.34.1" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231002.1" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231005.2" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231002.1" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231005.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231002.1" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231005.2" }

# General Deps

Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use turbopack_binding::{
turbopack::{
core::{
asset::{Asset, AssetContent},
chunk::{ChunkableModule, ChunkingContext, EvaluatableAssets},
chunk::{ChunkableModuleExt, ChunkingContext, EvaluatableAssets},
file_source::FileSource,
output::{OutputAsset, OutputAssets},
virtual_output::VirtualOutputAsset,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-api/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use turbopack_binding::{
turbopack::{
core::{
asset::AssetContent,
chunk::{ChunkableModule, ChunkingContext},
chunk::{ChunkableModuleExt, ChunkingContext},
context::AssetContext,
module::Module,
output::{OutputAsset, OutputAssets},
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-api/src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use turbopack_binding::{
build::BuildChunkingContext,
core::{
asset::AssetContent,
chunk::{ChunkableModule, ChunkingContext, EvaluatableAssets},
chunk::{ChunkableModuleExt, ChunkingContext, EvaluatableAssets},
context::AssetContext,
file_source::FileSource,
issue::{IssueSeverity, OptionIssueSource},
Expand Down
18 changes: 13 additions & 5 deletions packages/next-swc/crates/next-api/src/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ use turbopack_binding::{
turbo::tasks_fs::{rope::RopeBuilder, File, FileSystemPath},
turbopack::{
core::{
asset::AssetContent, chunk::EvaluatableAsset, context::AssetContext, module::Module,
output::OutputAsset, reference::primary_referenced_modules,
reference_type::ReferenceType, virtual_output::VirtualOutputAsset,
asset::AssetContent,
chunk::{ChunkItemExt, ChunkableModule, EvaluatableAsset},
context::AssetContext,
module::Module,
output::OutputAsset,
reference::primary_referenced_modules,
reference_type::ReferenceType,
virtual_output::VirtualOutputAsset,
virtual_source::VirtualSource,
},
ecmascript::{
chunk::{EcmascriptChunkItemExt, EcmascriptChunkPlaceable, EcmascriptChunkingContext},
chunk::{EcmascriptChunkPlaceable, EcmascriptChunkingContext},
parse::ParseResult,
EcmascriptModuleAsset,
},
Expand Down Expand Up @@ -72,7 +77,10 @@ pub(crate) async fn create_server_actions_manifest(
bail!("loader module must be evaluatable");
};

let loader_id = loader.as_chunk_item(chunking_context).id().to_string();
let loader_id = loader
.as_chunk_item(Vc::upcast(chunking_context))
.id()
.to_string();
let manifest =
build_manifest(node_root, pathname, page_name, runtime, actions, loader_id).await?;
Ok((Some(evaluable), manifest))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use turbopack_binding::{
turbopack::{
build::BuildChunkingContext,
core::{
chunk::{ChunkableModule, ChunkingContext, EvaluatableAssets},
chunk::{ChunkableModuleExt, ChunkingContext, EvaluatableAssets},
compile_time_info::CompileTimeInfo,
context::AssetContext,
file_source::FileSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, TryJoinIterExt, V
use turbopack_binding::turbopack::{
build::BuildChunkingContext,
core::{
chunk::{ChunkableModule, ChunkingContext},
chunk::{ChunkableModuleExt, ChunkingContext},
output::OutputAssets,
},
ecmascript::chunk::EcmascriptChunkingContext,
Expand Down
Loading
Loading