Fork me on GitHub
#hoplon
<
2017-08-23
>
thedavidmeister03:08:30

@flyboarder nice, now i'm just getting regular test fails

thedavidmeister03:08:37

any idea why (.-body js/document) is now nil?

flyboarder03:08:21

@thedavidmeister don't we need a page for there to be a body?

thedavidmeister03:08:41

up until now phantomjs has provided a document with a body

flyboarder03:08:42

I don't know much about phantom

thedavidmeister03:08:08

(when-not (.-body js/document)
  (set! (.-body js/document) (.createElement js/document "body")))

flyboarder03:08:49

What are the contents of the documentElement?

thedavidmeister03:08:40

(.-outerHTML js/document) was nil

thedavidmeister03:08:49

but i didn't check documentElement

flyboarder03:08:26

Yeah I'm not sure what's up with that, let me know how that turns out

thedavidmeister04:08:43

yeah that worked for me

thedavidmeister04:08:47

i put it into wheel

thedavidmeister04:08:51

i'll chase up for hoplon itself later

thedavidmeister04:08:55

Uncaught exception, not in assertion.
expected: nil
  actual: #object[Error Error: Invalid arity: 97]

thedavidmeister04:08:16

(h/div
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div)
   (h/div))))

thedavidmeister04:08:28

Uncaught exception, not in assertion.
expected: nil
  actual: #object[Error Error: [object HTMLDivElement] is not ISeqable]

flyboarder04:08:52

Strange, not sure about that one, is spec throwing it? Can you send me the trace?

thedavidmeister04:08:41

i just pushed the test up to the branch

thedavidmeister05:08:20

i think it has to do with the new -invoke! implementation

thedavidmeister05:08:30

i've been chatting about it in the #clojurescript room

flyboarder06:08:25

@thedavidmeister can't we return the children as a vector?

flyboarder06:08:25

(div [(div)...])

thedavidmeister06:08:59

that's a pretty massive change isn't it?

flyboarder06:08:15

It works already

thedavidmeister06:08:49

but i'd bet that most existing hoplon code doesn't have children wrapped in vectors

thedavidmeister06:08:24

actually, pretty much the only time i do it is when i want to return a few siblings from a function

thedavidmeister06:08:31

not when i'm nesting divs

thedavidmeister06:08:14

if it gets to the point that we must use vectors, why not just use hiccup?

flyboarder06:08:09

Other than client vs server rendering

thedavidmeister06:08:19

suddenly requiring element functions to take vectors and hashmaps is a really big breaking change for a lot of code that i've written/seen

flyboarder06:08:28

Oh for sure, I'm sure we can solve this, I'll poke around invoke

thedavidmeister06:08:05

but yes, as a workaround you could probably move to a vector when you have 21+ elements in 9/10 situations

thedavidmeister06:08:31

although for some reason even that approach didn't seem to work for me in one of my tests

thedavidmeister06:08:54

also, the 21 arity should definitely work, the 22 arity is a stretch goal 🙂

thedavidmeister06:08:44

ah nm, i figured it out

thedavidmeister06:08:49

it's my privacy policy

thedavidmeister06:08:06

had 97 paragraphs in it

thedavidmeister06:08:16

i wrapped it into a vector as a workaround

thedavidmeister06:08:18

maybe the last arity should be

thedavidmeister06:08:20

(apply (partial invoke! this a b c d e f g h i j k l m n o p q r s t) rest)))

thedavidmeister06:08:02

actually i don't even think you need that

thedavidmeister06:08:09

i think the apply is breaking things

thedavidmeister06:08:17

(invoke! this a b c d e f g h i j k l m n o p q r s t rest)

thedavidmeister06:08:43

because as you said, invoke! already handles vectors properly

thedavidmeister06:08:10

@flyboarder i just pushed a version of invoke! without the apply in the largest arity to fix one of the tests

thedavidmeister06:08:34

now we just have to decide if/what we do about 22+ arity function calls

flyboarder07:08:34

@thedavidmeister are the remainders places in rest as a list?

flyboarder07:08:50

Why can't that be variadic

flyboarder07:08:05

I read the thread you had going

flyboarder07:08:08

I don't get it

thedavidmeister07:08:52

yeah you can't put an & in a protocol function

thedavidmeister07:08:58

It Has Been Decided

thedavidmeister07:08:30

yeah "rest" is just another arg

thedavidmeister07:08:53

i don't think there's anything special going on, like making it work like & does

thedavidmeister07:08:23

well the good news is that all my tests are passing now 🙂

thedavidmeister07:08:29

and generally clicking around my site seems to work OK

thedavidmeister07:08:40

we could probably deal with the 22+ arity situation in a followup issue if you wanted to get 7.1.0 out the door...

flyboarder07:08:36

I'm not eager to get 7.1 out, personally I'd like 1.9 to drop

thedavidmeister07:08:41

well, based on what we just went through, i think we should be trying to keep pace with 1.9.x in the snapshot at least

thedavidmeister07:08:45

we're still 3 versions behind after today's work

flyboarder07:08:37

Agreed, I wonder if this invoke thing will bite us tho

flyboarder07:08:03

Oh well, I'm happy to keep fixing things as you write tests for them :P

thedavidmeister07:08:23

everything still seems to work as long as you have 21 or fewer arguments

thedavidmeister07:08:41

which honestly doesn't sound like that many to me when you factor in both attributes and children

thedavidmeister07:08:38

at least there's a relatively painless workaround available with maps and vectors

thedavidmeister07:08:43

could be worse >.<

flyboarder07:08:20

Yeah I agree, depending on your usage this could randomly suck

flyboarder07:08:50

The other option is to make tags return a variadic function which returns an element

flyboarder07:08:07

And shim the protocol with a function

thedavidmeister07:08:22

definitely worth playing around with

thedavidmeister07:08:43

from what i can see, it seems to be the worst when you just want to make a simple page of text

thedavidmeister07:08:48

so you have lots of paragraphs, etc.

thedavidmeister07:08:44

i think that dynamic stuff like for-tpl already works with vectors internally, but i could be wrong about that

thedavidmeister07:08:00

i tried (for-tpl [v (range 100)] (div v)) and it seemed ok

flyboarder07:08:38

Iv got a trip tomorrow but when I'm back in Thursday I'll poke the invoke shim

thedavidmeister07:08:54

could you do a push to clojars before you go?