statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
26.98k stars 1.24k forks source link

[chore] refactored `guards` internals to standardize built-in guard definitions and clarify logic flow #4717

Closed Enteleform closed 7 months ago

Enteleform commented 8 months ago
changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: d7ca549b92f84c3f3c5b69fcd7f70200ec2e2e60

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------ | ----- | | xstate | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codesandbox-ci[bot] commented 8 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d7ca549b92f84c3f3c5b69fcd7f70200ec2e2e60:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration
Andarist commented 8 months ago

I'm not the biggest fan of those changes to how guards are structured here. I don't see big issues with the current structure and I don't think this is a problem worth solving. it could also be seen as a breaking change (in quite an edge case scenarios but still). Also, the fact that each guard had its own "not callable builtin guard" with a unique .name that repeated the guard's name was very much intentional.

Andarist commented 7 months ago

I don't think we are going to proceed with this particular PR. I'm especially opposed to this change. Maybe some other changes from this PR could be pulled in but I don't feel a strong need for this either way. I'm sorry for closing this as I know that you put some effort into this - we really appreciate that!