Skip to content

Commit 669ecbb

Browse files
committed
refactor(pack): check worker_threads support, remove useless configs
1 parent 83a3175 commit 669ecbb

10 files changed

Lines changed: 11193 additions & 11873 deletions

File tree

crates/pack-core/src/config.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,8 @@ pub struct Config {
112112
#[cfg(any(feature = "process_pool", feature = "worker_pool"))]
113113
plugin_runtime_strategy: Option<PluginRuntimeStrategy>,
114114
persistent_caching: Option<bool>,
115-
cache_handler: Option<RcStr>,
116115
node_polyfill: Option<bool>,
117116
dev_server: Option<DevServer>,
118-
#[serde(default)]
119-
experimental: ExperimentalConfig,
120117
#[cfg(feature = "test")]
121118
#[serde(rename = "runtimeType")]
122119
runtime_type: Option<RcStr>,
@@ -692,13 +689,6 @@ impl TryFrom<RegexComponents> for EsRegex {
692689
}
693690
}
694691

695-
#[turbo_tasks::value]
696-
#[derive(Clone, Debug, Default, Deserialize, OperationValue)]
697-
#[serde(rename_all = "camelCase")]
698-
pub struct ExperimentalConfig {
699-
react_compiler: Option<ReactCompilerOptionsOrBoolean>,
700-
}
701-
702692
#[turbo_tasks::value]
703693
#[derive(Clone, Debug, Deserialize, OperationValue)]
704694
#[serde(untagged)]
@@ -946,11 +936,6 @@ impl Config {
946936
)
947937
}
948938

949-
#[turbo_tasks::function]
950-
pub fn cache_handler(&self) -> Vc<Option<RcStr>> {
951-
Vc::cell(self.cache_handler.clone())
952-
}
953-
954939
#[turbo_tasks::function]
955940
pub fn externals_config(&self) -> Vc<ExternalsConfig> {
956941
let externals = self.externals.clone().unwrap_or_default();
@@ -1290,29 +1275,6 @@ impl Config {
12901275
Vc::cell(self.swc_plugins.clone().unwrap_or_default())
12911276
}
12921277

1293-
#[turbo_tasks::function]
1294-
pub fn react_compiler(&self) -> Vc<OptionalReactCompilerOptions> {
1295-
let options = &self.experimental.react_compiler;
1296-
1297-
let options = match options {
1298-
Some(ReactCompilerOptionsOrBoolean::Boolean(true)) => {
1299-
OptionalReactCompilerOptions(Some(
1300-
ReactCompilerOptions {
1301-
compilation_mode: None,
1302-
panic_threshold: None,
1303-
}
1304-
.resolved_cell(),
1305-
))
1306-
}
1307-
Some(ReactCompilerOptionsOrBoolean::Option(options)) => OptionalReactCompilerOptions(
1308-
Some(ReactCompilerOptions { ..options.clone() }.resolved_cell()),
1309-
),
1310-
_ => OptionalReactCompilerOptions(None),
1311-
};
1312-
1313-
options.cell()
1314-
}
1315-
13161278
#[turbo_tasks::function]
13171279
pub fn sass_config(&self) -> Vc<JsonValue> {
13181280
Vc::cell(

crates/pack-core/src/import_map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub async fn insert_shared_aliases(
3737
pack_path: &FileSystemPath,
3838
) -> Result<()> {
3939
import_map.insert_singleton_alias("@swc/helpers", pack_path.join("node_modules/@swc/helpers")?);
40-
// import_map.insert_singleton_alias("styled-jsx", pack_package.clone());
4140
import_map.insert_singleton_alias("react", project_path.clone());
4241
import_map.insert_singleton_alias("react-dom", project_path.clone());
4342

0 commit comments

Comments
 (0)