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

update with-xstate example and add documentation for inspect package usage #23287

Merged
merged 6 commits into from
Mar 23, 2021

Conversation

moh12594
Copy link
Contributor

Hello this PR is in order to update xstate to the lastest version and use the createMachine method instead of Machine.
I also added the inspect mode in order to show how we could use into a next.js app.

Documentation / Examples

  • Make sure the linting passes

@ijjk ijjk added the examples Issue was opened via the examples template. label Mar 22, 2021
* In order to use the xstate inspect module,
* we should check that we are on client, rather than the server
*/
if (typeof window !== 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

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

This is for local debugging, right? Is it good to include this by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right, I added a check for the "development" mode, I don't know if it's actually sufficient. I wanted to show how we can implement the inspect mode with next.js as there's some issues using it without checking for the window object.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, let's remove this from the code - but add instructions to the README if they want to use it. Sound good? This will prevent someone from shipping this code to prod - when really it seems like it's used for debug, yeah?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah ! good idea !
Yes, it's used for debugging/giving a visualization for differents machines used in the component. It shouldn't be in the production build !

I'll add it to the Readme and remove it from the code !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it to the README ! Thanks

@moh12594 moh12594 changed the title update with-xstate example and add inspect mode for nextjs update with-xstate example and add documentation for inspect package usage Mar 23, 2021
Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

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

Thank you!

@kodiakhq kodiakhq bot merged commit 9cc6ba9 into vercel:canary Mar 23, 2021
SokratisVidros pushed a commit to SokratisVidros/next.js that referenced this pull request Apr 20, 2021
…usage (vercel#23287)

Hello this PR is in order to update xstate to the lastest version and use the `createMachine` method instead of `Machine`.
I also added the inspect mode in order to show how we could use into a next.js app.

## Documentation / Examples

- [x] Make sure the linting passes
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Apr 29, 2021
…usage (vercel#23287)

Hello this PR is in order to update xstate to the lastest version and use the `createMachine` method instead of `Machine`.
I also added the inspect mode in order to show how we could use into a next.js app.

## Documentation / Examples

- [x] Make sure the linting passes
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants