-
-
Notifications
You must be signed in to change notification settings - Fork 273
fix(vanilla, react): use experimental_use and some refactors #545
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
21 commits
Select commit
Hold shift + click to select a range
53d799d
feat: use experimental_use
dai-shi 05ebf63
fix and refactor defaultUse
dai-shi 10b8b6b
wip: disable experimental_use
dai-shi 10c57d0
Revert "wip: disable experimental_use"
dai-shi 11509c5
small refactor
dai-shi e5d1f03
simplify types
dai-shi 35ca1ea
fallback use outside render
dai-shi 5eaa309
revert to react@latest
dai-shi 9878289
Revert "revert to react@latest"
dai-shi 7f68e12
Revert "fallback use outside render"
dai-shi 6ec3ca5
use use recursively
dai-shi d451288
wip: avoid affectedToPathList
dai-shi 2045a9f
use custom affectedToPathList
dai-shi f2d76a2
revert to react@latest
dai-shi f3071fb
refactor
dai-shi f89e534
further refactor
dai-shi 934a028
update types/react and remove ts-ignore
dai-shi 8ed2378
Merge branch 'main' into feat/use-use-if-available
dai-shi d926e35
Merge branch 'main' into feat/use-use-if-available
dai-shi 346ac60
refactor with promise convension and better typing with awaited
dai-shi 36a8f1a
refactor a bit
dai-shi 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
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.
@dai-shi ahhh, okay, this change (skipping getters in the output of
affectedToPathList
) is why I've been confused.I've been watching the output of
useAffectedDebugValue
(maybe a little too religiously in retrospect) and was very confused by the lack of getters.This made me think "valtio is not working" / "doesn't know my getters were invoked", when obviously I could tell it did, b/c the re-renders still worked correctly.
I finally reproduced the behavior in
proxy-compare
and "get it"--getters (and method invocations) are always in the affected map, and are always handled correctly byisChanged
, it is merelyaffectedToPathList
that is leaving them off.What was the rationale here? I'm sure it makes sense, just curious b/c it tripped me up. Wondering if I can work the rationale/behavior in a doc/"gotchas" update.
Thanks!
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.
Without it, it loops infinitely and hangs, AFAIR.