Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(html/minifier): Support using custom css minifier #9425

Merged

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Aug 13, 2024

Description:

Support use a custom css minifier when minimizing html, add feature = "custom-css-minifier" to enable this and remove the dependencies of swc_css_*.
And feature = "default-css-minifier" keep the original behavior, using swc_css when minimizing html, and this is the default feature.
(Rspack is now using LightningCSS to minimize CSS files, but the CSS insides html is still using swc_css (which called by swc_html_minifier) to do the minify, so we want to also use LightningCSS to minify the CSS insides html to keep the consistent with CSS files)

@ahabhgk ahabhgk requested a review from a team as a code owner August 13, 2024 09:28
Copy link

changeset-bot bot commented Aug 13, 2024

🦋 Changeset detected

Latest commit: 78bb90b

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kdy1 kdy1 added this to the Planned milestone Aug 13, 2024
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Can you add default-features = false to

swc_html_minifier = { version = "0.143.0", path = "../swc_html_minifier", optional = true }
?
Otherwise you can't disable default features.

@kdy1 kdy1 changed the title feat: support using custom css minifier in html minify feat(html/minifier): Support using custom css minifier Aug 13, 2024
@ahabhgk ahabhgk requested a review from a team as a code owner August 13, 2024 09:48
@kdy1 kdy1 enabled auto-merge (squash) August 13, 2024 09:56
@kdy1 kdy1 merged commit 970cc81 into swc-project:main Aug 13, 2024
154 checks passed
Copy link

codspeed-hq bot commented Aug 13, 2024

CodSpeed Performance Report

Merging #9425 will degrade performances by 8.18%

Comparing ahabhgk:feat-custom-css-minifier-for-html-minifier (78bb90b) with main (9751518)

Summary

❌ 5 regressions
✅ 173 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main ahabhgk:feat-custom-css-minifier-for-html-minifier Change
es/full/bugs-1 521.9 µs 568.4 µs -8.18%
es/visitor/base-perf/boxing_boxed 3.2 µs 3.4 µs -5.2%
es/visitor/base-perf/boxing_boxed_clone 2.4 µs 2.4 µs -3.59%
es/visitor/base-perf/boxing_unboxed 3.3 µs 3.5 µs -4.97%
es/visitor/base-perf/boxing_unboxed_clone 2.6 µs 2.7 µs -3.25%

@ahabhgk ahabhgk deleted the feat-custom-css-minifier-for-html-minifier branch August 13, 2024 12:08
@kdy1 kdy1 modified the milestones: Planned, v1.7.11 Aug 14, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Sep 13, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants