Open bahalperin opened 3 years ago
@mattpocock Just checking, is this library still being maintained? I’ve noticed there hasn’t been a new commit/release in a while.
Hey @bahalperin, it's kind of in experiment status at the moment. We're trying out some new parsers in other projects and, while I'm still full-time at Yozobi I don't have that much time to put to it.
However, I'll be joining Stately full-time Monday after next so I'll have more time to put to this. Apologies for the delay in merging your PR.
@mattpocock Thanks for the quick response! No worries at all, just wanted to make sure these weren't going to sit around forever. And thanks for making this library by the way, it is super super useful! Makes working with xstate in typescript so much more enjoyable 🙌
fwiw:
import {createMachine} from '@xstate/compiled'
interface Context {}
type Event = {type: 'DUMMY_TYPE'};
const machine = createMachine<Context, Event, 'uid'>({
initial: 'test',
states: {
test: {
invoke: {
id: 'test',
src: () => () => {}
}
}
}
})
File Changed: src/test.machine.ts
Could not complete due to errors in src/test.machine.ts
Error: Could not extract state schema
at Object.exports.extractSchema (/home/ivan/dev/xstate-codegen-test/node_modules/xstate-codegen/bin/extractor.js:247:15)
at /home/ivan/dev/xstate-codegen-test/node_modules/xstate-codegen/bin/extractMachines.js:97:41
at Array.map (<anonymous>)
at Object.exports.extractMachines (/home/ivan/dev/xstate-codegen-test/node_modules/xstate-codegen/bin/extractMachines.js:75:30)
at addToCache (/home/ivan/dev/xstate-codegen-test/node_modules/xstate-codegen/bin/index.js:106:46)
at FSWatcher.<anonymous> (/home/ivan/dev/xstate-codegen-test/node_modules/xstate-codegen/bin/index.js:68:19)
at FSWatcher.emit (events.js:375:28)
at FSWatcher.emitWithAll (/home/ivan/dev/xstate-codegen-test/node_modules/chokidar/index.js:541:32)
at FSWatcher._emit (/home/ivan/dev/xstate-codegen-test/node_modules/chokidar/index.js:632:8)
at listener (/home/ivan/dev/xstate-codegen-test/node_modules/chokidar/lib/nodefs-handler.js:370:20)
Edit: This was running the version from #78
The definitions for
InvokeCallback
andInvokeCreator
are currently:xstate-codegen
narrows the event type down to the event that caused the transition and invoked the service. This makes the event type for theSender
in theInvokeCallback
the same. It should be able to send any of the machine's events back to it, regardless of what event caused the service to be invoked.