freeletics / FlowRedux

Kotlin Multiplatform Statemachine library with nice DSL based on Flow from Kotlin Coroutine's.
https://freeletics.github.io/FlowRedux/
Apache License 2.0
706 stars 27 forks source link

[Idea] Generate a state transition graph in compile time #600

Open xiaozhikang0916 opened 11 months ago

xiaozhikang0916 commented 11 months ago

Since we have defined the state machine in DSL, it would be nice to have a tool to produce a graph describing how the state is moved from one to another, for quick debugging and documentation.

An implementation can be a gradle ksp plugin, collecting state machine data from AST and print PlantUML syntex.

gabrielittner commented 11 months ago

This would be really nice to have, I've also thought about it before. An alternative approach (or additional) can also be something like http4k does https://www.http4k.org/guide/howto/self_document_systems_with_tests/ For that we'd need a runtime trace mode that would collect anything happening in the state machine so that you can use that for tests or debugging.

tigerxy commented 9 months ago

PlantUML would be really nice! 👍