xstate-tools
xstate-tools copied to clipboard
Bug: Typegen cannot detect actions defined by variable imported from outside the file
Description
I am trying to set the key of each state to be 1 of a list of urls defined outside the createMachine file.
If I define the RouteUrls object locally inside the file, then the error disappears making me think that typegen does not work well with other files. Is there anything I can do?
Expected result
The typegen should detect that the action is tied to an imported value just like if I add a string directly
Actual result
The typing system does not recongise the link between the definition of the state and the usage of an action/service that are linked by an imported variable from a different file
@Andarist Is this feasible?
Not at the moment. As discussed in Lisbon - this is tricky, especially with all of the resolution modes/aliases that one can have. We can explore this in the future but for the time-being, we need to focus on the basic "one file" experience.