Skip to content

Commit

Permalink
refactor!: disable css minify in html minify and remove SwcCssMinimiz…
Browse files Browse the repository at this point in the history
…erRspackPlugin (#7547)
  • Loading branch information
ahabhgk authored Aug 15, 2024
1 parent 18a4c52 commit 2bca663
Show file tree
Hide file tree
Showing 48 changed files with 141 additions and 1,277 deletions.
462 changes: 104 additions & 358 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ napi-derive = { version = "2" }

# Must be pinned with the same swc versions
#rkyv = { version = "=0.7.44" } # synced with swc wasm plugin
swc_config = { version = "=0.1.14" }
swc_core = { version = "0.99.5", default-features = false }
swc_ecma_minifier = { version = "=0.200.3", default-features = false }
swc_error_reporters = { version = "=0.20.0" }
swc_html = { version = "=0.145.0" }
swc_html_minifier = { version = "=0.142.2" }
swc_node_comments = { version = "=0.23.0" }
swc_config = { version = "=0.1.15" }
swc_core = { version = "=0.100.7", default-features = false }
swc_ecma_minifier = { version = "=0.201.0", default-features = false }
swc_error_reporters = { version = "=0.21.0" }
swc_html = { version = "=0.146.1" }
swc_html_minifier = { version = "=0.143.1", default-features = false }
swc_node_comments = { version = "=0.24.0" }


[workspace.metadata.release]
Expand Down
7 changes: 0 additions & 7 deletions crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ export enum BuiltinPluginName {
CopyRspackPlugin = 'CopyRspackPlugin',
HtmlRspackPlugin = 'HtmlRspackPlugin',
SwcJsMinimizerRspackPlugin = 'SwcJsMinimizerRspackPlugin',
SwcCssMinimizerRspackPlugin = 'SwcCssMinimizerRspackPlugin',
LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin',
BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin',
CssExtractRspackPlugin = 'CssExtractRspackPlugin',
Expand Down Expand Up @@ -1715,12 +1714,6 @@ export interface RawStatsOptions {
colors: boolean
}

export interface RawSwcCssMinimizerRspackPluginOptions {
test?: string | RegExp | (string | RegExp)[]
include?: string | RegExp | (string | RegExp)[]
exclude?: string | RegExp | (string | RegExp)[]
}

export interface RawSwcJsMinimizerOptions {
compress: any
mangle: any
Expand Down
6 changes: 0 additions & 6 deletions crates/rspack_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ swc_core = { workspace = true, features = [
"ecma_transforms_module",
"swc_ecma_codegen",
"swc_ecma_visit",
"css_ast",
"css_codegen",
"css_parser",
"css_utils",
"css_visit",
"css_modules",
] }
swc_error_reporters = { workspace = true }
swc_node_comments = { workspace = true }
53 changes: 0 additions & 53 deletions crates/rspack_ast/src/ast/css.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/rspack_ast/src/ast/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pub mod css;
pub mod javascript;
11 changes: 0 additions & 11 deletions crates/rspack_ast/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
mod ast;

pub use crate::ast::css;
use crate::ast::css::Ast as CssAst;
pub use crate::ast::javascript;
use crate::ast::javascript::Ast as JsAst;

Expand All @@ -11,21 +9,12 @@ use crate::ast::javascript::Ast as JsAst;
#[derive(Debug, Clone, Hash)]
pub enum RspackAst {
JavaScript(JsAst),
Css(CssAst),
}

impl RspackAst {
pub fn as_javascript(&self) -> Option<&JsAst> {
match self {
RspackAst::JavaScript(program) => Some(program),
RspackAst::Css(_) => None,
}
}

pub fn as_css(&self) -> Option<&CssAst> {
match self {
RspackAst::Css(stylesheet) => Some(stylesheet),
RspackAst::JavaScript(_) => None,
}
}
}
25 changes: 0 additions & 25 deletions crates/rspack_ast_viewer/Cargo.toml

This file was deleted.

22 changes: 0 additions & 22 deletions crates/rspack_ast_viewer/LICENSE

This file was deleted.

63 changes: 0 additions & 63 deletions crates/rspack_ast_viewer/README.md

This file was deleted.

111 changes: 0 additions & 111 deletions crates/rspack_ast_viewer/src/main.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/rspack_binding_options/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ rspack_plugin_runtime_chunk = { version = "0.1.0", path = "../rspack_p
rspack_plugin_schemes = { version = "0.1.0", path = "../rspack_plugin_schemes" }
rspack_plugin_size_limits = { version = "0.1.0", path = "../rspack_plugin_size_limits" }
rspack_plugin_split_chunks = { version = "0.1.0", path = "../rspack_plugin_split_chunks" }
rspack_plugin_swc_css_minimizer = { version = "0.1.0", path = "../rspack_plugin_swc_css_minimizer" }
rspack_plugin_swc_js_minimizer = { version = "0.1.0", path = "../rspack_plugin_swc_js_minimizer" }
rspack_plugin_warn_sensitive_module = { version = "0.1.0", path = "../rspack_plugin_warn_sensitive_module" }
rspack_plugin_wasm = { version = "0.1.0", path = "../rspack_plugin_wasm" }
Expand Down
Loading

2 comments on commit 2bca663

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
_selftest ✅ success
nx ❌ failure
rspress ✅ success
rsbuild ✅ success
examples ❌ failure

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-08-15 5271a8b) Current Change
10000_development-mode + exec 2.31 s ± 16 ms 2.35 s ± 22 ms +1.52 %
10000_development-mode_hmr + exec 697 ms ± 6.7 ms 725 ms ± 7.9 ms +3.97 %
10000_production-mode + exec 2.85 s ± 37 ms 3.03 s ± 24 ms +6.30 %
arco-pro_development-mode + exec 1.88 s ± 77 ms 1.89 s ± 92 ms +0.78 %
arco-pro_development-mode_hmr + exec 433 ms ± 2.7 ms 440 ms ± 2.9 ms +1.70 %
arco-pro_production-mode + exec 3.43 s ± 72 ms 3.5 s ± 83 ms +2.29 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.49 s ± 75 ms 3.54 s ± 71 ms +1.56 %
threejs_development-mode_10x + exec 1.68 s ± 15 ms 1.72 s ± 9.8 ms +2.62 %
threejs_development-mode_10x_hmr + exec 797 ms ± 1.8 ms 822 ms ± 8.8 ms +3.14 %
threejs_production-mode_10x + exec 5.48 s ± 28 ms 5.57 s ± 36 ms +1.64 %

Threshold exceeded: ["10000_production-mode + exec"]

Please sign in to comment.