Drop support of css-loader ^6, add support for css-loader ^7.1#1319
Drop support of css-loader ^6, add support for css-loader ^7.1#1319Kocal merged 2 commits intosymfony:mainfrom
Conversation
|
Hum, looks like there is more work to do |
|
why is the title taking about webpack-dev-server ? |
8ab29a1 to
ac94831
Compare
Fixed, thanks |
ac94831 to
3e83aa0
Compare
|
Let's keep in draft for the moment. I didn't check failing checks too much, but I believe mini-css-extract-plugin does not support css-loader 7 yet. |
|
Based on the documentation of mini-css-extract-plugin, its behavior depends on the |
e059cdb to
fc93b00
Compare
|
Looking at the test output, it seems related to the Vue integration. |
|
Yeah... But, in fact, IINW we only test CSS modules with Vue, not React nor Svelte, so maybe it fails with those frameworks too. For a moment I thought about automatically configure I suggest to always configure |
|
I've started to add tests about CSS Modules usages with other frameworks, coming in a new PR. |
This PR was squashed before being merged into the main branch. Discussion ---------- Add tests for CSS Modules with React and Preact | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update CHANGELOG.md file --> | Deprecations? | no <!-- please update CHANGELOG.md file --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility. --> Quick PR to add functional tests about using CSS Modules with React and Preact, to see it it also break CSS Modules with them in #1319. Commits ------- c22943b Add tests for CSS Modules with React dbd5e5d Add tests for CSS Modules with Preact
fc93b00 to
8286aa1
Compare
|
As expected, upgrading Let's add |
|
I'm wondering whether we should change the config to use the old behavior or update our tests to follow the recommended usage of css-loader (and document the fact that css-loader 7 has a BC break when using CSS modules so they should either make their code compatible with the new version of configure things themselves). Keeping a non-default configuration for css-loader forever looks weird to me. And shipping the BC break on a different schedule than the css-loader upgrade changing the default would make it harder to communicate about it. |
|
When opening the PR, I started to update our tests and keep the breaking changes, but, IIRC CSS Modules were not usable with Vue Loader due to the way they are declared in I also prefer breaking things in a new major version, but we need to find a way for Vue support. I will restart checking about this in a few hours. |
|
Looking at https://github.com/vuejs/vue-loader/blob/698636508e08f5379a57eaf086b5ff533af8e051/src/cssModules.ts#L9, it seems like vue-loader is not compatible with the new default of |
|
Someone opened a pull-request vuejs/vue-loader#1909 3 years ago, the author repeatedly rebased its PR, but it doesn't look like anyone cared about what was done. The last I want to upgrade to css-loader v7 for Encore v5, and I don't want the few users of Vue + CSS Modules to restrict us from upgrading (Pareto law). What about:
WDYT? |
…ult options, notify Vue users about the new behaviour and the solution
ed33ac2 to
ac0fd39
Compare
|
I've just pushed my idea, I definitely think that's the best option for everyone. |
Let's continue to upgrade major dependencies, see https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#700-2024-04-04 for changelog