-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
useMutableSource hook #18000
Merged
Merged
useMutableSource hook #18000
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
0eb26dd
useMutableSource hook
8e751b2
Refactored useMutableSource to use update queue
06a571e
Changed subscribe callback signature to not require the latest snapsh…
2caa4e9
Handle errors that occur during eager snapshot evaluation
6263c97
Fixed a typo/bug in setState updater function
905a9c0
Avoid deopt on changed getSnapshot function unless snapshot also changes
112ace4
Read mutable source composed hooks from current dispatcher
6d1dd6a
Split useMutableSource tests into separate suite
73b2628
Refactor useMutableSource to be more efficient
5f37cba
Added createMutableSource and useMutableSource exports to new ES entr…
8f16725
Added React debug tools test for new hook
8596425
Added a (disabled) test to cover uSM throwing during sync update
bf9025b
Use a second effect to sync getSnapshot and stateHook values on commit
38a2044
Always reset state queue when getSnapshot changes
bf8949e
Always treat reads from source as unsafe when getSnapshot changes
f231a4b
Pass underlying source to getVersion fn
0c61fed
Removed unused 'isMount' param from uMS
160b0a5
Misc. cleanup
7327787
Whitespace only change
9c6dd03
Reenabled a pending disabled mutable source test
cd2ef30
Removed createMutableSource and useMutableSource exports from React s…
153a8f1
Defer getWorkInProgressRoot() call unless root is needed
293aa74
Misc. cleanup
aa46144
Replaced .warn() with .error() for mutable source unsubscribe check
0ef4bdb
Added an additional muti renderer test
45ed506
Added new failing tests (pending a separate fix to React)
dee1164
Merged master and resolved useEvent conflicts
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 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
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.
Note to self: This isn't quite right, since it might return a copy of the data that's too new.
This probably doesn't matter though. The debug hooks aren't really accurate anyway at the moment (e.g.
useCallback
always returns a new function too). Since rendering is shallow it shouldn't really make a difference.I'm going to just assumet his doesn't matter.