Repository navigation
Conversation
Metro review: Looks goodRisk: low · Commit: With No findings. Verified
Not run: No benchmark. The extra file-map lookups in Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
Resolutions record where they found a `package.json`, but not that they read it, so a consumer can't tell that an edit to `main`, `browser` or `exports` changes the resolution. With `unstable_enablePackageExports` on, `DeltaCalculator` resets on any `package.json` change, which hides this - but not with it off, or once that reset is retired. Under `resolver.unstable_incrementalResolution`, this records the manifests a resolution reads in `content`, and `getPackage` reads through the file map: a manifest the file map doesn't have (outside every root, or blocklisted) is missing rather than read from disk unobserved, and `PackageCache` is keyed by its real path, so an edit to a manifest reached through a symlink evicts it. With the flag off, `getPackage` is unchanged. Changelog: Internal Test plan: Updated observation tests, and tests of a custom resolver reading manifests with the flag on and off. The watch-mode tests in #2289 change a package's `main` directly and through a symlinked workspace, and fail without this.
Context: The first three PRs of this stack fix some gaps in the
ObservationsAPI before we start consuming it forunstable_incrementalResolutionat the end of the stack.Resolutions record where they found a
package.json, but not that they read it, so a consumer can't tell that an edit tomain,browserorexportschanges the resolution. (We currently reset the whole graph anyway on anypackage.jsonchange, but this will allow us to replace that blunt instrument.)Under
resolver.unstable_incrementalResolution, this records the manifests a resolution reads incontent, andgetPackagereads through the file map. With the flag off,getPackageis unchanged.Changelog: Internal
Test plan:
Updated observation tests, and tests of a custom resolver reading manifests with the flag on and off. The watch-mode tests in #2289 change a package's
maindirectly and through a symlinked workspace, and fail without this.