-
Notifications
You must be signed in to change notification settings - Fork 53
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
Multi-expression selection #275
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eab4711
doc: update some docs
Vtec234 d38e48a
refactor: move state down into goal component
Vtec234 d528800
feat: collapsible `case`s
Vtec234 f9cef2a
feat: multi-expression contexts
Vtec234 4fe0946
fix: selection fixes
Vtec234 35bf7a8
feat: match new goal types
Vtec234 049843a
feat: make names selectable
Vtec234 4ca3d7f
chore: lint
Vtec234 c43cb36
feat: fix many bugs and memoize
Vtec234 10932c2
fix: React prop
Vtec234 b501559
feat: export dynamic importer
Vtec234 3c26b0a
chore: bump package versions
Vtec234 f63862e
fix: ensure InteractiveCode uses code font
Vtec234 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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.
Is there a reason we can't just use
T | null
in the interface types instead?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, but this is the least invasive change which doesn't require all downstream code to check for
!== null
(or use truthish checks). IMO this is justified becausenull
vsundefined
is one of the many bizarre parts of JS with unclear semantics and it is easier to stick to always usingundefined
.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.
One concrete case where this pops up is with
getInteractiveGoals
.If we keep
null
, then the easy fix would be to add a?? undefined
to the use site. But convertingnull
toundefined
seems convenient as well.Note that we run into exactly the same issue with
Option Foo
, where theToJson
instance producesnull
. For consistency it might be better to avoid any special case hacks here (since it gives the incorrect impression thatT | undefined
is the correct RPC API forOption T
).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.
Ahhh, you correctly point out that our entire RPC API is wrong. We serialize structure fields marked with the magic
?
as missing similarly to Serde'sskip_serializing_if
. In JS accessing those fields givesundefined
. But we cannot do this for top-level values as there is only anull
but noundefined
in JSON. For exampleso all the top-level
Option SomeResponse
calls really returnT | null
. In this case I guess we should go through the whole API and adjust it, and make a breaking release. Let's do this in another PR however, and temporarily keep the hack.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.
Sounds good to me.