Skip to content

feat: support css in bundless mode #206

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 10, 2024
Merged

Conversation

SoonIter
Copy link
Member

@SoonIter SoonIter commented Sep 14, 2024

Summary

closes #182

  1. support css files in bundless mode
    • add cssConfig.ts and composeCssConfig
    • replace CssExtractPlugin.loader with LibCssExtractLoader which is forked
    • remove CssExtractPlugin
    • add RemoveCssExtractAssetPlugin
    • support redirect.style
  2. migrate the css test from modernjs module
    • css
    • less
    • sass
    • tailwind
    • css modules
    • postcss
    • lightningcss
  3. add examples & e2e & benchmark for bundle false component

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit ee0ecf6
🔍 Latest deploy log https://app.netlify.com/sites/rslib/deploys/6706666d45e9610008ed0e56
😎 Deploy Preview https://deploy-preview-206--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@SoonIter SoonIter force-pushed the css-support branch 2 times, most recently from 238dfd3 to 641a374 Compare September 24, 2024 03:57
@SoonIter SoonIter force-pushed the css-support branch 3 times, most recently from 068ae3c to f54b6ff Compare September 30, 2024 07:42
Copy link

codspeed-hq bot commented Sep 30, 2024

CodSpeed Performance Report

Merging #206 will not alter performance

Comparing SoonIter:css-support (8ce1cea) with main (146b38e)

Summary

✅ 1 untouched benchmarks

🆕 2 new benchmarks
⁉️ 1 (👁 1) dropped benchmarks

Benchmarks breakdown

Benchmark main SoonIter:css-support Change
👁 examples/react-component 112 ms N/A N/A
🆕 examples/react-component-bundle N/A 163.3 ms N/A
🆕 examples/react-component-bundle-false N/A 194.5 ms N/A

@SoonIter SoonIter changed the title feat: support css feat: support css in bundless mode Oct 8, 2024
@SoonIter SoonIter marked this pull request as ready for review October 8, 2024 09:02
@Timeless0911
Copy link
Contributor

css tests like less should be added more

@Timeless0911
Copy link
Contributor

Add some tests about

  • postcss
  • tailwindcss
  • style inject

And has the redirect.css behaviour been tested?

@fi3ework
Copy link
Member

fi3ework commented Oct 9, 2024

By the way, it's better to add the document alongside. @Timeless0911 What about adding the basic doc outline today?

@Timeless0911
Copy link
Contributor

By the way, it's better to add the document alongside. @Timeless0911 What about adding the basic doc outline today?

I'll make a draft later today.

@Timeless0911
Copy link
Contributor

Timeless0911 commented Oct 9, 2024

https://github.com/web-infra-dev/rslib/blob/main/tests/integration/banner-footer/rslib.config.ts#L54

we should remember to add banner and footer tests about bundleless css.

@SoonIter
Copy link
Member Author

SoonIter commented Oct 10, 2024

we should remember to add banner and footer tests about bundleless css.
Currently, we do not support banner.css

this.emitFile in loader is not handled by rspack.BannerPlugin

the files are in the chunks.auxiliaryFiles not chunks.files

https://github.com/webpack/webpack/blob/65bce6826b85a48add3371d76ba16a9933326058/lib/BannerPlugin.js#L105

Maybe we can support it by adjusting bannerPlugin in the future, this is a TODO

@Timeless0911
Copy link
Contributor

this.emitFile in loader is not handled by rspack.BannerPlugin

the files are in the chunks.auxiliaryFiles not chunks.files

webpack/webpack@65bce68/lib/BannerPlugin.js#L105

Maybe we can support it by adjusting bannerPlugin in the future, this is a TODO

Open an issue and we can track it in the future.

@fi3ework
Copy link
Member

Generally LGTM, some bug has been tracked, we could fix afterwards. cc @Timeless0911

@SoonIter SoonIter merged commit 1e68158 into web-infra-dev:main Oct 10, 2024
18 checks passed
@SoonIter SoonIter deleted the css-support branch October 10, 2024 11:21
@Timeless0911
Copy link
Contributor

TODO:

  1. asset in CSS
  2. banner and footer in CSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support CSS and css-modules in bundle: false
3 participants