Fork me on GitHub
#hoplon
<
2015-10-27
>
asolovyov15:10:12

hey! so I have this app with reloadable code and I wonder if I can create an anonymous cell, which won't be recreated on every run

alandipert16:10:45

defonce? or wrap it in a local storage-atom

alandipert16:10:05

oh, anonymous, so no defonce

alandipert16:10:51

local-storage is returning the cell there

esp117:10:55

i am really digging hoplon. /justsayin simple_smile

alandipert17:10:13

@esp1: nice to hear! what were you using before?

esp117:10:33

om/reagent

esp117:10:23

it’s not just hoplon tho, it’s the whole idea u guys have of turning everything into an immutable lisp (boot, etc). so sweet

esp117:10:18

the point micha made in his talk about hoplon being about values vs react being about events kind of sold me

alandipert17:10:16

thanks, its been fun Lisping everything

alandipert17:10:29

we didn't even have to invent anything, just put the pieces together and convince our bosses

esp117:10:58

well you may be standing on the shoulders of giants but i’m standing on yours now too. really great stuff, thank you!

micha17:10:35

"if i haven't seen as far as other men, it's because i have giants standing on my shoulders"

micha17:10:39

-- woody allen

alandipert17:10:28

@esp1 i'd be curious to hear what other thoughts you might have on react vs hoplon

alandipert17:10:41

i haven't used react at all except for hello world toy things

esp117:10:31

well, i’m still pretty new to hoplon so i don’t know that i can make much of an informed comparison for the exact opposite reason

esp117:10:12

but even so far it’s highlighting to me that a lot of things like all of react’s lifecycle methods, or all the craziness going on in that area re state management are solved much more elegantly when dealing with values vs events

esp117:10:38

composition becomes much easier as well

micha17:10:48

behaviors > events

levitanong17:10:41

The biggest difference for me is that react has a render loop with lifecycles. In some ways it’s closer to app development. It’s got its strengths and weaknesses. For one thing, I miss being able to just (if) things out instead of using css to hide components.

esp117:10:46

react was a revelation to me in terms of how much nicer it made ui programming, but hoplon has been even more of a revelation, which is kind of insane

micha17:10:28

@levitanong: we will have suport for the if style soon

levitanong17:10:09

The other thing is, loop-tpl has to bind to a “real” element, so I can’t pass loop-tpl as a “child” of a custom component

micha17:10:49

@levitanong: another thing that will be fixed soon

levitanong17:10:52

But the rest of Hoplon is just too nice to give up. Haha! I’m willing to live with the warts

micha17:10:58

that's a crucial part of the recipe

levitanong17:10:07

though i’m really relieved to hear the warts will be excised soon

micha17:10:52

all the differences between custom element and real element will be removed soon, hopefully

micha17:10:58

with the code that's in the works

levitanong17:10:59

so exciting!

levitanong17:10:02

can’t wait

micha17:10:10

i am going to have some time off soon to work on this

levitanong17:10:40

Would you guys perchance also plan to have some kind of transition hooks for the if forms

levitanong17:10:13

Like, some kind of transition when the component is “entering” and “leaving"

micha17:10:31

want to avoid that if possible though

levitanong17:10:47

There must be some more idiomatic way of doing it, but I’m coming from react, so that’s the only way I can express it

micha17:10:18

the lifecycle hooks make it difficult for people who aren't programmers

micha17:10:26

that's my main concern with it

micha17:10:40

i want to make hoplon accessible to UX and designer types

levitanong17:10:52

well, they can be optional, no? 😄 to support the guys who do both design/UX and program

esp117:10:07

@levitanong what’s your use case?

micha17:10:13

but i think there may be a way for hoplon to figure it out on its own

levitanong17:10:07

So right now I’m using hoplon to create really quick iOS design prototypes (i hate working with adobe illustrator and photoshop, and prefer to work with code)

levitanong17:10:56

as I navigate the prototype, I want to also be able to convey the components transitioning in and out, as they would in the final app (useful for communicating with the native dev)

levitanong18:10:27

Right now, because if isn’t supported, it isn’t much of an issue, as i have to use CSS to hide things anyway, so it’s trivial to just transition between hidden and shown states

levitanong18:10:22

once if comes in, it will be a challenge figuring out how to animate from simply not being there, to being there and offscreen, then finally to being in its resting visible state.

esp118:10:51

i’m guessing that the if style in hoplon will be supported by allowing formula cells to be composed alongside normal elements

levitanong18:10:51

You mean (cell= (if condition custom-component))?

micha18:10:53

levitanong: it seems like css is a cleaner solution there, no?

levitanong18:10:32

@micha: You have a point. 😛 But using css to hide things just seems so… wrong.

micha18:10:43

it's a brave new world simple_smile

micha18:10:20

but we can shave that yak, don't worry

micha18:10:49

like i can imagine something along the lines of

levitanong18:10:51

^ I have never encountered that idiom, but I love it

micha18:10:52

(with-transition :fade-in "fast" :zoom-out "slow"
  (cell= (when pred? (div ...))))

micha18:10:17

something declarative and not involving events explicitly

levitanong18:10:23

:O That is beautiful

micha18:10:38

that would return a new formula cell

micha18:10:41

that does the thing

esp118:10:16

i think with-transition itself can be implemented as a formula cell, no?

micha18:10:32

yeah it doesn't need to be a macro probably

micha18:10:15

once the framework is in place we can experiment with various APIs

micha18:10:33

but i think we can avoid explicit lifecycles in this way

esp118:10:00

are cells garbage collected?

micha18:10:09

not currently

micha18:10:16

that's the main thing we need to hammer out

micha18:10:35

javascript doesn't have weak references

micha18:10:51

without that we can't let the garbage collector just collect them

micha18:10:01

because they need to hold references to each other

micha18:10:15

so we will need to devise a suitable workaround

micha18:10:30

not ideal, but i think we can make it tolerable

levitanong18:10:04

Welp, I’m off to bed. Have a great day, guys!

micha18:10:15

👋 see ya!

raywillig18:10:54

@micha cell-let is a thing right?

raywillig18:10:55

it does what i think? destructure a cell into a bunch of other cells?

alandipert19:10:13

@micha: re: angular using the comment node as sentinel, do you think that's what we should use as the loop-tpl sentinel node type?

micha19:10:58

@alandipert: i'm not sure it will work

micha19:10:09

but it was an interesting approach that i hadn't considered