feat(css): support sass modern api#17728
Conversation
|
|
I think like you suggested, we can try re-running the css playground while flipping the switch to modern/legacy so we don't have to rewrite the test.
I think we should migrate to
I think we can tackle them later 👍
We should!
I think we can follow webpack by checking |
This is possible for local manual testing by So, maybe the simplest way would be to create something like |
|
I think we should try to avoid copying if possible. Maybe we can have a setup like this?
|
Wow, I wasn't aware test runner automatically picks up vite config. This looks almost working, but file edit is probably affecting each other and hmr related tests are failing. |
I updated |
|
It doesn't seem to slow down the test, and does make the test more isolated, so fine by me 👍 |
|
Feedback from @nex3:
Maybe Compiler API support can be a separate PR as an opt-in feature. |
|
One option would be to list |
|
Thanks everyone for the review! Regarding compiler API integration, I have another (draft) PR ready #17754. I didn't use Vite's own
@nex3 I think this matches with my expectation, but just to confirm, if Vite would have some heuristics to automatically pick the API, would you suggest something like this?
|
|
Conclusion from today's team meeting:
|
d2395c9 to
3bf2dc1
Compare
|
I made a performance comparison of 6 patterns
|
You can use |
Other changes: - Ace: Fix AceRange import to match new Ace exports - Remove Vite SCSS preprocessing option, as it is now the default since Vite 6.x (vitejs/vite#17728, vitejs/vite#7116).
Other changes: - Ace: Fix AceRange import to match new Ace exports - Remove Vite SCSS preprocessing option, as it is now the default since Vite 6.x (vitejs/vite#17728, vitejs/vite#7116).
Description
This PR adds
preprocessorOptions.scss.api: "modern"option to switch usingsass.compileStringAsyncAPI instead of legacysass.renderAPI.I enabled
api: "modern"inplayground/cssand existing tests are passing.questions
"modern"and"legacy"?playground/csstests pass, so I just flip the switch. maybe we should add a smaller playground for "legacy"?modernas default? (in v6?)In this PR, I only tackled the issue #7116, but I think there are somewhat related requests for overall sass integration experience. I'm wondering if these should be also considered for "modern" api integration, or they can be addressed separately later:
api: "modern-compiler"https://github.com/webpack-contrib/sass-loader?tab=readme-ov-file#apisassimplementation? (cf. Allow usage of sass-embedded instead of sass package #6734)package.jsonto automatically picksass, node-sass, sass-embeddedor allow explicitly choosing fromimplementationoption https://github.com/webpack-contrib/sass-loader?tab=readme-ov-file#implementation