diff --git a/crates/pack-core/Cargo.toml b/crates/pack-core/Cargo.toml index c7ee6837fc..c00a7e6dad 100644 --- a/crates/pack-core/Cargo.toml +++ b/crates/pack-core/Cargo.toml @@ -70,11 +70,11 @@ turbopack-static = { workspace = true } [target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies] turbo-tasks-fetch = { workspace = true } -turbopack-ecmascript-plugins = { workspace = true, default-features = true, features = ["transform_emotion"] } +turbopack-ecmascript-plugins = { workspace = true, default-features = true } [target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies] getrandom = { version = "0.3", features = ["wasm_js"] } -turbopack-ecmascript-plugins = { workspace = true, default-features = false, features = ["transform_emotion"] } +turbopack-ecmascript-plugins = { workspace = true, default-features = false } [lints] workspace = true diff --git a/crates/pack-core/src/client/context.rs b/crates/pack-core/src/client/context.rs index cbd2b69f44..dbb5fdb8ae 100644 --- a/crates/pack-core/src/client/context.rs +++ b/crates/pack-core/src/client/context.rs @@ -53,7 +53,7 @@ use crate::{ classic_jsx_react_import::get_classic_jsx_react_import_rule, css_modules::get_auto_css_modules_rule, default_export_namer::get_default_export_namer_rule, - emotion::get_emotion_transform_rule, remove_console::get_remove_console_transform_rule, + remove_console::get_remove_console_transform_rule, styled_components::get_styled_components_transform_rule, styled_jsx::get_styled_jsx_transform_rule, swc_ecma_transform_plugins::get_swc_ecma_transform_plugin_rule, @@ -335,7 +335,6 @@ pub async fn get_client_module_options_context( let additional_rules: Vec = vec![ get_swc_ecma_transform_plugin_rule(config, project_path.clone()).await?, - get_emotion_transform_rule(config).await?, get_styled_components_transform_rule(config).await?, get_styled_jsx_transform_rule(config, target_browsers).await?, get_remove_console_transform_rule(config).await?, diff --git a/crates/pack-core/src/config.rs b/crates/pack-core/src/config.rs index 773b81e372..5095781958 100644 --- a/crates/pack-core/src/config.rs +++ b/crates/pack-core/src/config.rs @@ -22,9 +22,7 @@ use turbopack_core::{ resolve::ResolveAliasMap, }; use turbopack_ecmascript::{OptionTreeShaking, TreeShakingMode}; -use turbopack_ecmascript_plugins::transform::{ - emotion::EmotionTransformConfig, styled_components::StyledComponentsTransformConfig, -}; +use turbopack_ecmascript_plugins::transform::styled_components::StyledComponentsTransformConfig; use turbopack_node::transforms::webpack::{WebpackLoaderItem, WebpackLoaderItems}; use crate::{ @@ -270,7 +268,6 @@ pub struct ReactConfig { #[derive(Clone, Debug, PartialEq, Default, Deserialize, OperationValue)] #[serde(rename_all = "camelCase")] pub struct StyleConfig { - pub emotion: Option, pub styled_components: Option, #[bincode(with = "turbo_bincode::serde_self_describing")] sass: Option, @@ -687,23 +684,6 @@ impl PartialEq for SizeLimit { impl Eq for SizeLimit {} -#[turbo_tasks::value] -#[derive(Clone, Debug, Deserialize, OperationValue)] -#[serde(untagged)] -pub enum EmotionTransformOptionsOrBoolean { - Boolean(bool), - Options(EmotionTransformConfig), -} - -impl EmotionTransformOptionsOrBoolean { - pub fn is_enabled(&self) -> bool { - match self { - Self::Boolean(enabled) => *enabled, - _ => true, - } - } -} - #[turbo_tasks::value] #[derive(Clone, Debug, Deserialize, OperationValue)] #[serde(untagged)] diff --git a/crates/pack-core/src/shared/transforms/emotion.rs b/crates/pack-core/src/shared/transforms/emotion.rs deleted file mode 100644 index bbcc68a627..0000000000 --- a/crates/pack-core/src/shared/transforms/emotion.rs +++ /dev/null @@ -1,30 +0,0 @@ -use anyhow::Result; -use turbo_tasks::Vc; -use turbopack::module_options::ModuleRule; -use turbopack_ecmascript_plugins::transform::emotion::EmotionTransformer; - -use super::get_ecma_transform_rule; -use crate::{ - config::{Config, EmotionTransformOptionsOrBoolean}, - shared::transforms::EcmascriptTransformStage, -}; - -pub async fn get_emotion_transform_rule(config: Vc) -> Result> { - let module_rule = config - .styles() - .await? - .emotion - .as_ref() - .and_then(|config| match config { - EmotionTransformOptionsOrBoolean::Boolean(true) => { - EmotionTransformer::new(&Default::default()) - } - EmotionTransformOptionsOrBoolean::Options(value) => EmotionTransformer::new(value), - _ => None, - }) - .map(|transformer| { - get_ecma_transform_rule(Box::new(transformer), false, EcmascriptTransformStage::Main) - }); - - Ok(module_rule) -} diff --git a/crates/pack-core/src/shared/transforms/mod.rs b/crates/pack-core/src/shared/transforms/mod.rs index b4e2ef0223..034f352e88 100644 --- a/crates/pack-core/src/shared/transforms/mod.rs +++ b/crates/pack-core/src/shared/transforms/mod.rs @@ -11,7 +11,6 @@ use wasm::StaticWasmModuleType; pub mod classic_jsx_react_import; pub mod css_modules; pub mod default_export_namer; -pub mod emotion; pub mod image; pub mod modularize_imports; pub mod remove_console; diff --git a/crates/pack-schema/src/lib.rs b/crates/pack-schema/src/lib.rs index 6745d4cc10..ebd3a66186 100644 --- a/crates/pack-schema/src/lib.rs +++ b/crates/pack-schema/src/lib.rs @@ -729,11 +729,6 @@ pub struct SchemaImageConfig { #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct SchemaStyleConfig { - /// Emotion transform configuration - #[serde(skip_serializing_if = "Option::is_none")] - #[schemars(description = "Emotion transform configuration")] - pub emotion: Option, - /// Styled components configuration #[serde(skip_serializing_if = "Option::is_none")] #[schemars(description = "Styled components configuration")] diff --git a/crates/pack-tests/Cargo.toml b/crates/pack-tests/Cargo.toml index 7703a9e2e1..e613ced7e5 100644 --- a/crates/pack-tests/Cargo.toml +++ b/crates/pack-tests/Cargo.toml @@ -34,7 +34,7 @@ turbo-unix-path = { workspace = true } turbopack = { workspace = true } turbopack-browser = { workspace = true, features = ["test"] } turbopack-core = { workspace = true } -turbopack-ecmascript-plugins = { workspace = true, features = ["transform_emotion"] } +turbopack-ecmascript-plugins = { workspace = true } turbopack-node = { workspace = true, default-features = false, features = ["process_pool"] } turbopack-nodejs = { workspace = true, features = ["test"] } turbopack-resolve = { workspace = true } diff --git a/packages/pack-shared/src/config.ts b/packages/pack-shared/src/config.ts index 711e820dcc..f9852fea46 100644 --- a/packages/pack-shared/src/config.ts +++ b/packages/pack-shared/src/config.ts @@ -184,7 +184,6 @@ export interface ConfigComplete { }; styledComponents?: boolean | StyledComponentsConfig; - emotion?: boolean | EmotionConfig; }; images?: { inlineLimit?: number; @@ -236,20 +235,6 @@ export interface StyledComponentsConfig { cssProp?: boolean; } -export interface EmotionConfig { - sourceMap?: boolean; - autoLabel?: "dev-only" | "always" | "never"; - labelFormat?: string; - importMap?: { - [importName: string]: { - [exportName: string]: { - canonicalImport?: [string, string]; - styledBaseImport?: [string, string]; - }; - }; - }; -} - export interface BundleOptions { /** * The utoo pack configs. diff --git a/packages/pack/README.md b/packages/pack/README.md index 5967730c48..caa3f9abff 100644 --- a/packages/pack/README.md +++ b/packages/pack/README.md @@ -22,7 +22,7 @@ - **Resolve**: Full support for `alias` and `extensions`. - **Styles**: Built-in support for Less, Sass, PostCSS, CSS Modules, and LightningCSS. - **Optimization**: Minification, Tree Shaking, Module Concatenation, and more. -- **Frameworks**: Optimized for React (including `styled-jsx`, `emotion`, `styled-components`). +- **Frameworks**: Optimized for React (including `styled-jsx`, `styled-components`). - **Tools**: Integrated Bundle Analyzer and Tracing Logs. > [!TIP] diff --git a/packages/pack/config_schema.json b/packages/pack/config_schema.json index 2ffd6a5e44..6ffb2de606 100644 --- a/packages/pack/config_schema.json +++ b/packages/pack/config_schema.json @@ -1021,6 +1021,13 @@ "null" ] }, + "chunkLoadingGlobal": { + "description": "The global variable name used by the runtime for loading chunks. Default: 'TURBOPACK'", + "type": [ + "string", + "null" + ] + }, "clean": { "description": "Whether to clean output directory before build", "type": [ @@ -1038,6 +1045,13 @@ "$ref": "#/definitions/SchemaCopyItem" } }, + "entryRootExport": { + "description": "Expose entry module exports to global scope with the specified name. When set, all named exports from the entry module will be available on window/globalThis under the specified name. If set to empty string, will use package.json name. Default: None (no exposure)", + "type": [ + "string", + "null" + ] + }, "filename": { "description": "Filename pattern for main files", "type": [ @@ -1207,9 +1221,6 @@ "description": "Style configuration", "type": "object", "properties": { - "emotion": { - "description": "Emotion transform configuration" - }, "inlineCss": { "description": "Inline CSS configuration" }, @@ -1261,6 +1272,16 @@ "description": "Whether to watch the filesystem for file changes.", "type": "boolean" }, + "ignored": { + "description": "Paths to ignore when watching for file changes. By default, ignores: node_modules", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, "pollInterval": { "description": "Enable polling at a certain interval if the native file watching doesn't work (e.g. docker).", "type": [ diff --git a/packages/pack/docs/features-list.json b/packages/pack/docs/features-list.json index b03300d150..02d1cb2165 100644 --- a/packages/pack/docs/features-list.json +++ b/packages/pack/docs/features-list.json @@ -285,12 +285,6 @@ "featureDetails": "[Styled Components](https://github.com/styled-components/styled-components)", "remarks": "" }, - { - "featureLevel2": "`emotion`", - "featureStatus": "✅", - "featureDetails": "[Emotion.js](https://github.com/emotion-js/emotion)", - "remarks": "" - }, { "featureLevel2": "`css parse, transform, minify`", "featureStatus": "✅",