-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
breaking: overhaul proxies, remove $state.is
#12916
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 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
deda52e
chore: use closures for state proxies
Rich-Harris b9068c3
use variables
Rich-Harris 2e53be2
early return
Rich-Harris e98ac36
tidy up
Rich-Harris 95f0fea
move ownership stuff into separate object
Rich-Harris abddd22
put original value directly on STATE_SYMBOL
Rich-Harris 8caecbe
rename
Rich-Harris bdf60ce
tidy up
Rich-Harris 8f3aad4
tidy
Rich-Harris 39d5bb1
tweak
Rich-Harris 351afa8
fix
Rich-Harris 7804949
remove is_frozen check
Rich-Harris ab6b354
remove `$state.is`
Rich-Harris 810817a
avoid mutations
Rich-Harris f914df7
tweak
Rich-Harris 006d982
changesets
Rich-Harris 07716f6
changeset
Rich-Harris 4e06fa2
changeset
Rich-Harris cc991d0
regenerate
Rich-Harris c738371
add comment
Rich-Harris 03fbfa7
add note
Rich-Harris 689d367
add test
Rich-Harris 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
tweak
- Loading branch information
commit f914df732e7a47cafef1ce9c52c690af812d7306
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
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.
would be good to have a comment here explaining why we have this restriction
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.
Thanks for the comment - reading up on the invariants, can we relax/change this validation? IIUC we only need to disallow non-configurable properties, because they need to appear as such on the target, too. On the other hand, we cannot allow it at all if the target is no extensible and doesn't contain this property
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 invariant is correct. We also can’t support non enumerable properties or non-writable because then we need extra overhead to store the extra descriptor info per lookup. See the pr that this came from for context.
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.
Fair enough - for future reference, this is where it original came up: #12847 (comment)
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.
Thanks for that, was on mobile earlier so couldn't link it.