module: cache deserialized package scopes - #65812
Open
gurgunday wants to merge 1 commit into
Open
Conversation
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day> Assisted-by: Codex
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65812 +/- ##
==========================================
+ Coverage 90.14% 90.18% +0.03%
==========================================
Files 769 770 +1
Lines 262968 264430 +1462
Branches 50060 50241 +181
==========================================
+ Hits 237057 238466 +1409
- Misses 16932 16973 +41
- Partials 8979 8991 +12
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ESM loading repeatedly deserializes the same package configuration when resolving package imports and determining the format of relative
.jsimports. Spreading the configuration invokes its lazy getters, reparsing theimportsandexportsmaps on each lookupCache the deserialized configuration by package.json path and reuse it when the serialized fields are unchanged. Each lookup still calls the existing loader method, so live VFS changes and errors remain visible. VFS unmounting clears the cache, and callers continue to receive separate result wrappers.
Measured on an Apple M5 Pro. Inspired by/continues the work of #60425.