Fork me on GitHub
#boot
<
2015-07-29
>
laura06:07:15

has anyone using hoplon6 for multipage websites? we are having issues when there are multiple index.html's defined. eg:

src/other/index.cljs.hl
(page "other/index.html" ...)

src/index.cljs.hl
(page "index.html" ...)

we get such an error:
GET
(anonymous function) @ index.html.js:2

index.html.js:1 GET
(anonymous function) @ index.html.js:1

index.html:2 ClojureScript could not load :main, did you forget to specify :asset-path?

It seems the other/ directory level is inserted twice. We tried to move src/other/index.cljs.hl to src/other.cljs.hl and still have (page "other/index.html" ..) in it, but the result is the same.

laura10:07:54

@micha or @alandipert we have prepared an [example multipage repo](https://github.com/exicon/hoplon-multipage-example) which demonstrates our issue. it would be super helpful if you could help us straighten this problem, because we could migrate our open sourced homepage from boot1+hoplon5 to boot2+hoplon6 finally. it's quite critical because we want to lift over some of our closed sourced elements into it which was already migrated to hoplon6 and it's a blocking factor now.

meow11:07:51

@cfleming: Yes, the lein-generate thing is working fine for me. Direct support for boot in Cursive would be even better, but for now it works well enough.

cfleming11:07:09

@meow: Great, thanks for letting me know.

micha11:07:30

laura: thanks for preparing the example, i'll have a look this morning

onetom12:07:34

@michal: thanks in advance too! (i was pairing on this issue w @laura today)

micha12:07:53

@onetom: are you using jquery plugins that modify the DOM in your project?

micha12:07:25

because the alpha4 version has some changes that interfere with some external libraries (i noticed the problem with mathjax)

micha12:07:59

alpha3 doesn't have the experimental stuff merged in

micha12:07:16

(not related to the problem you're reporting here, but i noticed you're using the alpha4 version)

onetom14:07:27

@micha: i think this page in a subdirectory was an issue already before -alpha1 i remember we have experienced something similar even with hoplon5 but then it got fixed somehow. and yes, we would like to use certain direct DOM manipulating libs, eg: * http://filepicker.io/ * https://www.inspectlet.com/ (not sure though how much does it affect the DOM)

micha14:07:29

onetom: i might back out the alpha4 craziness for now

onetom14:07:42

then there is the lastpass extension for example which caused some confusion for the http://filepicker.io plugin: http://stackoverflow.com/questions/17814146/filepicker-io-blocked-iframe-in-chrome

micha14:07:51

but the page issue will be resolved separately

onetom14:07:21

@micha: how much shall i back out from it? which version is "safe" to use?

micha14:07:33

alpha3 should be fine

onetom14:07:01

so we even disable the lastpass plugin sometime if something really incomprehensible is happening...

onetom15:07:14

on the closed source project we were using 6.0.0-SNAPSHOT without any issues

micha15:07:15

i mean alpha2

onetom15:07:26

is -SNAPSHOT a moving target?

micha15:07:39

i'm not using SNAPSHOT anymore

micha15:07:43

so it's stable

micha15:07:57

but alpha2 is the one you want for now

onetom15:07:03

understood

micha15:07:21

we have to decide at some point where we want to be with respect to the tradeoffs in the experimental stuff

micha15:07:48

it will make it more difficult to use external js that goes fishing around in the dom and manipulating things

micha15:07:08

but it also provides a much more uniform model for hoplon stuff

micha15:07:57

the experimental features eliminate all the edge cases around loop-tpl and defelem

micha15:07:17

gives you a really simple model for state

micha15:07:59

but it also interacts poorly with external js that expects to be able to mutate the DOM arbitrarily

micha15:07:08

which hoplon is currently really good at dealing with

onetom15:07:15

we are quite ready to reimplement some of the functionality offered by external libs, but it would be not practical to live totally without the ability to mix in jquery stuff, like this filepicker or the auth0 login dialog and similar more complex but self contained things

micha15:07:17

i mean currently as in alpha2

micha15:07:00

the tradeoff is basically not using external libs that look into the dom and remove elements

micha15:07:23

so like for mathjax for example

onetom15:07:30

only remove will be "forbidden"? insertion is ok?

micha15:07:47

so take mathjax for example

micha15:07:25

the standard way oto use it is to have text nodes in the DOM that contain strings like $$x^2 + y^2$$

micha15:07:41

the backslash-paren is the delimiter mathjax looks for

micha15:07:06

it traverses the dom looking for that pattern, then it splits up the text node and injects elements

micha15:07:19

the compiled math notation elements

micha15:07:36

in the new regime you'd need to use mathjax slightly differently

micha15:07:57

you'd need to make a hoplon custom element like (mj "x^2 + y^2") for example

micha15:07:20

and the mj defelem would call a function in mathjax that takes a string argument and returns a dom tree

micha15:07:34

does that make sense?

onetom15:07:58

absolutely. but is there such a public api in mathjax?

micha15:07:16

i think so, haven't gotten to the bottom of it yet though

micha15:07:48

i would hope they would have implemented such a thing if only for use by the dom visitor

onetom15:07:25

i was doing quite a lot of angularjs in the past, where i had to babysit the custom element definition and manage a template, a compile phase and a linking phase and provide funky, 1 letter flags to tell the widget whether u want transclusion or just inclusion

micha15:07:49

how do you mean?

onetom15:07:42

i doubt u r humanly capable of coming up with such complicated solutions, so im not really worried when u mention tradeoffs 😉

micha15:07:08

haha thanks

micha15:07:17

what did you mean by transclusion vs inclusion?

onetom15:07:04

whether the dom elements of the widget were replacing the custom tag or just modifying the children of the custom tag. or something like that, i've erased it from my memory quite quickly after i've learnt about react

micha15:07:15

ah ok yeah

micha15:07:26

we don't need that, luckily

onetom15:07:33

and now that we are using hoplon for more than 6months, i have even foggier recollections of it 😉

micha15:07:02

since defelems are functions, it's always replacing the expression with the result

micha15:07:10

it's never just modifying the arguments

micha15:07:36

children == arguments

onetom15:07:10

https://docs.angularjs.org/api/ng/directive/ngTransclude "Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted. This directive executes at priority level 0." enough said i think

onetom15:07:47

coconut lisp -- as some knowledgable individual said once...

micha15:07:47

basically this (div "inline math: $$x^2 + y^2$$") becomes (div "inline math: " (mathjax "x^2 + y^2"))

micha15:07:20

the cool thing about the second one is that you can have the math text be a cell

onetom15:07:23

looks beautiful to me.

micha15:07:27

and it will recompile reactively

onetom15:07:25

i wouldnt talk to you anymore if it wouldnt be reactive! of course it can be a cell!

micha15:07:36

haha always yes

micha15:07:48

so perhaps i'll start a 7.0.0 branch with the new model

micha15:07:10

so we can continue to add bugfixes to alpha2

micha15:07:19

without getting into a complicated version situation

micha15:07:28

to ease the transition

onetom15:07:35

sounds like it grants a major version bump indeed

onetom15:07:01

hoplon6 was about boot2 compatibility and more modularity, right?

micha15:07:02

yeah 6.0.0 was going to be the bump but i think it's too much bumping

onetom15:07:09

extract the reload logic for example

micha15:07:28

i don't care how high the version number goes really

onetom15:07:33

just double checking because i foresee my colleagues demanding explanations.

onetom15:07:49

although most of them are reading this conversation anyway 😉

micha15:07:15

so releasing 6.0.0 and 7.0.0 at the same time seems ok, no?

micha15:07:54

because i know the external lib interop story is pretty important for applications already in production

micha15:07:07

we can maintain them side by side

onetom15:07:23

looks a bit weird, but until there is some explanation of it somewhere, it's ok

micha15:07:12

yeah and the pattern for wrapping external libs like mathjax needs to be fully worked out in detail

micha15:07:22

or people will be left hanging

onetom15:07:50

if it's really a substantial internal rewrite and you are not convinced it could pan out well and would want to discontinue it, then maybe a fork would be better

micha15:07:15

like a different artifact id?

onetom15:07:49

yeah, like hoplon-spider-pig-0.1.0

onetom15:07:30

and if it seems like a better model than the current then it can be promoted to be hoplon-7.0.0

micha15:07:24

the goal of 7.0.0 is to make deep DOM abstractions possible

micha15:07:34

by that i mean rebuild the DOM to be whatever you want it to be

micha15:07:14

because the edge cases have been eliminated you can completely replace all the primitive dom elements with custom elements

micha15:07:54

so things like flexbox or cassowary etc can be built in from the bottom up

onetom15:07:24

that's a bit beyond me at the moment

micha15:07:57

like jumblerg did a pretty extensive reimagining of the DOM with hoplon

micha15:07:19

he modeled it on adobe flex i think

micha15:07:57

like (vbox :w 250 :h 125 (hbox ...))

micha15:07:44

he basically implemented a different box model that's more like a mobile or application model

onetom15:07:07

any url to his work?

micha15:07:26

he keeps threatening to release it but he's shy 😉

micha15:07:43

also overworked at the moment i think

micha15:07:53

deraen: i'm going to finland for ClojuTre!

onetom15:07:56

i think u should say @juhoteperi otherwise it doesnt count as a mention

onetom15:07:28

it would make sense though that at the beginning of the line it should turn into a mention automatically

micha15:07:42

especially since it autocompletes it

onetom15:07:45

btw, what u just said above really start to look like the rebol visual interface dialect 😉

juhoteperi15:07:07

@micha: Have you thought about proposing a talk?

micha16:07:46

@juhoteperi: do you think people might want to hear about hoplon, maybe?

juhoteperi17:07:06

@micha: Sure

juhoteperi17:07:30

@micha: How much have you looked into Reagent? I'm thinking comparison would be interesting because as I understand, reagent reactions are nearly identical to formula cells.

juhoteperi17:07:09

I've been testing on how to retrieve cljs output dependency graph using cljs api and I'm nearly there: https://gist.github.com/Deraen/19b62045e74e547025de

juhoteperi17:07:48

Probably I should still take foreign deps into account as they might change.

micha17:07:08

@juhoteperi: yeah a comparison with react would be the topic probably

micha17:07:23

the ratoms aren't the same as formula cells really

juhoteperi17:07:39

@micha: That would certainly be interesting

micha17:07:42

they're not first-class reference types

micha17:07:15

javelin cells can be used by code that doesn't need to know anything about them

micha17:07:32

the telling part is that you don't need to use any macros at all to use javelin cells

micha17:07:44

this is how we can use them from JS

micha17:07:06

also they are "glitch free"

micha17:07:23

they propagate changes via a dependency graph, a DAG

juhoteperi17:07:34

Hmm, it's possible to use reactions without macros also. (make-reaction (fn [] (deref some-ratom)))

micha17:07:49

i don't think that's true, is it?

micha17:07:58

there needs to be a macro that sniffs out the deref

juhoteperi17:07:22

Nope, make-reactions executes the function and deref implementation registers the watchers

micha17:07:08

interesting

juhoteperi17:07:07

Reaction in fact has separate implementation from RAtom

micha17:07:37

it will be interesting to compare with javelin

micha17:07:20

i'll submit a talk proposal

martinklepsch18:07:42

@micha: awesome!!!

micha18:07:22

it's going to be fun! 🍻

juhoteperi18:07:34

I hope you both will be here at least for the previous day? There is probably going to be some kind of speakers/foreigners dinner and possibly sauna

martinklepsch19:07:42

Actually I’m going to Finland for a whole week vacationing with my girlfriend. Arriving in Helsinki on 9th

martinklepsch19:07:11

@juhoteperi: if you have any recommendations where to stay/what to do, please let me know! We were thinking of staying in some airbnb nearby a lake or something after ClojuTRE.

juhoteperi19:07:57

@martinklepsch: Airbns sounds like a good idea, though I'm not sure if you can find anything with a beach there but I guess nearly everything in Tampere is near a lake. If weather is good Näsinneula observation tower is good place to start, other than that I don't know much 😄

martinklepsch19:07:30

yeah, doesn’t have to be a beach by definition, just some cozy finnish landscapes

martinklepsch19:07:55

are there other sites to check besides airbnb maybe?

juhoteperi19:07:22

There's national park (or two) about 100km away, there should be some good landscapes there. I've been thinking visiting there myself.

micha20:07:47

@martinklepsch: i'll be there the same dates, i think

martinklepsch20:07:22

is there a #clojutre room yet? 😛

micha20:07:08

how do you make slack rooms? i don't see a button for it

micha20:07:27

oh i'm an idiot

micha20:07:53

also #C08BDAPRA