-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
dev server: handle hmr and css importer persistence #7389
Conversation
🦋 Changeset detectedLatest commit: 6ea203c The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
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.
PR Overview
This PR fixes a bug where CSS imports lose their persistence after an HMR reload by tracking CSS importers more accurately.
- Updated the changeset to indicate a patch release.
- Introduced a new Set to track CSS importers post-HMR reload.
- Modified the injection logic by ensuring CSS files imported by CSS are not redundantly re-injected.
Reviewed Changes
File | Description |
---|---|
.changeset/quiet-flowers-divide.md | Updates changeset with release note for the patch. |
packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts | Adds logic to track and check CSS importers to maintain HMR persistence. |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts:90
- [nitpick] The variable name 'cssImportedByCSS' is somewhat ambiguous. Consider renaming it to a more descriptive name such as 'persistentCssImports' to clearly convey its purpose.
const cssImportedByCSS = new Set<string>();
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.
Lgtm
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.
On HMR reload (still initial render), css imports are losing their persistence. Currently top level css imports think they are not top level after an hmr refresh, this set keeps track of that.
What is it?
Description
Checklist
pnpm change