Fork me on GitHub
#hoplon
<
2017-08-21
>
thedavidmeister00:08:22

@flyboarder great, that fixed the warnings 🙂

thedavidmeister00:08:26

how do i disable spec?

thedavidmeister00:08:40

it's i'm getting clojure.lang.ExceptionInfo: clojure.lang.ExceptionInfo: ERROR: Call to hoplon.core/elem did not conform to spec:

thedavidmeister00:08:46

when i destructure attributes

flyboarder00:08:26

Macro specs cannot be disabled, it's part of the compiler

flyboarder00:08:11

@thedavidmeister I wonder if there are destructure specs in core

thedavidmeister00:08:40

but i can't upgrade hoplon atm 😞

thedavidmeister00:08:59

(h/defelem section
 [{:keys [left right middle]} children]

thedavidmeister00:08:05

that's throwing errors for me

thedavidmeister00:08:14

i'll put a test up for you so you can see the problem @flyboarder

flyboarder00:08:32

Cool, I can fix this right away

thedavidmeister02:08:30

let's see how these go 🙂

thedavidmeister03:08:36

ok yeah, it's definitely destructuring that spec is choking on @flyboarder

thedavidmeister03:08:52

it can't handle this at all

thedavidmeister03:08:54

(h/defelem div--destructured
 [{:keys [foo] :as attributes} _]
 (h/div
  :data-bar foo
  (dissoc attributes :foo)))

flyboarder05:08:55

@thedavidmeister I found clojure core specs, using that

thedavidmeister05:08:15

@flyboarder those tests passed 🙂 i'll try with main test suite again

thedavidmeister05:08:39

@flyboarder actually, do you need to push to clojars first?

thedavidmeister06:08:35

cool, i'll test it out

thedavidmeister06:08:35

i'll push new tests in a sec

thedavidmeister06:08:27

when there are no children it breaks

flyboarder06:08:25

@thedavidmeister not sure why that passes the spec, it should have at least 2 items to pass

thedavidmeister07:08:03

why? lots of dom elements cannot have children

thedavidmeister07:08:21

i suppose you could do _ in that case but hoplon actually works (or did) fine without children at all

flyboarder19:08:11

@thedavidmeister I suppose you are correct, will hoplon break if things without a child are passed children?

dm319:08:39

why would it?

flyboarder20:08:28

@dm3 defining a function as [attr] vs [attr kids], ill have to look at how children are passed to the element

flyboarder20:08:05

A function of 2 arguments, as per the docs

dm320:08:29

it expands to a vararg

dm320:08:57

I think 🙂

micha20:08:16

it does, eg. (div {:foo "bar"} (span "var...") (span "...args"))

flyboarder20:08:31

that should fix it

dm320:08:20

@micha btw, not sure if you’ve looked at https://github.com/hoplon/javelin/issues/35 or https://github.com/hoplon/javelin/issues/25#issuecomment-315618275 - I’ve implemented the JVM/self-host Cljs Javelin support. Haven’t had the time to finish it up - the non-self-host Cljs build is broken 🙂 Would be great to hear if you’d accept the changes upstream in the future/what needs to be done for you to accept it.

dm320:08:54

I’m currently using the JVM Javelin to define alerting rules on top of Prometheus monitoring (and other data sources)

micha22:08:24

oh interesting

micha22:08:51

i am not surprised that macros are not portable between JVM and self-hosted CLJS

micha22:08:17

there are a lot of differences there

micha22:08:44

having a self-hosted CLJS version of javelin is awesome though

micha22:08:52

i don't know what the strategy is for self-hosted cljs though

micha22:08:58

are you using it in a project?

micha22:08:53

sorry ^^ is for @dm3