This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-19
Channels
- # admin-announcements (1)
- # beginners (26)
- # boot (6)
- # cider (14)
- # cljsjs (29)
- # cljsrn (19)
- # clojure (87)
- # clojure-austin (5)
- # clojure-belgium (10)
- # clojure-brasil (2)
- # clojure-dusseldorf (15)
- # clojure-greece (17)
- # clojure-russia (51)
- # clojure-sanfrancisco (4)
- # clojure-sweden (20)
- # clojure-uk (31)
- # clojurescript (111)
- # core-matrix (2)
- # cursive (9)
- # datascript (15)
- # datomic (41)
- # dirac (1)
- # emacs (8)
- # flambo (1)
- # funcool (4)
- # hoplon (72)
- # lein-figwheel (3)
- # off-topic (2)
- # om (79)
- # om-next (2)
- # onyx (17)
- # other-languages (16)
- # re-frame (62)
- # reagent (26)
- # remote-jobs (1)
- # rum (3)
- # spacemacs (5)
- # untangled (120)
@alandipert: is this correct? https://github.com/hoplon/hoplon/wiki/Dynamic-DOM-manipulation-%28Template-Macros%29
@thedavidmeister: i don't think dom elements are a problem for memory leaks
and if the dom elements contain references to those cells, for example in event handler closures, then the dom elements can't be collected either
(defc red? true)
(defc fat? true)
(html
(body
(div
(cell=
(if red?
(div :class (cell= {:width (if fat? 100 20)}) :id "red")
(span :class (cell= {:width (if fat? 100 20)}) :id "black"))))))
the reason why this leaks memory is the :class
attribute that's bound to a formula cell that references fat?
there is a watch on the formula cell that's created by hoplon, which updates the class name of the element wnever the formula cell updates
without the formula cell the divs and spans would be GC just fine when there are no remaining references to them
@micha ta, i’ll review this, digest it and update the wiki 🙂
hey, go for it
i sort of fumbled through that bit
@micha i have a habit of writing tests and docs as a way to learn, but i don’t always get it right 😉
nah, it’s important
the docs have to say the right thing
@thedavidmeister: i was just wondering today if there is any docs on these latest *-tpl
functions, because it seems i should start teaching hoplon in my new job very soon.
so, thanks a lot for the docs!
@onetom: you have a new job? congrats
yeah, i’m teaching clojure at work through boot
using boot tasks to make reports 🙂
seems good to me
@alandipert: what’s the plan with https://github.com/hoplon/hoplon/wiki/HLisp?
could it be replaced with https://github.com/hoplon/hoplon/blob/master/Design.md?
@alandipert: yeah, i thought i mentioned it already. building a property development investment management web app. young, small startup. 4 people at the moment. 3 of us are coding too. physically it's close to exicon too, so i still can walk over any time to have lunch with the hong kong clojure community 🙂
@onetom: I read wide?
’s defined elsewhere, but it might be good for those unfamiliar to have it
yeah, that too. though it's important that they are cells, otherwise there is no problem.
also, would this be a solution / workaround?
(let [width-css (cell= {:width (if wide? "100px" "50px")})
(cell=
(if red?
(div :id "red" :css width-css)
(span :id "black" :css width-css))))
im also wondering, shouldn't we avoid formula cell definitions within formula cells, or that's not really a problem on its own? :thinking_face:
@micha: is there a way we can remove all the associated watches when a child is removed from the dom? maybe stick the generated keyword passed to watch on some elem metadata then call unwatch when removeChild is invoked?
@thedavidmeister: how about renaming this wiki page to: > Dynamic DOM manipulation a.k.a. Template Macros so the url is more readable?
@onetom: go for it
@jumblerg: yeah there are two things: the domain as a sort of reference counting scheme, and the lifecycle of the domain which would be something you'd associate with dom structures like for-tpl
or something
gotit, you just don't have a case for the raw cell in the child since the possibilities are typically finite
@micha is hoplon still doing things to elements removed from the DOM outside of hoplon?
@flyboarder: how do you mean?
Is it still removing js listeners and such?
hmmm, then my problem is elsewhere… thanks!
@flyboarder: this commit is in alpha14: https://github.com/hoplon/hoplon/commit/7028687ee04b14330b2b9126aecc3db49312a82e