-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: avoid some unnecessary bundling in vaultFactory etc. #7169
Conversation
Datadog ReportBranch report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* | ||
* @type {typeof import('@agoric/ertp').AssetKind.NAT} | ||
*/ | ||
const NAT = 'nat'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move AssetKind to agoric/internal to not duplicate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep wondering about something like @agoric/ertp/constants
, but I'm not inclined to mess with the ERTP package API just now.
In the Java world, I gather it's conventional to provide a -api.jar
separate from the main implementation .jar
file for things like this. I keep wondering about analogs in the JS world... but I guess the JS norm is to just leave it to tree-shaking tools..
Use static type check and unit tests rather than runtime import to avoid bundling all of ERTP just to get, for example, Stable.symbol.
refs: #6687
Description
binaryVoteCounter.js
contract inbundle-vaultFactory.js
import { Stable, Staking } from 'tokens.js';
.Discovered while auditing bootstrap contents (#6687, #7049).
Scaling Considerations
slightly smaller bundle size:
Testing Considerations
Moved
assertKeywordName(Stable.symbol)
and the like from a runtime check to a unit test.