Fork me on GitHub
#hoplon
<
2016-12-17
>
flyboarder04:12:02

@alandipert: I see new things are brewing!! What is your stack built with?

alandipert04:12:58

gonna work with jesse on a 'canonical' full-stack example that shows use of all the stuff we advocate

alandipert04:12:14

all the demos are small and out of date

flyboarder04:12:22

Awesome! Good idea!

alandipert04:12:25

and hopefully this example could serve as a living doc, and source of things like templates

flyboarder04:12:40

Like a demo documentation app

flyboarder04:12:50

I like it đź‘Ť

alandipert04:12:01

yeah, something close to real. and deployable to heroku

tbrooke13:12:04

@alandipert @jumblerg Thank You Panoply is what some of us need đź‘Ź đź‘Ź

thedavidmeister14:12:51

@alandipert @micha is there any way to top *-tpl from caching the elements

thedavidmeister14:12:41

in my case i’d like to know that the local state is reset to initial values every time my elem is attached to the dom

jumblerg14:12:17

if you used for without the tpl it wouldn't cache... but maybe i don't fully understand what you're trying to accomplish.

thedavidmeister14:12:19

my understanding is that if i don’t use tpl i’ll run into memory leaks

jumblerg14:12:04

right. that's the alternative.

thedavidmeister14:12:26

i can’t get rid of the elements i don’t want?

jumblerg14:12:46

since there's not a way to gc them

jumblerg14:12:20

caching is the approach hoplon has taken as an alternative to lifecycle methods/destructors/etc.

jumblerg14:12:30

not without some kind of explicit call to release all the references, which i do not believe the javelin cells in particular support right now.

jumblerg14:12:24

i haven't had a scenario where i've ever needed to do this though

thedavidmeister14:12:52

i thought you could destroy cells so they can be gc

jumblerg14:12:58

the only drawback to this approach that i have experienced is that cells pertaining to elements that are not in the dom will continue to evaluate in the background

thedavidmeister14:12:12

yes, that’s the issue i have

thedavidmeister14:12:54

(destroy-cell! c)
;; Disconnects c from the propagation graph so it can be GC’d.

jumblerg14:12:30

there's not any logic to release their corresponding watches that set the properties on the elements though.

jumblerg14:12:42

i've found that writing my formula cells to handle all the values, including those that might occur when an element is outside the dom, is pretty easy once you get used to it.

jumblerg14:12:18

but i was having a conversation with micha last week about the possibility of preventing this behavior

thedavidmeister14:12:29

the problem i have is that one of my cells relies on bubbling events

thedavidmeister14:12:33

seems to somehow be getting events triggered when its not in the dom

thedavidmeister14:12:51

but in a way that could never happen normally

thedavidmeister14:12:13

i end up with an assert that gets triggered

jumblerg14:12:20

interesting, curious what the use case is

jumblerg14:12:55

javelin is the library i've worked the least on, but i am familiar with the watch mechanisms in hoplon (and alan is in an aluminum tube at 50,000 ft or so).

thedavidmeister14:12:43

i got a 3 tier structure in the dom and i track the “current position” in a cell

thedavidmeister14:12:31

so if you focus/click something the current position is pieced together as the event bubbles up through the tiers

thedavidmeister14:12:41

seems to trigger a focus on one of the lower tiers that then does not bubble up to higher tiers

thedavidmeister14:12:54

because detached dom elements do not bubble events

thedavidmeister14:12:16

at least i think that’s what’s happening

thedavidmeister14:12:52

easiest solution in my mind is just guarantee that the cursor is reset to nil at all levels whenever the elem goes back into the dom

thedavidmeister14:12:55

fresh slate 🙂

jumblerg14:12:06

i'm trying to imagine how the cell is involved.

thedavidmeister14:12:18

holds the current position

jumblerg14:12:18

and how does the position get placed in the cell? via a handler at a root node the events bubble up to?

thedavidmeister14:12:10

and 3 nested nodes below the root

jumblerg14:12:10

i don't think i fully grasp the problem. could you do away with the assertion since it appears the claim the assertion is making cannot always hold true in this model?

thedavidmeister15:12:55

sure, except that it should hold true

thedavidmeister15:12:44

i mean, sure i can get rid of the assertion but it’s a useful safety net

jumblerg15:12:52

my approach has typically been to handle the exceptional values that may occur when cells evaluate and set properties on elements outside of the dom - typically nil footguns - rather than trying to prevent those situations from occuring.

jumblerg15:12:55

you get fewer guarantees and have to handle more cases within the cells when dom management is devolved to the -tpls.

thedavidmeister15:12:10

that has been largely fine

jumblerg15:12:17

i can see how there might be some ugly corner cases though where this is less easily done, but i think my instinct would be to reevaluate the larger approach first.

jumblerg15:12:51

or maybe what you're doing is entirely reasonable and we need to support that case somehow. :)

thedavidmeister15:12:09

seriously, it should all be good if i can reset the position cursor to nil

thedavidmeister15:12:24

i don’t care if the vals go crazy after the el is detached

thedavidmeister15:12:42

but i want it back to something sane before either that el or a new one is attached again