stage: totally experimental
Goal: Make it easier to build reactive web applications in clojure/clojurescript.
There is hyperfiddle electric, which is amazing, and you should use it, but if you cannot, then flowy could be a good start. We stole the websocket part of electric as base.
Flowy allows to expose clojure functions to a browser via websocket, and for browser-ui to use them.
Exposed functions can
- be blocking and then return a clojure value (or an error)
- return a missionary task that returs just one value (or an error)
- return a missionary flow that can return mutliple values
- all exposed functions can be cancelled.
Then in the browser you deal with "proxies" of the tasks/flows in clojure on the server.
flowy.reagent/flow->ratom can be used in a reagent.core/with-let. It gets 2 parameters: 1. the flow and 2. the initial value, It retruns [flow-state-a dispose!]. The dispose! function needs to be used in the finally section of the with-let. flow-state-a is a normal reagent atom.
cd demo
npm install
npm run compile-reagent
clj -M:app
Open Browser on localhost:9000
flowy.uix/use-flow is a react hook that returns the current value of a flow, its parameters are 1. the flow and 2. the initial value that should be returned before the flow returns something.
cd demo
npm install
npm run compile
clj -M:app
Open Browser on localhost:9000
This is an experiment to see if babashka can be used as a commandline inspection tool; the fast startup time makes sense. I doubt that missionary will run in babashka, but one can use the protocol that we designed without missionary.
bb client
you can run multiple clients.
npm run compile
npm run report
333K without transit 330k is clojurescript 402K with transit 70k is transit 409K with task executor 200k is react/uix 602K with uix2 and react