Skip to content
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

chore: update xstate and adjust code to not use deprecated transient transitions #25483

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Jul 2, 2020

Description

xstate@4.11.0 was released few hours ago and is causing some problems, this PR explicitly updates xstate (which users can install right now themselves if lock files are not used)

See https://github.com/davidkpiano/xstate/releases/tag/xstate%404.11.0

In particular:

New property introduced for eventless (transient) transitions: always, which indicates a transition that is always taken when in that state. Empty string transition configs for transient transitions are deprecated in favor of always

// ...
states: {
  playing: {
+   always: [
+     { target: 'win', cond: 'didPlayerWin' },
+     { target: 'lose', cond: 'didPlayerLose' },
+   ],
    on: {
      // ⚠️ Deprecation warning
-     '': [
-       { target: 'win', cond: 'didPlayerWin' },
-       { target: 'lose', cond: 'didPlayerLose' },
-     ]
    }
  }
}
// ...

Because those warnings are emitted in unfortunate timing they will cause infamous Reducers may not dispatch actions. error.

Related Issues

#25478

@pieh pieh requested review from a team as code owners July 2, 2020 19:02
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 2, 2020
@pieh pieh added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 2, 2020
@gatsby-cloud-staging
Copy link

Your pull request can be previewed in Gatsby Cloud: https://build-b4ad0e78-04d6-4c5e-8ce4-c6da5681dd20.staging-previews.gtsb.io

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LgTM

@pieh
Copy link
Contributor Author

pieh commented Jul 2, 2020

Published in gatsby@2.23.18

mwfrost pushed a commit to mwfrost/gatsby that referenced this pull request Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants