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

feat(turbopack): support basic next/dynamic #56389

Merged
merged 19 commits into from
Oct 16, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion packages/next-swc/crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ either = "1"
fxhash = "0.2.1"
hex = "0.4.3"
once_cell = { workspace = true }
next-transform-font = {workspace = true}
pathdiff = "0.2.0"
regex = "1.5"
rustc-hash = "1"
Expand All @@ -24,6 +23,9 @@ serde_json = "1"
sha1 = "0.10.1"
tracing = { version = "0.1.37" }

next-transform-dynamic = { workspace = true }
next-transform-font = { workspace = true }

turbopack-binding = { workspace = true, features = [
"__swc_core",
"__swc_core_next_core",
Expand Down
5 changes: 3 additions & 2 deletions packages/next-swc/crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use std::{cell::RefCell, path::PathBuf, rc::Rc, sync::Arc};
use auto_cjs::contains_cjs;
use either::Either;
use fxhash::FxHashSet;
use next_transform_dynamic::{next_dynamic, NextDynamicMode};
use next_transform_font::next_font_loaders;
use serde::Deserialize;
use turbopack_binding::swc::{
Expand All @@ -58,7 +59,6 @@ mod auto_cjs;
pub mod cjs_optimizer;
pub mod disallow_re_export_all_in_page;
pub mod named_import_transform;
pub mod next_dynamic;
pub mod next_ssg;
pub mod optimize_barrel;
pub mod optimize_server_react;
Expand Down Expand Up @@ -226,7 +226,7 @@ where
!opts.disable_next_ssg
),
amp_attributes::amp_attributes(),
next_dynamic::next_dynamic(
next_dynamic(
opts.is_development,
opts.is_server,
match &opts.server_components {
Expand All @@ -238,6 +238,7 @@ where
},
_ => false,
},
NextDynamicMode::Webpack,
file.name.clone(),
opts.pages_dir.clone()
),
Expand Down
325 changes: 0 additions & 325 deletions packages/next-swc/crates/core/src/next_dynamic.rs

This file was deleted.