This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
setState suspension #183
Merged
ZoteTheMighty
merged 29 commits into
Roblox:new-reconciler
from
ZoteTheMighty:setstate-suspension
Feb 27, 2019
Merged
setState suspension #183
ZoteTheMighty
merged 29 commits into
Roblox:new-reconciler
from
ZoteTheMighty:setstate-suspension
Feb 27, 2019
Conversation
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
…ing tests and sticking points with getDerivedStateFromProps
…weird organizational compromises to do so, will have to revisit
…t's causing us to lose None values
…low subsequent setStates
ZoteTheMighty
requested review from
AmaranthineCodices and
LPGhatguy
and removed request for
AmaranthineCodices
February 20, 2019 01:43
I'd still like to add more tests, but this is starting to get to a place where I'd like some eyes on it and some feedback. The challenging bits were with Also, better method name suggestions are always welcome. |
…t cases (on pre-init empty state as well as on setState called in init)
…hrowing an error in an enumerated set of cases
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #180.
Work in progress for
setState
suspension. So far I've gotten a quick'n'dirty implementation in, and I've culled the similar functionality fromSingleEventManager
.Wondering if a slightly better approach would just be to track all lifecycle states as one big enumerated set and then, in
setState
, granularly react based on it. (e.g.if lifecyclePhase == shouldUpdate or lifecyclePhase == willUpdate or...
). Then when we are supposed to error, we can do so with the name known. Not that different from trackingsetStateBlockedReason
as we did previously.Also, fixes a broken test from before (not sure how this happened) where
createFragment
wasn't added to the public api test.Some basic tests are written, but more need to be written for cases like:
setState
aborting (via functionalsetState
) functionalitygetDerivedStateFromProps
Checklist before submitting:
CHANGELOG.md
setState
suspension somewhere in the docs)