Repository navigation
Draft
Conversation
…o resolver-observed paths With `resolver.unstable_incrementalResolution` on, resolutions have recorded what they observed since #1949, with the plan to consume those observations to invalidate resolution. This adds the consumer. `Graph` keeps what each module's resolutions observed (carried on `ModuleData`), and `DeltaCalculator` turns each batch of changes into the modules to revisit, before it filters to modules already in the graph. Modules holding an unresolved optional dependency are revisited on any addition or removal, or `package.json` change. Graph resets on symlink and (with package exports on) `package.json` changes, and clearing the resolution cache on every change, are unchanged. ## Performance The priority here is correct, end-to-end behaviour - it's neither fast nor memory efficient, but that's not a concern while it's flagged off. We'll optimise as follow-ups before stabilising the flag, but I'm leaving optimisations out at this stage to avoid bloating these already large PRs. That said, with this first version, enabling incremental resolution adds ~35% to pure resolution time (recording alone, as since #1949, adds ~20%) and ~6-7x the resolution cache's heap. I'd expect both to be small in the context of a real build, but haven't measured that, or the scan on each change. (For the record: reducing the ingested paths so that we don't store every extension candidate, and deferring ingestion until after a build, are planned.) ## Changelog ``` - **[Experimental]**: `resolver.unstable_incrementalResolution` is now implemented end-to-end ``` ## Test plan New unit tests for the index, `Graph` and `DeltaCalculator`, and watch-mode integration tests against a real file map that check the next delta after creating a more specific platform file, installing a nearer package, creating the file a failed optional `require` wanted, and changing a package's `main` (directly, through a symlinked workspace, and to fix a failed optional `require`).
This branch has not been deployed
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.
With
resolver.unstable_incrementalResolutionon, resolutions have recorded what they observed since #1949, with the plan to consume those observations to invalidate resolution. This adds the consumer.Graphkeeps what each module's resolutions observed (carried onModuleData), andDeltaCalculatorturns each batch of changes into the modules to revisit, before it filters to modules already in the graph. Modules holding an unresolved optional dependency are revisited on any addition or removal, orpackage.jsonchange. Graph resets on symlink and (with package exports on)package.jsonchanges, and clearing the resolution cache on every change, are unchanged.Performance
The priority here is correct, end-to-end behaviour - it's neither fast nor memory efficient, but that's not a concern while it's flagged off. We'll optimise as follow-ups before stabilising the flag, but I'm leaving optimisations out at this stage to avoid bloating these already large PRs.
That said, with this first version, enabling incremental resolution adds ~35% to pure resolution time (recording alone, as since #1949, adds ~20%) and ~6-7x the resolution cache's heap. I'd expect both to be small in the context of a real build, but haven't measured that, or the scan on each change.
(For the record: reducing the ingested paths so that we don't store every extension candidate, and deferring ingestion until after a build, are planned.)
Changelog
Test plan
New unit tests for the index,
GraphandDeltaCalculator, and watch-mode integration tests against a real file map that check the next delta after creating a more specific platform file, installing a nearer package, creating the file a failed optionalrequirewanted, and changing a package'smain(directly, through a symlinked workspace, and to fix a failed optionalrequire).