Fork me on GitHub
#hoplon
<
2018-12-20
>
flyboarder04:12:10

@bob592 yes since v7 the demos are probably a bit old - they should still work for the most part - if anyone runs into issues we can help sort them out

bobcalco22:12:48

@flyboarder Can you summarize for me the operational semantics of javalin/hoplon vs react? I gather it's doing FRP, just differently, but I don't really get the details yet. The idea of modeling state change as "cells" in a spreadsheet is interesting and not unfamiliar (I worked with someone from more of a CL background who created a similar library, but it did more server-side computation). However, I'm not sure how that works with DOM re-rendering in the CLJS context. I get both React and Elm's approach, which rely on computing diffs of DOM state relative to a virtual DOM. Can you help me understand it?

flyboarder22:12:31

^ great resource!

flyboarder22:12:57

With hoplon we swap whats in the dom based on state, however there isnt really any computation done on the DOM, we just store the elements in cljs data collections and then when that changes we put the changes in the DOM

bobcalco23:12:09

IOW, there is no intermediary "V-DOM" representation of state to compute - data flow results in changing only what needs to be changed... no need to diff because there's no need to search the DOM to see what's "different"...?

flyboarder19:12:50

Yep you go it! No V-DOM and we do pay as you go templating so only the current screen elements are created, as you change screens templates are cached and created as you go

bocaj22:12:56

I've not read the source yet...how does javelin interact with Hoplon/hlisp ? If a cell changes, a node changes?

flyboarder23:12:16

I guess this would be a decent summary “If a cell changes, a node changes”

flyboarder22:12:49

with a very special protocol

flyboarder22:12:31

all the magic is implemented right here:

flyboarder22:12:53

a “managed element” is an element where we track changes using cells

flyboarder22:12:32

then when cells change we fire the attribute functions above, attribute-providers implement the logic for each attribute

flyboarder22:12:52

and here is the magic for how the attributes are implemented:

bobcalco23:12:47

OK the video was helpful - I like javelin. But how to understand castra? IOW, MOAR please. 🙂

bobcalco23:12:03

Also, one thing I want is whole-document control - for example I want different links to css and js depending on certain context (e.g., logged-in?) so that I can render different design if necessary. It looks like hoplon supports that with toplevel html, head and body tags. IOW, I want to mount the whole document, not just some div as in react.

bocaj23:12:29

Yup looks like you can do this.

bobcalco23:12:49

Castra looks really interesting. I'm trying to wrap my head around the idea of component-izing both the back and front end as one unit (library). 🙂