JVM (Clojure) Fulcro Inspect connector for TUI apps.
This is the small CLJ shim that fills the only gap preventing a plain JVM Fulcro app from
connecting to the standalone Fulcro Inspect (Electron) app: a DevToolConnectionFactory
that speaks Sente over a real websocket from the JVM.
The entire inspect event-generation pipeline (transactions, network, db-changed) and the
devtools-remote transport (connection, target, resolvers) are already CLJC and ship transitively
with Fulcro 3.10.x. The only CLJS-only piece is com.fulcrologic.devtools.electron.target
(it uses goog-define and enc/get-win-loc). This namespace is a CLJ analog of that factory.
Usage (debug only):
(require '[com.fulcrologic.fulcro.tui.inspect :as tui-inspect]) (tui-inspect/install!) ; register the JVM websocket factory ONCE (tui-inspect/add-inspect! app) ; attach inspect to your TUI app
Requires the Fulcro Inspect Electron app to be running (it hosts the websocket server on localhost:8237). Also requires the inspect pipeline to be enabled in CLJ via the JVM property:
-Dcom.fulcrologic.fulcro.inspect=true
(Without that property fulcro.inspect.tool/add-fulcro-inspect! is a no-op, because its body is
wrapped in the ilet macro that only emits in CLJ when that property is "true".)
JVM (Clojure) Fulcro Inspect connector for TUI apps. This is the small CLJ shim that fills the only gap preventing a plain JVM Fulcro app from connecting to the standalone Fulcro Inspect (Electron) app: a `DevToolConnectionFactory` that speaks Sente over a real websocket from the JVM. The entire inspect event-generation pipeline (transactions, network, db-changed) and the devtools-remote transport (connection, target, resolvers) are already CLJC and ship transitively with Fulcro 3.10.x. The only CLJS-only piece is `com.fulcrologic.devtools.electron.target` (it uses `goog-define` and `enc/get-win-loc`). This namespace is a CLJ analog of that factory. Usage (debug only): (require '[com.fulcrologic.fulcro.tui.inspect :as tui-inspect]) (tui-inspect/install!) ; register the JVM websocket factory ONCE (tui-inspect/add-inspect! app) ; attach inspect to your TUI app Requires the Fulcro Inspect Electron app to be running (it hosts the websocket server on localhost:8237). Also requires the inspect pipeline to be enabled in CLJ via the JVM property: -Dcom.fulcrologic.fulcro.inspect=true (Without that property `fulcro.inspect.tool/add-fulcro-inspect!` is a no-op, because its body is wrapped in the `ilet` macro that only emits in CLJ when that property is "true".)
(add-inspect! app)Enable inspect, install the JVM websocket factory, and attach Fulcro Inspect to app.
This is a debug-only convenience: it force-enables both inspect gates (see enable!) so you do
NOT need to start the JVM with any -D flags. Requires the standalone Fulcro Inspect (Electron)
app to be running (websocket server on localhost:8237).
Enable inspect, install the JVM websocket factory, and attach Fulcro Inspect to `app`. This is a debug-only convenience: it force-enables both inspect gates (see `enable!`) so you do NOT need to start the JVM with any `-D` flags. Requires the standalone Fulcro Inspect (Electron) app to be running (websocket server on localhost:8237).
(enable!)Force BOTH inspect enable-gates ON at runtime, so callers don't need JVM -D flags.
There are TWO independent gates:
com.fulcrologic.fulcro.inspect.inspect-client/INSPECT (sysprop com.fulcrologic.fulcro.inspect)
gates Fulcro's ido/ilet (including fulcro.inspect.tool/add-fulcro-inspect!).com.fulcrologic.devtools.common.target/INSPECT (sysprop com.fulcrologic.devtools.enabled)
gates target/connect! (the ido around the websocket connection itself).Both are read once at ns-load, so flipping the system property after load is not enough — we
alter-var-root the realized vars directly.
Force BOTH inspect enable-gates ON at runtime, so callers don't need JVM `-D` flags.
There are TWO independent gates:
* `com.fulcrologic.fulcro.inspect.inspect-client/INSPECT` (sysprop `com.fulcrologic.fulcro.inspect`)
gates Fulcro's `ido`/`ilet` (including `fulcro.inspect.tool/add-fulcro-inspect!`).
* `com.fulcrologic.devtools.common.target/INSPECT` (sysprop `com.fulcrologic.devtools.enabled`)
gates `target/connect!` (the `ido` around the websocket connection itself).
Both are read once at ns-load, so flipping the system property after load is not enough — we
`alter-var-root` the realized vars directly.(install!)Register the JVM websocket DevToolConnectionFactory (call once).
Register the JVM websocket DevToolConnectionFactory (call once).
(start-ws-messaging! conn)Establish the Sente websocket client for conn and run the send/receive go-loops.
This is a CLJ port of com.fulcrologic.devtools.electron.target/start-ws-messaging!:
the only differences are (1) fixed host/port instead of goog-define, (2) no get-win-loc
browser protocol sniffing, and (3) :type :ws (the JVM Sente client supports websockets only,
not the ajax long-poll fallback).
Establish the Sente websocket client for `conn` and run the send/receive go-loops. This is a CLJ port of `com.fulcrologic.devtools.electron.target/start-ws-messaging!`: the only differences are (1) fixed host/port instead of `goog-define`, (2) no `get-win-loc` browser protocol sniffing, and (3) `:type :ws` (the JVM Sente client supports websockets only, not the ajax long-poll fallback).
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 |