Fork me on GitHub
#hoplon
<
2018-08-20
>
onetom16:08:26

🦗 🦗 🦗 🙂

onetom17:08:31

@alandipert nowadays my primary backend is the ethereum blockchain and i just started to talk to if finally from clojure again, so im just doing json-rpc via the browser's builtin fetch api, like (def fetch (js/fetch.bind js/window)) 🙂 https://github.com/enumatech/cljs-abi-viewer/blob/block-explorer/src/eth/explorer.cljs#L87-L99

onetom17:08:21

otherwise, im trying to avoid very interactive UIs, because UIs are just hard and suck a lot of time away from the core problems of many projects...

onetom17:08:17

on the other hand, what i've learnt from hoplon and splint, i've carried over to practice and whipped up a super minimalistic, non-reactive version of hoplon (https://gitlab.com/oax/state-channel-poc/blob/master/viz/states/src/bongo/dom.cljs) so i could create this interactive visualization (which u can navigate with shift-left/right): https://onetom.keybase.pub//state-channels/

alandipert17:08:36

@onetom looks cool! do i understand right that's a way to project cljs data to dom?

onetom02:08:02

yes, that's a good way to put it. i provided default dom representation for the most common data types, so i can just directly render them, but later customize arbitrary parts of the data by turning those parts into records and implement a render function them

jjttjj17:08:10

yeah that's super cool. I was messing with a lighter weight subset of hoplon myself recently. Yours looks super clean

onetom05:08:50

Thank you! I haven't actually designed it, I just built it as a need has arose for a feature. You can see its evolution was just about 4 steps: 1. https://github.com/enumatech/cljs-abi-viewer/commit/d3c74ef7877aaae1e4295d7761d62f9e61ad889c 2. https://github.com/enumatech/cljs-abi-viewer/commit/657ace1952410b0724818934453a565d3e6b20a0 3. https://github.com/enumatech/cljs-abi-viewer/commit/4eb2eb35767fc0a78dc49bc65aeadec2aefa4c6b and then i came up with the Elem protocol with the render method idea to keep the data and its visualization connected but as loosely as i could possibly think of: https://github.com/enumatech/cljs-abi-viewer/commit/fde773ccf58ba77bc6ad50793ce081f44998d542#diff-c8c65fd8671e437d18217fbfe0865542

alandipert17:08:21

i saw a js thing the other day, mithril.js, looked very reasonable

😀 1
onetom05:08:20

i had some mirthil experiments last year, but i dropped it after about 5-10 minutes because when i was editing text in an input field rendered by mirthil, the cursor was jumping to the end of the input text, but not in every browser as if the whole input element has been recreated. then i tried some hoplon and react examples and none of those had issues with the same browser... but their state management story is not the best either, so i moved on...

alandipert15:08:05

ah, sounds like its not fully baked