Comments (13)
Keep this here, I'll figure it out later. It's likely an issue with the viz as opposed to the vscode extension
from xstate-tools.
Apologies, doing more feature work than bug work at the moment ahead of a big release in early Feb. Will look to tackle some bugs then.
from xstate-tools.
@smarko82 What do you mean by 'does not render anything'?
from xstate-tools.
Here it's XState tool working with send("pippo")
as entry action of idle state.
Here it's XState tool not working (doesn't render anyithing) with send((context) => context.pippo)
as entry action of idle state. It doesn't work also if I add context: { pippo: "foo" }
as param to object passed to createMachine function.
from xstate-tools.
I can add that when using entry:log("something")
nothing gets rendered.
It only happens for the entry
that belongs to the initial state. So in the @smarko82 example, if I use
idle:{
entry:log("something")
}
nothing renders. But if I change the code to:
idle:{
entry:{ actions: log("something")}
}
it renders correctly.
from xstate-tools.
One more thing, using
entry:{ actions: log("something")}
causes a blank screen on the stately.ia visualizer page:
Application error: a client-side exception has occurred (see the browser console for more information).
but if we use:
idle:{
entry:log("something")
}
it works correctly. so we are in a mutually excluding workaround scenario.
And there's is another problem with the website visualizer: once your code provoques an error there is no way to fix it and the page enters in an error loop where you need to be fast enough to select all the code and delete it before the render triggers. That's because the visualizer tries to render the code as soon as it loads the page.
A better way would be to let the user decide when to render the visualization so if an error occurs there is no error loop problem.
from xstate-tools.
@mogarick Could you double-check it with this site? It will let you know if there's a parse error our side:
https://xstate-parser-example-site.vercel.app/
from xstate-tools.
ok. give me a minute then...
from xstate-tools.
entry:log("something)
entry:{actions:log("something")}
this last one shows "anonymous" for the entry, and with such value in the visualizer it throws the a client-side...
error.
in the case of the vs-code extension, the no render scenario occurs when using the entry:log("something)
and it works with the entry:{actions:log("something")}
from xstate-tools.
Worth noting that entry: { actions: [] }
is incorrect syntax. Missed that in the comments above.
from xstate-tools.
Got it.
I can confirm using entry:log("Entered signIn NavState)
or entry: [log("Entered signIn NavState")],
works on the website visualizer.
But then the problem is on the vs-code extension visualizer.
Using entry: {actions:log("Entered signIn NavState")},
renders but entry:log("Entered signIn NavState)
doesn't. Neither entry: [log("Entered signIn NavState")],
.
from xstate-tools.
Hi @mattpocock,
About the error that occurs in the vs-code visualizer, should I open a new issue for better tracking purposes or leave this issue as the master one for that?
Thank you in advance.
from xstate-tools.
Hi @mattpocock,
Any news about this? :)
from xstate-tools.
Related Issues (20)
- [Feature Request] Add mermaid export to VSCode Extension HOT 1
- [Bug] VScode extension does not work if the machine is a property in a class HOT 5
- XState to md – how to generate documentation from xstate? HOT 1
- Bug: VSCode plugin error "<action> is never used in the machine definition" HOT 3
- xstate-cli typegen doesn't respect file casing after rename.
- Bug: typegen causes type error when a `service` is a function returning a StateMachine which has Context
- XState VSCode extension - Visual Editor shows unexpected errors when using multiple guarded transitions HOT 1
- @xstate/cli typegen regression from 0.5.2 HOT 2
- "Learn more" link button in vscode popup 404s HOT 1
- Running typegen command on machine with two invokes with one onDone fails
- (Feature Request) Use existing layout engine for autolayout HOT 1
- vs-code extension delete machine when defined as a createMachine parameter
- export to scxml file HOT 4
- VSCode Editor shows error on transitions when using "guard" (V5) instead "cond" (v4) HOT 2
- Bug: Typescript 'something is never used in the machine definition' when it is used HOT 2
- XState VSCode extension shows `__@@INLINE_IMPLEMENTATION@@__` string for all `onDone, onError` handlers in visualization
- Build instructions for vscode extension?
- Editor fails to save the changes on windows HOT 2
- "Jump to definition" doesn't work with v5's `setup(...)` API HOT 3
- Bug: VSCode visualizer doesn't resolve imported variables HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xstate-tools.