Fix CSS updates when adding/removing style tags#15133
Merged
Conversation
🦋 Changeset detectedLatest commit: bc70d76 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 |
Contributor
|
| 📦 Package | 🔒 Before | 🔓 After |
|---|---|---|
| @cloudflare/kv-asset-handler | trusted-with-provenance | none |
| @cloudflare/unenv-preset | trusted-with-provenance | none |
| workerd | trusted-with-provenance | none |
| @sveltejs/vite-plugin-svelte-inspector | trusted-with-provenance | provenance |
| @sveltejs/vite-plugin-svelte | trusted-with-provenance | provenance |
| miniflare | trusted-with-provenance | none |
| youch | provenance | none |
| @cloudflare/workerd-darwin-64 | trusted-with-provenance | none |
| @cloudflare/workerd-darwin-arm64 | trusted-with-provenance | none |
| @cloudflare/workerd-linux-64 | trusted-with-provenance | none |
| @cloudflare/workerd-linux-arm64 | trusted-with-provenance | none |
| @cloudflare/workerd-windows-64 | trusted-with-provenance | none |
| wrangler | trusted-with-provenance | none |
10 tasks
Merging this PR will degrade performance by 17.07%
Performance Changes
Comparing |
An error occurred while trying to automatically change base from
next
to
main
January 30, 2026 17:31
Contributor
|
This was reported here: #15384 |
ematipico
approved these changes
Feb 4, 2026
matthewp
approved these changes
Feb 4, 2026
Contributor
|
Streaming regression is odd. Going to rerun it. |
Contributor
|
It was only a .2ms diff, ignored. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Initially reported on Discord, this PR fixes an issue where adding or removing
<style>tags in Astro components would result in no visual update of styles during development, unless the dev server was restarted.astro:hmr-reloadVite plugin, if one of the invalidated modules is the virtual module of a page, the associated virtual module for a dev CSS import is not invalidated.vite-plugin-csshotUpdateplugin hook as initially suggested by Matthew as it would require recursively checking all modules importers for page virtual modules, whereas a similar recursion is already done when callinginvalidateModule()which gives us back the list all affected modules that we can iterate over.Open to suggestions as I may not have the full context over the new
vite-plugin-cssimplementation and may have gone about this the wrong way.Testing
I added new E2E tests to simulate adding and removing style tags in an Astro component and verifying that the styles are updated.
Docs
This is a bug fix; no doc updates are needed.