Status: done Completed: 2026-02-10 Priority: P1 Created: 2026-02-09 Owner: AI
The routing demo in src/routing-demo/ was written before the recent async execution engine refactoring. It uses a custom raise! implementation that bypasses guardrails and has CLJS test compatibility issues. The demo should be updated to use proper APIs and showcase best practices.
Remove custom raise! workaround (model.cljc:15-22)
::sc/internal-queue manipulation with proper senv/raise! callFix CLJS test promise handling (chart_test.cljc:56-59)
#?(:clj @v :cljs v) doesn't actually await promises in CLJSderef or proper async test patternsAdd shadow-cljs build configuration
:routing-demo build target to shadow-cljs.ednVerify demo works end-to-end
(run-tests 'com.fulcrologic.statecharts.routing-demo.chart-test)Optional improvements (if time permits)
on-save trigger hack with proper working memory querysrc/routing-demo/com/fulcrologic/statecharts/routing_demo/model.cljc - Custom raise! removalsrc/routing-demo/com/fulcrologic/statecharts/routing_demo/chart_test.cljc - Promise handling fixshadow-cljs.edn - Add build configurationmodel.cljc uses senv/raise - proper API (no direct queue manipulation)chart_test.cljc handles promises correctly with p/extract for CLJS and @ for CLJ:routing-demo build targetenvironment.cljc spec for raise 2-arityThe 2-arity version of raise was rejecting partial event maps (missing :type). Fixed spec to accept:
:name key (since evts/new-event fills in :type)raise! from model.cljc::sc/internal-queue volatile manipulationsenv/raise APIchart_test.cljcp/extract for CLJS (extracts value from already-resolved promises)maybe-delay helper that returns (p/resolved nil) when delay is 0:routing-demo target to shadow-cljs.ednsrc/routing-demo to :dev alias extra-paths in deps.edn:async alias to shadow-cljs deps for promesaCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |