-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Replace internal cssScopeTo implementation to vite.cssScopeTo #13347
Conversation
🦋 Changeset detectedLatest commit: f96fb98 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 |
CodSpeed Performance ReportMerging #13347 will not alter performanceComparing Summary
|
Considering the change in behaviour, as you explained in the test section, should we make it a patch or a minor and explain the new behaviour? Users will see more CSS files, so we should let them know about the new algorithm. |
I think in most cases users wouldn't have to bother or would notice this change, so I think it's ok to not mention anything. But if we want to add a changeset, a patch should be good enough since it doesn't require a lot of action from the user. |
That's true in most cases, however I've seen users complaining about chunks emitted by a change of a build. I also think few people surgically cache these kinds of assets. So yeah, even if the majority of the users don't care, there are still few that would need an explanation of the change.
I agree! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
…tro#13347) * Replace internal cssScopeTo implementation to vite.cssScopeTo * Fix test * Fix more tests * Again * Again :( * Fix weird name * Add changeset
Changes
Vite 6.2 has builtin support for treeshaking scoped CSS (vitejs/vite#19418) which we can use to replace our internal implementation copy before.
Testing
Existing tests should pass. There's added test in the past from #10291. If CI fails, maybe there's a bug in Vite.
EDIT: The new behaviour will now properly place scoped styles into its own chunk so that it's only loaded by pages that uses the component's scoped styles. This means the CSS is more granular and accurately loaded, but results in slightly more CSS chunks which causes some tests that did not anticipate it to fail. I've made fixes to the tests for these cases.
Docs
n/a. Shouldn't require a changeset as it's an internal refactor.