-
Notifications
You must be signed in to change notification settings - Fork 5
feat: insert child machine trees into parent tree #2
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
Conversation
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
TODO: - Clean it up a ton - Child machines append their state multiple times, might need to change to a Map() or something?
Still needs some cleanup and settling on structure, but getting there. Seems like this might break if the parent transitions w/o a child transition though, probably need to cache the values from child machines and re-apply them if the parent changes?
Need to figure out how child machine updates can trigger a re-creation of parent node states. Other option would be to enforce that all children need to be reconciled before running the parent machine walk, which is an interesting concept but feels dangerous somehow?
Using p-cancelable to allow for cancelling a walk if a new walk request comes in for the same machine. Maybe could lead to slower UI responsiveness? Seems worth it for less spammy output and potential UI churn IMO.
- Reworked tree helper to give access to ALL built trees, mostly for debugging tests - Also broke deferred out, just in case TODO: other snapshots are failing due to change in the output format
Mostly by re-throwing any non-cancellation errors for consumers to deal with.
BREAKING CHANGE
Codecov Report
@@ Coverage Diff @@
## master #2 +/- ##
=========================================
Coverage ? 98.19%
=========================================
Files ? 1
Lines ? 111
Branches ? 24
=========================================
Hits ? 109
Misses ? 2
Partials ? 0
Continue to review full report at Codecov.
|
tivac
added a commit
that referenced
this pull request
Dec 13, 2019
Any components rendered by a child machine are now inserted into the component tree where the child machine was invoked. This allows for much more natural composition of statecharts and component rendering. BREAKING CHANGE: The output format has changed to no longer have an array of machines at the top-level, instead it is just the top-level components representing active states. Invoked machines are no longer part of the top-level array but now inserted into the tree of components based on the location of the component that invoked them.
tivac
added a commit
that referenced
this pull request
Feb 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
More documentation later.
THIS IS A BREAKING CHANGE.