-
Notifications
You must be signed in to change notification settings - Fork 185
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
refactor: first class HMR support #795
Conversation
ALSO NEED TO TEST WITH WEBPACK |
|
Another thing to note: plugins will also work with Tailwind and intellisense (they can't be added through hooks as they won't be serialized in the function) - this could mean a few different things. One of the tests for this is failing where we have |
CHANGES NEEDED IN |
the update to nuxt/ui exposes a bug in resolveModulePaths as that respects nuxt.options._layers over installModule options. Plus, I see it ignore layers' inline configs too (maybe intentional) |
refer: nuxt/ui#1272, https://github.com/nuxt/ui-pro/pull/205
refer: c7fe392 |
…to first-class-hmr
I think I should change my approach and not use defu to merge updates with the fresh config but rather generate more code in the template. |
Wow. That worked surprisingly well - didn't even need to use knitwork. |
✅ Live Preview ready!
|
seems like https://github.com/unjs/c12?tab=readme-ov-file#watching-configuration was also an option... or maybe it wouldn't have worked the same way as we need to generate code after hook manipulation anyway. Will evaluate after working on #808 |
@benjamincanac would you be able to try this out with nuxt/ui using nightly? |
Hi @benjamincanac, I have tested this merge in my nuxt-ui sample app and tagged you here - #682 (comment). But, the repo that I used in my testing is not using the latest nuxt-ui, and doesn't use nuxt-ui-pro, so would be great if you can try this out on your end, thanks in advance. |
@ineshbose Just tried it out and encountered the same errors as @TechAkayy: Is there some breaking changes to take into account? I've made this draft PR if you want to try yourself: nuxt/ui#1397 |
Thanks for reporting @benjamincanac; I've pushed workaround/fix on the same PR. Lets continue discussion in #682. |
This reverts commit 25b9f9e.
resolves #682
Planned for 6.12.0.
This PR will be open for a while.Test on Stackblitz: https://stackblitz.com/github/nuxt-modules/tailwindcss/tree/first-class-hmr
Still very much in progress, but any efforts on testing this would be appreciated;there are a few issues like importing CJS/ESM/TS in one file, template reloading, merging strategy, etc..