-
Notifications
You must be signed in to change notification settings - Fork 81
1488 Passable (REVERTED in #1961) #1933
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e6d6984
test: isFake type
turadg 935718b
chore(types): type makeTagged
turadg ae6ad15
feat(types): generic Passable
turadg 81aced1
chore(patterns): define Key using parameterized Passable
dckc 418b2da
chore(types): misc accommodations
turadg ddcdad1
chore(types): consolidate PassStyled type
turadg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ import { | |
|
|
||
| /** @typedef {import('@endo/pass-style').Passable} Passable */ | ||
| /** @typedef {import('./types.js').Encoding} Encoding */ | ||
| /** @typedef {import('@endo/pass-style').Remotable} Remotable */ | ||
| /** @typedef {import('@endo/pass-style').RemotableObject} RemotableObject */ | ||
| /** @typedef {import('./types.js').EncodingUnion} EncodingUnion */ | ||
|
|
||
| const { ownKeys } = Reflect; | ||
|
|
@@ -62,7 +62,7 @@ const qclassMatches = (encoded, qclass) => | |
| /** | ||
| * @typedef {object} EncodeToCapDataOptions | ||
| * @property {( | ||
| * remotable: Remotable, | ||
| * remotable: RemotableObject, | ||
| * encodeRecur: (p: Passable) => Encoding | ||
| * ) => Encoding} [encodeRemotableToCapData] | ||
| * @property {( | ||
|
|
@@ -117,7 +117,7 @@ export const makeEncodeToCapData = (encodeOptions = {}) => { | |
| * Readers must not care about this order anyway. We impose this requirement | ||
| * mainly to reduce non-determinism exposed outside a vat. | ||
| * | ||
| * @param {Passable} passable | ||
| * @param {any} passable | ||
| * @returns {Encoding} except that `encodeToCapData` does not generally | ||
| * `harden` this result before returning. Rather, `encodeToCapData` is not | ||
| * directly exposed. | ||
|
|
@@ -269,11 +269,11 @@ harden(makeEncodeToCapData); | |
| * @property {( | ||
| * encodedRemotable: Encoding, | ||
| * decodeRecur: (e: Encoding) => Passable | ||
| * ) => (Promise|Remotable)} [decodeRemotableFromCapData] | ||
| * ) => (Promise|RemotableObject)} [decodeRemotableFromCapData] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for doing this type renaming. Having a type name collide with a value (function) name was really terrible. Good to see this straightened out. No change suggested. |
||
| * @property {( | ||
| * encodedPromise: Encoding, | ||
| * decodeRecur: (e: Encoding) => Passable | ||
| * ) => (Promise|Remotable)} [decodePromiseFromCapData] | ||
| * ) => (Promise|RemotableObject)} [decodePromiseFromCapData] | ||
| * @property {( | ||
| * encodedError: Encoding, | ||
| * decodeRecur: (e: Encoding) => Passable | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
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.
Curious: Why did this "regress" from
Passabletoany?(scare quotes because the old
Passablemeantany. So the real question is: Why couldn't this become the newPassable?)Likewise for similar changes elsewhere.
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.
All the string replacements of old-Passable to
anyis because the new (non-any) Passable caused too many errors and I judged solving them to not be worth it. Usually because the following code relied heavily on dynamic type inspection and would not benefit from the static type information. This was mostly inswitchstatements where TS cannot statically infer the type narrowing being used.