-
-
Notifications
You must be signed in to change notification settings - Fork 2.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: is self accepting
pt 2 module graph boogaloo
#2872
Fix: is self accepting
pt 2 module graph boogaloo
#2872
Conversation
🦋 Changeset detectedLatest commit: 9adf746 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Vite modules can be out-of-date when using an un-resolved url | ||
// We also encountered inconsistencies when using the resolveUrl and resolveId helpers | ||
// We've found that pulling the ID directly from the urlToModuleMap is the most stable! | ||
const id = viteServer.moduleGraph.urlToModuleMap.get(renderer.serverEntrypoint)?.id ?? renderer.serverEntrypoint; | ||
const mod = (await viteServer.ssrLoadModule(id)) as { default: SSRLoadedRenderer['ssr'] }; |
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 looks much more straight-forward. I'm pleased if all works well!
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.
LGTM!
* fix: isSelfAccepting Preact error * refactor: add .js ext to preact entrypoints for consistency * chore: changeset * fix: remove ./client and ./server from preact pkg exp
Changes
.js
extensions to Preact entrypoints for consistencyurlToModuleMap
directly. This avoids any calls toensureEntryFromUrl
, which was causing the module to be loaded twice?v=
version param everytime. This means... no need for a cache 😁Testing
Docs
N/A