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

[v5] Throw error if initial state is not specified. Fixes #674 #1669

Merged
merged 2 commits into from
Nov 29, 2020

Conversation

davidkpiano
Copy link
Member

Moving this from #1587

@davidkpiano davidkpiano requested a review from Andarist November 29, 2020 01:37
@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2020

🦋 Changeset detected

Latest commit: 969a2f4

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

This PR includes changesets to release 11 packages
Name Type
xstate Major
@xstate/graph Major
@xstate/immer Major
@xstate/inspect Major
@xstate/react Major
@xstate/test Major
@xstate/vue Major

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

@@ -193,6 +193,16 @@ export class StateNode<
)
: EMPTY_OBJECT) as StateNodesConfig<TContext, TEvent, TStateSchema>;

if (this.type === 'compound' && !this.config.initial) {
Copy link
Member

Choose a reason for hiding this comment

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

just a general q: what's your stance regarding dev-only errors? Would it be maybe worth it to remove this branch of code in production?

Copy link
Member Author

@davidkpiano davidkpiano Nov 29, 2020

Choose a reason for hiding this comment

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

Errors are something I'd love to have extracted instead, using a similar solution to: https://github.com/formium/tsdx#error-extraction

Tracked here: https://github.com/davidkpiano/xstate/projects/1#card-50248797

@davidkpiano davidkpiano merged commit 9dfe3da into next Nov 29, 2020
@davidkpiano davidkpiano deleted the davidkpiano/674-1 branch November 29, 2020 13:04
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.

2 participants