Skip to content

Conversation

@tivac
Copy link
Owner

@tivac tivac commented Dec 11, 2019

More documentation later.

THIS IS A BREAKING CHANGE.

tivac added 15 commits December 6, 2019 22:31
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.
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@c4766d2). Click here to learn what that means.
The diff coverage is 96.87%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master       #2   +/-   ##
=========================================
  Coverage          ?   98.19%           
=========================================
  Files             ?        1           
  Lines             ?      111           
  Branches          ?       24           
=========================================
  Hits              ?      109           
  Misses            ?        2           
  Partials          ?        0
Impacted Files Coverage Δ
src/treebuilder.js 98.19% <96.87%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4766d2...b454b98. Read the comment docs.

@tivac tivac merged commit fd70a34 into master Dec 12, 2019
@tivac tivac deleted the nested-child-components branch December 12, 2019 06:45
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
* chore: v9 setup and rollup removal

* chore: lint

* chore: lint

* chore: lint

* chore: lint

* chore: lint

* chore: lint

* chore: lint

* chore: lint

* chore: lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants