-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
fix: replace runner-side path normalization with fetchModule
-side resolve
#18361
fix: replace runner-side path normalization with fetchModule
-side resolve
#18361
Conversation
Run & review this pull request in StackBlitz Codeflow. |
bb8c402
to
5e8e7ec
Compare
fetchModule
fetchModule
|
packages/vite/src/node/ssr/runtime/__tests__/fixtures/dynamic-import.js
Outdated
Show resolved
Hide resolved
packages/vite/src/node/ssr/runtime/__tests__/fixtures/dynamic-import.js
Outdated
Show resolved
Hide resolved
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.
This comment was marked as outdated.
This comment was marked as outdated.
fetchModule
fetchModule
fetchModule
fetchModule
resolve
272e729
to
06d820e
Compare
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, astro, ladle, laravel, marko, previewjs, quasar, qwik, rakkas, storybook, sveltekit, unocss, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress, vitest, vuepress |
/** | ||
* Root of the project | ||
* @deprecated not used anymore and to be removed | ||
*/ | ||
root: string | ||
root?: 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.
Since root
is deprecated and does not need to be set anymore, I think we can remove root
from all the examples and types in the docs.
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.
Makes sense. Updated the docs and also removed the internal usages of root.
I kept the default server runner one since users can technically access it via runner.options.root
.
@hi-ogawa Do you think this can be released in a patch? or do you prefer it to be released in a minor to be safe? |
I think we can go as patch. |
Hi there, can I get an estimate about the release time? |
@dai-shi Probably I'll cut a release in few days 🫡 |
| datasource | package | from | to | | ---------- | ------- | ----- | ----- | | npm | vite | 6.0.5 | 6.0.6 | ## [v6.0.6](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small606-2024-12-26-small) - fix: replace runner-side path normalization with `fetchModule`-side resolve ([#18361](vitejs/vite#18361)) ([9f10261](vitejs/vite@9f10261)), closes [#18361](vitejs/vite#18361) - fix(css): resolve style tags in HTML files correctly for lightningcss ([#19001](vitejs/vite#19001)) ([afff05c](vitejs/vite@afff05c)), closes [#19001](vitejs/vite#19001) - fix(css): show correct error when unknown placeholder is used for CSS modules pattern in lightningcs ([9290d85](vitejs/vite@9290d85)), closes [#19070](vitejs/vite#19070) - fix(resolve): handle package.json with UTF-8 BOM ([#19000](vitejs/vite#19000)) ([902567a](vitejs/vite@902567a)), closes [#19000](vitejs/vite#19000) - fix(ssrTransform): preserve line offset when transforming imports ([#19004](vitejs/vite#19004)) ([1aa434e](vitejs/vite@1aa434e)), closes [#19004](vitejs/vite#19004) - chore: fix typo in comment ([#19067](vitejs/vite#19067)) ([eb06ec3](vitejs/vite@eb06ec3)), closes [#19067](vitejs/vite#19067) - chore: update comment about `build.target` ([#19047](vitejs/vite#19047)) ([0e9e81f](vitejs/vite@0e9e81f)), closes [#19047](vitejs/vite#19047) - revert: unpin esbuild version ([#19043](vitejs/vite#19043)) ([8bfe247](vitejs/vite@8bfe247)), closes [#19043](vitejs/vite#19043) - test(ssr): test virtual module with query ([#19044](vitejs/vite#19044)) ([a1f4b46](vitejs/vite@a1f4b46)), closes [#19044](vitejs/vite#19044)
This reverts commit f6f53be.
Blocking issues: - [x] `polyfillModulePreload is deprecated. Use modulePreload.polyfill instead. (x6)` - [x] rscRsdwPlugin parse code is somehow incorrect, I think the code it receives is already a bundlered code, that's why `const index = code.indexOf('function requireAsyncModule(id)');` will get `-1` - [x] vite issue. vitejs/vite#18361 - [x] no styling in dev. 21_create-pages_standalone spec fails. - [x] react-error-boundary. ssr-catch-error spec fails. Other issues: - [x] proper fix for `resolve.conditions` hack - [x] proper fix for `vite-loader.ts` hack - [ ] drop `viteServer.hot`. #1012 (comment) --------- Co-authored-by: daishi <daishi@axlight.com> Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com> Co-authored-by: Tyler <26290074+thegitduck@users.noreply.github.com>
Description
Not so confident that this is a proper fix nor the issue needs fix, but I'm thinking about what would require to support #18223 and hopefully it helps deciding the fate of the issue (bug or wontfix).
One thing I noticed that it looks possible to dedupe/normalize
/abs-path-to/src/etc -> /src/etc
on server side (fetchModule
) and module identity is still kept intact on runner side since they are keyed by resolved id. ForFetchModuleResult.cache
detection, I replacedgetModuleByUrl
withensureEntryFromUrl
and I'm wondering what's the downside of this.todo
file://
support (resolved in feat!: supportfile://
resolution #18422)