Skip to content
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

fix(variant-group): hmr in vite #3741

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Simon-He95
Copy link
Contributor

close: #3518

@Simon-He95 Simon-He95 requested a review from antfu as a code owner April 18, 2024 04:04
Copy link

netlify bot commented Apr 18, 2024

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1fb731e
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/662a619d3fc9790008257c68
😎 Deploy Preview https://deploy-preview-3741--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu
Copy link
Member

antfu commented Apr 18, 2024

I am not sure about it - can you explain a bit more about the problem and why this would be helpful?

@Simon-He95
Copy link
Contributor Author

I am not sure about it - can you explain a bit more about the problem and why this would be helpful?
The affectedModules themselves collect all the ids that need to be updated, but our HMR needs to filter these ids based on the clientImportedModules that depend on them, which should enable on-demand updates

@Simon-He95
Copy link
Contributor Author

Morning, @antfu
I have a question, should we only hot update the current file, or the current file and its sub-files? If it is the current file, there is no need to add ctx.affectedModules.add(id) to the transformerVariantGroup. If necessary, it should Filter all changed pages based on dependencies on the current page

@Simon-He95
Copy link
Contributor Author

I feel that there is no need to add ctx.affectedModules.add(id) in transformerVariantGroup, because if you modify the hasChanged file, this plug-in will be used. If you do not modify the hasChanged file, it will also trigger the style update of uno.css.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vue2/3 keep-alive + transformerVariantGroup hmr error
2 participants