rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Feature]: builtin-lightningcss-loader add support for `visitor` option

Open ckken opened this issue 1 year ago • 9 comments

What problem does this feature solve?

https://rspack.dev/zh/guide/features/builtin-lightningcss-loader#options https://lightningcss.dev/transforms.html

What does the proposed API of configuration look like?

LightningcssLoaderOptions 增加 visitor

ckken avatar Aug 19 '24 09:08 ckken

It's cool but not that high priority for us at present, and if using JavaScript visitor, there will be interop between Rust and JavaScript, so the performance gain of builtin-loader is gone, in this case you can try calling lightningcss-node binding yourself, or you can try this loader from community

We will support visitors in the future, but still, not high priority for us at present, of course we are happy to help if you are willing to contribute for this feature

JSerFeng avatar Aug 27 '24 07:08 JSerFeng

Without visitor, from a business perspective, built-in functions are useless, such as px to vw, etc.

ckken avatar Aug 29 '24 03:08 ckken

https://empjs.dev/plugin/tool/plugin-lightningcss.html At present, the processing method of postcss has been rewritten. I just want to switch to the built-in function, but the gap is a bit big

ckken avatar Aug 29 '24 03:08 ckken

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Nov 01 '24 07:11 stale[bot]

bump

JSerFeng avatar Nov 04 '24 07:11 JSerFeng

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Feb 28 '25 23:02 stale[bot]

请问 这个有进度吗

ckken avatar Apr 16 '25 03:04 ckken

No progress temporarily, we will do this in two week recently.

GiveMe-A-Name avatar Apr 16 '25 03:04 GiveMe-A-Name

No progress temporarily, we will do this in two week recently.

Really looking forward

sowtame avatar Apr 18 '25 08:04 sowtame

guys, if there's any news on this feature, we have 80 percent of the build taken up by postcss plugins on our project, we want to switch to lightningcss. Sincerely, a dedicated rspack user

sowtame avatar May 16 '25 07:05 sowtame

bump

sowtame avatar Jun 04 '25 07:06 sowtame

consider visitor will cause lots of rust <-> js commutation which will make builtin-lightningcss-loader slow, we suggest use the js version of lightningcss-loader instead if you want to use lightningcss with visitor

hardfist avatar Jul 09 '25 08:07 hardfist