-
Notifications
You must be signed in to change notification settings - Fork 77
feat(pass-style): add selector #2774
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
Conversation
What's a selector? |
OCapN Selector corresponds to Syrup symbol and Scheme symbol. Because we can’t use JavaScript symbols (risk of registry stuffing attacks), MarkM insisted we give this a distinguishing name. It follows that it should have its own passStyle, which should replace symbols entirely in the long run. https://github.com/ocapn/ocapn/blob/main/draft-specifications/Model.md#selector |
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.
@@ -22,7 +22,7 @@ export type PrimitiveStyle = | |||
| 'string' | |||
| 'symbol'; | |||
|
|||
export type ContainerStyle = 'copyRecord' | 'copyArray' | 'tagged'; | |||
export type ContainerStyle = 'copyRecord' | 'copyArray' | 'tagged' | 'selector'; |
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 don’t believe selector qualifies as a container. It’s more like a string. But, the reïfication of a selector is an object, so that might be the distinguishing feature for containers. I do not know.
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.
its a container for a string! yeah ok was mostly just following 'tagged' around the code base
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.
It's definitely not a container. Our best documentation is at https://endojs.github.io/endo/types/_endo_pass_style.Passable.html , and we could describe Selector as primitive if we're taking a data model perspective, or otherwise a new special case (because, unlike the existing primitives, Object.is
will differentiate identical values).
@@ -31,7 +31,7 @@ export type PassStyle = | |||
| 'error' | |||
| 'promise'; | |||
|
|||
export type TaggedOrRemotable = 'tagged' | 'remotable'; | |||
export type TaggedOrRemotable = 'tagged' | 'selector' | 'remotable'; |
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.
Selector definitely does not belong in this union.
is the concern here only from using here is an example showing a
|
Seeing this thread, I realize I gave you bad advise. Selector is like Tagged in some ways, but is like Symbol in other ways. I'll make a PR staged on this one as my corrected review suggestions. Hold on.
Would be an interesting experiment, but I don't expect it to be a better solution than what this PR is attempting. |
Thanks for the great idea, and sorry for how long it took for me to get it. |
closed for #2777 |
No description provided.