This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-23
Channels
- # beginners (55)
- # boot (37)
- # braid-chat (1)
- # chestnut (3)
- # cider (4)
- # clara (22)
- # cljs-dev (54)
- # cljsrn (3)
- # clojure (114)
- # clojure-italy (12)
- # clojure-losangeles (3)
- # clojure-portugal (1)
- # clojure-russia (1)
- # clojure-spec (30)
- # clojure-uk (67)
- # clojure-ukraine (1)
- # clojurescript (101)
- # core-async (11)
- # cursive (6)
- # data-science (27)
- # datomic (8)
- # figwheel (3)
- # fulcro (59)
- # graphql (2)
- # hoplon (89)
- # jobs (3)
- # jobs-rus (1)
- # leiningen (3)
- # lumo (19)
- # off-topic (9)
- # om (48)
- # pedestal (2)
- # portkey (4)
- # protorepl (19)
- # re-frame (13)
- # reagent (38)
- # remote-jobs (1)
- # ring-swagger (4)
- # spacemacs (10)
- # specter (2)
@flyboarder nice, now i'm just getting regular test fails
any idea why (.-body js/document)
is now nil
?
i wonder if it has anything to do with https://github.com/hoplon/hoplon/issues/197
@thedavidmeister don't we need a page for there to be a body?
up until now phantomjs has provided a document with a body
I don't know much about phantom
i'm trying out
(when-not (.-body js/document)
(set! (.-body js/document) (.createElement js/document "body")))
What are the contents of the documentElement?
(.-outerHTML js/document)
was nil
but i didn't check documentElement
i'm just copying the example at https://developer.mozilla.org/en-US/docs/Web/API/Document/body
Yeah I'm not sure what's up with that, let me know how that turns out
yeah that worked for me
i put it into wheel
i'll chase up for hoplon itself later
Uncaught exception, not in assertion.
expected: nil
actual: #object[Error Error: Invalid arity: 97]
@flyboarder if i do this
(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))))
Uncaught exception, not in assertion.
expected: nil
actual: #object[Error Error: [object HTMLDivElement] is not ISeqable]
Strange, not sure about that one, is spec throwing it? Can you send me the trace?
not spec
i just pushed the test up to the branch
i think it has to do with the new -invoke!
implementation
i've been chatting about it in the #clojurescript room
@thedavidmeister can't we return the children as a vector?
uh, example?
(div [(div)...])
that's a pretty massive change isn't it?
It works already
but i'd bet that most existing hoplon code doesn't have children wrapped in vectors
actually, pretty much the only time i do it is when i want to return a few siblings from a function
not when i'm nesting divs
if it gets to the point that we must use vectors, why not just use hiccup?
Other than client vs server rendering
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
Oh for sure, I'm sure we can solve this, I'll poke around invoke
but yes, as a workaround you could probably move to a vector when you have 21+ elements in 9/10 situations
although for some reason even that approach didn't seem to work for me in one of my tests
also, the 21 arity should definitely work, the 22 arity is a stretch goal 🙂
ah nm, i figured it out
it's my privacy policy
had 97 paragraphs in it
i wrapped it into a vector as a workaround
maybe the last arity should be
(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)))
actually i don't even think you need that
i think the apply
is breaking things
(invoke! this a b c d e f g h i j k l m n o p q r s t rest)
should be fine
because as you said, invoke!
already handles vectors properly
@flyboarder i just pushed a version of invoke!
without the apply
in the largest arity to fix one of the tests
now we just have to decide if/what we do about 22+ arity function calls
@thedavidmeister are the remainders places in rest as a list?
Why can't that be variadic
I read the thread you had going
I don't get it
yeah you can't put an &
in a protocol function
It Has Been Decided
yeah "rest" is just another arg
i don't think there's anything special going on, like making it work like &
does
well the good news is that all my tests are passing now 🙂
and generally clicking around my site seems to work OK
Omg yay!
we could probably deal with the 22+ arity situation in a followup issue if you wanted to get 7.1.0
out the door...
I'm not eager to get 7.1 out, personally I'd like 1.9 to drop
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
we're still 3 versions behind after today's work
Agreed, I wonder if this invoke thing will bite us tho
Oh well, I'm happy to keep fixing things as you write tests for them :P
everything still seems to work as long as you have 21 or fewer arguments
which honestly doesn't sound like that many to me when you factor in both attributes and children
at least there's a relatively painless workaround available with maps and vectors
could be worse >.<
Yeah I agree, depending on your usage this could randomly suck
The other option is to make tags return a variadic function which returns an element
And shim the protocol with a function
definitely worth playing around with
from what i can see, it seems to be the worst when you just want to make a simple page of text
so you have lots of paragraphs, etc.
i think that dynamic stuff like for-tpl
already works with vectors internally, but i could be wrong about that
i tried (for-tpl [v (range 100)] (div v))
and it seemed ok
Iv got a trip tomorrow but when I'm back in Thursday I'll poke the invoke shim
could you do a push to clojars before you go?