-
Notifications
You must be signed in to change notification settings - Fork 206
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
refactor(swingset-vat): move VatData to new vat-data package #4603
Conversation
99131c7
to
83c9415
Compare
b061070
to
ac22ef2
Compare
ac22ef2
to
2691254
Compare
2691254
to
2c80ab1
Compare
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 like what I see. I don't have enough of an understanding of this to be the approver
interface KindDefiner { | ||
<P, S, K>( | ||
tag: string, | ||
init: (...args: P) => S, | ||
actualize: (state: S) => K, | ||
finish?: () => void, | ||
): (...args: P) => K; | ||
} |
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.
nice!
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.
the packages/xsnap stuff looks fine
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.
¡Muy bueno!
I'm late to the party here, but I've been trying to follow the following pattern when switching to exported types:
The solution to the first one is usually to have an Here |
closes: #4255 #4830
Description
For #4830 creates a new
@agoric/vat-data
package to hold the module that wraps theVatData
global so that a) it need not be deep-imported and b) it can be imported without depending on the whole@agoric/swingset-vat
package in builds. (Sourced only in devDependencies for use in tests.)For #4255 replaces the use of
globals.d.ts
with imports from that package.Shrinks the concessions needed for #4618 (comment)
Defines types for the VatData methods.
Security Considerations
This creates a layer of indirection to access the
VatData
methods. Whereas the caller previously would request it directly fromglobalThis
now it's requested from a module in a new package which exposes the global value, opening up a supply chain attack.Documentation Considerations
Increased documentation. Fully backwards compatible.
Testing Considerations
The package has new Ava tests. It also has a type test at
src/index.test-d.js
per the pattern in https://github.com/SamVerschueren/tsd, though it doesn't make use of the tsd helpers or runner.