Skip to content

Commit

Permalink
stripped out statechart devtool stuff. Moved to statecharts lib
Browse files Browse the repository at this point in the history
  • Loading branch information
awkay committed Dec 26, 2024
1 parent 3218bde commit 9ba994f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
10 changes: 0 additions & 10 deletions src/main/com/fulcrologic/fulcro/inspect/inspect_client.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@
:fulcro.inspect.ui.network/request-finished-at finished
:fulcro.inspect.ui.network/error error}))))

;; TASK: Move to statecharts library, since it can go there now!
(defn statechart-event! [app session-id event data new-config]
#?(:cljs
(let [app-uuid (app-uuid app)]
(fit/notify! app `devtool/statechart-event {app-uuid-key app-uuid
:com.fulcrologic.statecharts/session-id session-id
:event event
:data data
:com.fulcrologic.statecharts/configuration new-config}))))

(defn optimistic-action-finished!
"Notify inspect that a transaction finished.
Expand Down
45 changes: 0 additions & 45 deletions src/main/com/fulcrologic/fulcro/inspect/target_impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -140,51 +140,6 @@
{::pc/sym `target/run-network-request}
(run-network-request* params))

(defresolver statechart-definition-resolver [env input]
{::pc/output [{:statechart/definitions [:statechart/registry-key
:statechart/chart]}]}
(let [params (:query-params env)
app-uuid (app-uuid params)
app (get @apps* app-uuid)]
(when app
(let [runtime-env (some-> (runtime-atom app) deref :com.fulcrologic.statecharts/env)
chart-id->definition (some-> runtime-env :com.fulcrologic.statecharts/statechart-registry :charts deref
strip-lambdas)
definitions (mapv (fn [[k v]]
{:statechart/registry-key k
:statechart/chart v})
chart-id->definition)]
{:statechart/definitions definitions}))))

(defresolver statechart-session-resolver [env input]
{::pc/output [{:statechart/available-sessions [:com.fulcrologic.statecharts/session-id
:com.fulcrologic.statecharts/history-value
:com.fulcrologic.statecharts/parent-session-id
:com.fulcrologic.statecharts/statechart-src
:com.fulcrologic.statecharts/configuration
:com.fulcrologic.statecharts/statechart]}]}
(let [params (:query-params env)
app-uuid (app-uuid params)
app (get @apps* app-uuid)]
(when app
(let [{session-id->session :com.fulcrologic.statecharts/session-id :as state-map} (app-state app)
runtime-env (some-> (runtime-atom app) deref :com.fulcrologic.statecharts/env)
chart-id->definition (some-> runtime-env :com.fulcrologic.statecharts/statechart-registry :charts deref
strip-lambdas)
available-sessions (mapv
(fn [session]
(let [src-id (:com.fulcrologic.statecharts/statechart-src session)]
(-> session
(select-keys [:com.fulcrologic.statecharts/session-id
:com.fulcrologic.statecharts/history-value
:com.fulcrologic.statecharts/parent-session-id
:com.fulcrologic.statecharts/statechart-src
:com.fulcrologic.statecharts/configuration])
(assoc :com.fulcrologic.statecharts/statechart {:statechart/registry-key src-id
:statechart/chart (chart-id->definition src-id)}))))
(vals session-id->session))]
{:statechart/available-sessions available-sessions}))))

(defresolver pathom-connect-index-resolver [env input]
{::pc/output [{:pathom/indexes [::pc/idents ::pc/index-io ::pc/autocomplete-ignore]}]}
(async/go
Expand Down

0 comments on commit 9ba994f

Please sign in to comment.