Skip to content
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
4 changes: 2 additions & 2 deletions crates/pack-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions crates/pack-core/src/client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -335,7 +335,6 @@ pub async fn get_client_module_options_context(

let additional_rules: Vec<ModuleRule> = 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?,
Expand Down
22 changes: 1 addition & 21 deletions crates/pack-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -270,7 +268,6 @@ pub struct ReactConfig {
#[derive(Clone, Debug, PartialEq, Default, Deserialize, OperationValue)]
#[serde(rename_all = "camelCase")]
pub struct StyleConfig {
pub emotion: Option<EmotionTransformOptionsOrBoolean>,
pub styled_components: Option<StyledComponentsTransformOptionsOrBoolean>,
#[bincode(with = "turbo_bincode::serde_self_describing")]
sass: Option<serde_json::Value>,
Expand Down Expand Up @@ -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)]
Expand Down
30 changes: 0 additions & 30 deletions crates/pack-core/src/shared/transforms/emotion.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/pack-core/src/shared/transforms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions crates/pack-schema/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<serde_json::Value>,

/// Styled components configuration
#[serde(skip_serializing_if = "Option::is_none")]
#[schemars(description = "Styled components configuration")]
Expand Down
2 changes: 1 addition & 1 deletion crates/pack-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
15 changes: 0 additions & 15 deletions packages/pack-shared/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export interface ConfigComplete {
};

styledComponents?: boolean | StyledComponentsConfig;
emotion?: boolean | EmotionConfig;
};
images?: {
inlineLimit?: number;
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/pack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
27 changes: 24 additions & 3 deletions packages/pack/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,13 @@
"null"
]
},
"chunkLoadingGlobal": {
"description": "The global variable name used by the runtime for loading chunks. Default: 'TURBOPACK'",
"type": [
"string",
"null"
]
},
Comment thread
fireairforce marked this conversation as resolved.
Resolved
"clean": {
"description": "Whether to clean output directory before build",
"type": [
Expand All @@ -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": [
Expand Down Expand Up @@ -1207,9 +1221,6 @@
"description": "Style configuration",
"type": "object",
"properties": {
"emotion": {
"description": "Emotion transform configuration"
},
"inlineCss": {
"description": "Inline CSS configuration"
},
Expand Down Expand Up @@ -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": [
Expand Down
6 changes: 0 additions & 6 deletions packages/pack/docs/features-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "✅",
Expand Down
Loading