fulcro 2026-10-09

I had Opus help me build a statecharts visualizer that works in sci so you can paste in a sc definition and have it render in the browser without a backend. https://sheluchin.github.io/statechart-viz/

🎉 3

I like this, gonna play...

Happy to take suggestions, PRs, whatever. Probably some things are amiss and Tony's sc viz repo has some additional functionality that might be worth porting.

These are the friction points, in case any are worth smoothing upstream:

1. goog.DEBUG in elements.cljc (state/parallel missing-ID warning). SCI has no goog global, so I patch it to false.
2. with-processing-context and in-state-context in v20150901_impl.cljc are inside #?(:clj ...) and reach CLJS via :require-macros. SCI expands macros itself, so it needs them unconditional (or under :default).
3. Hard deps on guardrails, timbre and spec. I shim them: >defn → defn with the gspec dropped, logging → no-ops or console, fdef → nil.
4. promise.cljc's let/do! macros reference JVM-only vars. They're fine on the sync path, but would block the async processor under SCI.
5. swap-vals! (used by manually-polled-queue) is missing from SCI's CLJS core. That's on SCI's side; I intern a polyfill.

With 1 and 2 fixed upstream, the only remaining workarounds would be the shims. A statecharts entry in babashka/sci.configs could then cover those too. That would make "try statecharts in the browser" a one-file thing for docs or a playground.