Open lewisl9029 opened 2 years ago
Added to Linear: https://linear.app/statelyai/issue/STA-1291/support-for-meta
I am also facing this issue when trying to use @xstate/test. Currently I am working around it like this:
const definition = {
initial: 'init',
states: {
init: {},
}
};
definition.states.init.meta = { ... };
It is ugly and typegen doesn't seem to work properly.
Similar to https://github.com/statelyai/xstate-tools/issues/239 (which is for data
), is it ok for the editor to keep the meta
property instead of removing it?
I just found out that the .meta property isn't supported with the visual editor yet:
When I added .meta to a state node, the editor seems to just stop working entirely and no longer updates code when changed.
Please consider this a feature request to have it added! I don't necessarily need it to show up in the editor (though that would be super cool to have in a future version especially if we can have some special handling for rendering image urls!), just for it to not break the editor completely. 😅
It's super useful to be able to associate metadata with each state node. Without it I'd have to maintain a state node -> metadata mapping externally which gets really tedious with heavily hierarchical machines like the one I'm currently working on.
Thanks!