-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: store backwards compatible ssrModule
and ssrError
#18031
fix: store backwards compatible ssrModule
and ssrError
#18031
Conversation
|
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, astro, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, redwoodjs, storybook, unocss, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress, vuepress |
@@ -137,6 +137,7 @@ export async function fetchModule( | |||
return { | |||
code: result.code, | |||
file: mod.file, | |||
serverId: mod.id!, |
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.
This is awesome! So good to see Astro working 🎉
Could this be called id
directly? Is the id in the runner different than the one in the server?
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.
Yes, they are different. Not intentionally, really. An artifact from vite-node that I am too afraid to change 😄
The ID in the module runner is the URL on the server module graph. The module runner caches by urls so it's easier to keep track of, it doesn't have multiple cache maps. It's also more similar to how browser caches urls, I guess.
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.
Ok, let's merge this. Ok, if this is part of the public API for ModuleRunner. I'm thinking that we could maybe use url
then everywhere we have id
in the runner? 🤔
And then serverId
can be just id
.
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.
Yeah, I think so
Description
The previous
ssrLoadModule
compat layer only stored the entry point'sssrModule
, this cases issues with astro.This PR makes it so that every time the module is requested, we store the
ssrModule
value on the server's moduleGraph.