fix: correctly resolve hmr dep ids and fallback to url #18840
fix: correctly resolve hmr dep ids and fallback to url #18840patak-cat merged 10 commits intovitejs:mainfrom
Conversation
|
Thank you for the PR!
I think there are two ways to fix the issue. The first is to make The second is to make the IIUC this PR makes |
|
hi, alright, I think it should accept Ids, since the imports can be transformed based on imported and specifier. i think meta.hot.accept should do the same. is it necessary a breaking change? I did not find that its documented to use url for deps. |
7b43c21 to
c7d118a
Compare
c7d118a to
0ba0ae5
Compare
|
@sapphi-red this is now passing and still uses urls, but tries first to resolve the module via resolveId and then uses the resolved module.url. on meta.hot.accept:
|
|
@sapphi-red does this look okay now? |
Co-authored-by: 翠 / green <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
I looked at vitest failure. vitest is currently failing on main |
This comment was marked as outdated.
This comment was marked as outdated.
|
@patricklx Would you also describe where you needed to use |
Co-authored-by: 翠 / green <[email protected]>
I have a vite plugin that generates virtual files which can also change depending on other files on the filesystem. |
Is self-accepting on the virtual module side (i.e. call |
Maybe we could add back the URL fallback in the next minor if we're clear that this is just for backward compat and we'll move to a warning on Vite v7. |
|
So, should i add back the fallback then? |
|
Yeah. Would you add back the fallback with a comment that this is just for backward compat and will remove it in Vite 7? |
0db7f02 to
d5d7b94
Compare
I added the change |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as outdated.
This comment was marked as outdated.
The fallback does not seem to be working
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
/ecosystem-ci run |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
📝 Ran ecosystem CI on
✅ analogjs, astro, ladle, nuxt, previewjs, quasar, qwik, rakkas, storybook, sveltekit, unocss, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-vue, vite-setup-catalogue, vitepress, vitest, vuepress |
|
@sapphi-red anything left todo here? |
|
@patricklx things look good! thanks! we'll merge this PR once we start the 6.1 beta (soon). |
Co-authored-by: 翠 / green <[email protected]>
Description
fixes #12912
fixes #16375
this is the most basic to get it working. There are more issues regarding this, like having multiple modules in the module graph. one for
0virtual:fileand another for/@id/__00__/virtual:file