Skip to content

Commit

Permalink
Merge branch 'canary' into 10-09-feat_next-upgrade_suggest_react_codemod
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi authored Oct 11, 2024
2 parents 980b683 + f0c058d commit 00e39a6
Show file tree
Hide file tree
Showing 126 changed files with 2,514 additions and 1,287 deletions.
513 changes: 239 additions & 274 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" }
turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" }

# SWC crates
swc_core = { version = "0.103.1", features = [
swc_core = { version = "0.106.3", features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
] }
testing = { version = "0.39.0" }
testing = { version = "0.42.0" }

# Keep consistent with preset_env_base through swc_core
browserslist-rs = { version = "0.16.0" }
miette = { version = "5.10.0", features = ["fancy"] }
mdxjs = "0.2.9"
modularize_imports = { version = "0.68.25" }
styled_components = { version = "0.96.23" }
styled_jsx = { version = "0.73.34" }
swc_emotion = { version = "0.72.22" }
swc_relay = { version = "0.44.25" }
mdxjs = "0.2.10"
modularize_imports = { version = "0.68.26" }
styled_components = { version = "0.96.24" }
styled_jsx = { version = "0.73.35" }
swc_emotion = { version = "0.72.23" }
swc_relay = { version = "0.44.26" }

# General Deps

Expand Down
10 changes: 7 additions & 3 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ impl ProjectContainer {
let project = self.project();
let project_fs = project.project_fs().strongly_consistent().await?;
if watch.enable {
project_fs.start_watching_with_invalidation_reason(watch.poll_interval)?;
project_fs
.start_watching_with_invalidation_reason(watch.poll_interval)
.await?;
} else {
project_fs.invalidate_with_reason();
}
Expand Down Expand Up @@ -304,7 +306,9 @@ impl ProjectContainer {
if !ReadRef::ptr_eq(&prev_project_fs, &project_fs) {
if watch.enable {
// TODO stop watching: prev_project_fs.stop_watching()?;
project_fs.start_watching_with_invalidation_reason(watch.poll_interval)?;
project_fs
.start_watching_with_invalidation_reason(watch.poll_interval)
.await?;
} else {
project_fs.invalidate_with_reason();
}
Expand Down Expand Up @@ -1281,7 +1285,7 @@ impl Project {
}
None => match *self.next_mode().await? {
NextMode::Development => Ok(Vc::upcast(DevModuleIdStrategy::new())),
NextMode::Build => Ok(Vc::upcast(GlobalModuleIdStrategyBuilder::build(self))),
NextMode::Build => Ok(Vc::upcast(DevModuleIdStrategy::new())),
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/next-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ lazy_static = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
rustc-hash = { workspace = true }
react_remove_properties = "0.24.20"
remove_console = "0.25.20"
react_remove_properties = "0.24.21"
remove_console = "0.25.21"

auto-hash-map = { workspace = true }

Expand Down
28 changes: 19 additions & 9 deletions crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,15 +1140,25 @@ impl NextConfig {
}

#[turbo_tasks::function]
pub fn tree_shaking_mode_for_user_code(
self: Vc<Self>,
is_development: bool,
) -> Vc<OptionTreeShaking> {
Vc::cell(Some(if is_development {
TreeShakingMode::ReexportsOnly
} else {
TreeShakingMode::ModuleFragments
}))
pub fn tree_shaking_mode_for_user_code(&self, is_development: bool) -> Vc<OptionTreeShaking> {
let tree_shaking = self
.experimental
.turbo
.as_ref()
.and_then(|v| v.tree_shaking);

OptionTreeShaking(match tree_shaking {
Some(false) => Some(TreeShakingMode::ReexportsOnly),
Some(true) => Some(TreeShakingMode::ModuleFragments),
None => {
if is_development {
Some(TreeShakingMode::ReexportsOnly)
} else {
Some(TreeShakingMode::ModuleFragments)
}
}
})
.cell()
}

#[turbo_tasks::function]
Expand Down
16 changes: 1 addition & 15 deletions crates/next-core/src/next_server/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use turbopack_core::{
environment::{Environment, ExecutionEnvironment, NodeJsEnvironment, RuntimeVersions},
free_var_references,
};
use turbopack_ecmascript::{references::esm::UrlRewriteBehavior, TreeShakingMode};
use turbopack_ecmascript::references::esm::UrlRewriteBehavior;
use turbopack_ecmascript_plugins::transform::directives::{
client::ClientDirectiveTransformer, client_disallowed::ClientDisallowedDirectiveTransformer,
};
Expand Down Expand Up @@ -898,20 +898,6 @@ pub async fn get_server_module_options_context(
Ok(module_options_context)
}

#[turbo_tasks::function]
pub fn get_build_module_options_context() -> Vc<ModuleOptionsContext> {
ModuleOptionsContext {
ecmascript: EcmascriptOptionsContext {
enable_typescript_transform: Some(Default::default()),
esm_url_rewrite_behavior: Some(UrlRewriteBehavior::Full),
..Default::default()
},
tree_shaking_mode: Some(TreeShakingMode::ModuleFragments),
..Default::default()
}
.cell()
}

#[turbo_tasks::function]
pub fn get_server_runtime_entries(
_ty: Value<ServerContextType>,
Expand Down
6 changes: 3 additions & 3 deletions crates/next-custom-transforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ swc_emotion = { workspace = true }
swc_relay = { workspace = true }
turbopack-ecmascript-plugins = { workspace = true, optional = true }

react_remove_properties = "0.24.20"
remove_console = "0.25.20"
preset_env_base = "0.5.1"
react_remove_properties = "0.24.21"
remove_console = "0.25.21"
preset_env_base = "0.6.0"

[dev-dependencies]
swc_core = { workspace = true, features = ["testing_transform"]}
Expand Down
Loading

0 comments on commit 00e39a6

Please sign in to comment.