forked from endojs/endo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compartment-mapper): Take only first matching tag of package expo…
…rts (endojs#2275) Closes: endojs#2276 ## Description If a `package.json` `"exports"` is a list of ordered constraints, Endo’s Compartment Mapper currently uses all of the accepted entries and not just the first. This causes subsequent entries to override the first if they produce matching paths. I believe the intended behavior is to use the first that matches. ### Security Considerations This amounts to a difference in behavior between Endo and Node in the treatment of Package Exports. ### Scaling Considerations None. ### Documentation Considerations Fixing this issue will bring Endo into accord with Node.js’s somewhat light documentation on this feature. ### Testing Considerations Existing snapshot tests cover the behavior and must be updated to reflect the correct interpretation. ### Compatibility Considerations This will improve ecosystem compatibility. No known bundles depend on the existing behavior, but we cannot rule out the possibility. There is a possibility that this change will break existing bundles that depend on the current erroneous behavior, for example preferring `default` over an `endo` tag. I am considering this a bugfix and not a breaking change since it is a bug to rely on the current behavior. ### Upgrade Considerations Even if this behavior might break the bundling process for existing contracts, it will not invalidate existing bundles. This change should not break upgrades but may create a speed bump for upgrading tool dependencies.
- Loading branch information
Showing
4 changed files
with
30 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Binary file modified
BIN
+42 Bytes
(100%)
packages/compartment-mapper/test/snapshots/infer-exports.test.js.snap
Binary file not shown.