fix(common): fix @endo/common integration breakage #1963
Merged
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.
closes: #XXXX
refs: #1935
Description
#1935 broke the agoric-sdk integration tests, i.e., would have broke integration with agoric-sdk . To repair the problem, this PR
index.js
file which rolled up all the exports together"exports":
to use the same export name as the source file it exports, so that imports are the same whether processed by a tool that understands"exports":
or not.Security Considerations
none
Scaling Considerations
By forcing importers to import only from the exporting file they need, some implementations (bundlers, packagers) can do tree-shaking, omitting code not reachable from imports. For
@endo/common
specifically, the savings are tiny. But the pattern could bring substantial savings elsewhere.Documentation Considerations
nothing interesting
Testing Considerations
none
Upgrade Considerations
The old exports prior to #1935 that were exporting some of these, for compat, still reexports these. But it deprecates those reexports, with advice that importers do a deep import directly from
@endo/common/...
. Thus, this PR should not have any compat issues compared to the state preceding #1935.This PR is technically a compat break with #1935 itself. But #1935 was just merged and never released, so that is not a source of worry.