-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
perf: shorcircuit resolve in ensure entry from url #12655
perf: shorcircuit resolve in ensure entry from url #12655
Conversation
Run & review this pull request in StackBlitz Codeflow. |
It seems that the module graph's resolver, and the import analysis's resolver differs slightly though: vite/packages/vite/src/node/server/index.ts Lines 374 to 376 in 9697e64
I'm not sure if it's safe to use the pre-resolved value 🤔 Might need to see tests when GH is back. |
You are right. The result of the two calls won't be exactly the same. The In importAnalysis we do We need This new About the |
Ok, seems there are known issues with the way |
Thanks for the writeup! That makes sense to me, if the assumption is that the resolved id should return the same meta, then we could give this a shot. |
Making this a draft so we avoid merging it yet. But I actually think that using the |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
I think we can move forward with this one. Even if the meta could be different, using the one from importAnalysis is closest to build time. Plugins should resolve the same meta for the same id though, we can't control how the module would be registered in the module graph first. |
The failures in vite-ecosystem-ci are the same as we see in main. I think our tests may be a bit flakier after merging this and the unresolvedUrlToModule cache PR, but IMO that is because we will be uncovering issues with the tests. |
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.
Let's give this a shot 👍
Description
Implement shortcuts based on this idea by @sapphi-red
Extracted from #12635
Using a private function to avoid extending the API yet. Maybe we should expose it if it could help Vitest or plugins in the future.
Perf should increase to #12635 (comment), if this PR and #12635 are merged.
What is the purpose of this pull request?