xstate icon indicating copy to clipboard operation
xstate copied to clipboard

Remove traces of the `StateNodeConfig["key"]`

Open Andarist opened this issue 3 years ago • 4 comments

Follow-up to https://github.com/statelyai/xstate/pull/3455/files#r967087849

Andarist avatar Sep 12 '22 14:09 Andarist

⚠️ No Changeset found

Latest commit: 4ca13234ba9adace55111539796f38ef089d229c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Sep 12 '22 14:09 changeset-bot[bot]

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 4ca13234ba9adace55111539796f38ef089d229c:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

codesandbox-ci[bot] avatar Sep 12 '22 14:09 codesandbox-ci[bot]

👇 Click on the image for a new way to code review
  • Make big changes easier — review code in small groups of related files

  • Know where to start — see the whole change at a glance

  • Take a code tour — explore the change with an interactive tour

  • Make comments and review — all fully sync’ed with github

    Try it now!

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

ghost avatar Sep 12 '22 14:09 ghost

Before merging this in, let me think about naming...

  • id here should serve as only the root state node ID
  • The id (or name?) that the parent gives the child is for identifying the entire child actor
  • The root state node ID should not be used to self-identify the actor; only the state node

With that said, is id still the best name? I think probably yes, but we should document the difference in behavior from v4 that this:

spawn(someMachine, 'some-id');

Is different from this:

const someMachine = createMachine({
  id: 'rootNodeId'
})

davidkpiano avatar Sep 17 '22 07:09 davidkpiano