Fork me on GitHub
#clojurescript
<
2018-07-15
>
cjmurphy11:07:47

Is there a library that will parse html->hiccup such that the result is 'React style', so :colSpan rather than :colspan, and that also handles the :style attribute properly (for React), so that instead of {:style "width:60px;position:absolute;"} it outputs {:style {:width "60px" :position "absolute"}}?

cjmurphy11:07:03

So far I've tried hickory and hiccup-bridge.

Hukka13:07:18

For the life of me I don't understand why chrome keeps saying "Uncaught TypeError: Cannot read property 'call' of undefined" for product_type.call while at the same time showing that the product_type is a keyword and most definately not undefined

Hukka13:07:33

Ok... console.log shows it as undefined too, but debugger still shows it right

Hukka13:07:21

And hard refresh and now all the function params are undefinde

Hukka13:07:35

Ah. Two functions with same name... Then it's really weird why the debugger kept showing that the values would exist

adam15:07:27

I am new to re-frame and not quite sure how to build a user authentication/authorization system with it. From what I gathered I should create an auth interceptor and place my auth logic inside :before section then inject the interceptor into every events reg-event-db and reg-event-fx that I want to protect. Am I on the right track?

kennytilton16:07:16

@somedude314 Sounds right, but I am learning #re-frame too. You might want to try that channel.

adam16:07:29

hiskennyness: Thanks, I didn't know that channel existed.

ag20:07:08

I'm playing around with a simple project with only deps.edn and I'm not sure how to hook up figwheel to work with a custom ring handler. Do I still need to use figwheel-sidecar? How do I compile Clojurescript now? Do you still need to use cljs.build.api? Which figwheel should I use?. It seems Bruce started rewriting figwheel to work with deps.edn (figwheel-main). Does anyone have an example project?

ag20:07:13

Bruce's own flappy-bird-demo is too simple, doesn't show how to tweak various fighweel and cljs compiler options

john20:07:23

@ag there's a #figwheel-main channel btw

john20:07:55

but I did notice he wrote some notes about embedding in your server here: https://github.com/bhauman/figwheel-repl

ag20:07:38

oh wow... that's another thing I have never seen. Cljs landscape at the moment seems to be... very confusing

john20:07:17

Yeah, a bunch of tooling work got funded and so there's been a lot of churn in that space

ag21:07:33

This is awesome! I guess (as usual) I'll pick, try and choose things... shouldn't be too hard (I hope)

john21:07:21

Ideally it'll be less hard than the first time 😉 but I'm not sure if all of the pieces are in place yet to go pure clj/cljs.main. Should definitely be there sometime in 2018, I'd think.

john21:07:22

(I mean, for all use cases)

ag21:07:33

so this is what my ideal setup would be: - deps.edn (no lein, no boot) - figwheel (must have, there's no question) - integrant (I can't imagine getting reloaded workflow without it)

john21:07:55

I may recall david nolen talking about embedding a cljs repl in a server - not sure if it was figwheel - some time ago, and he does have a new class coming up in NYC on new tooling workflows, I believe

john21:07:25

Also, there's edge, I believe from the juxt folks... one sec

john21:07:35

oh and it even has integrant 🙂

john21:07:18

that's pretty much exactly what you want right there 😂

ag21:07:45

oh awesome... I'll check it out thanks

john21:07:50

eh, not sure if it has a figwheel server endpoint in there yet, but you might be able to get one in there using figwheel.repl

ag21:07:55

wow... that thing has a lot of stuff... I love it!

john21:07:26

Yeah, juxt has a bunch of great resources

didibus21:07:40

"The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)"

didibus21:07:05

When did this happen? Is the syntax for defmulti in cljs different than in clj ?

mfikes21:07:05

@didibus That was probably changed long long ago. The syntax for defmulti is the same in ClojureScript as it is in Clojure. You probably just used some form that triggered that diagnostic.

mfikes21:07:43

That diagnostic will trigger if it thinks you have passed in more than one option. (The only options supported are :default and :hierarchy.)

didibus21:07:08

hum, ya, I'm probably just having a brain fart, I really thought the syntax used to be (defmulti name args-vector dispatch-fn)

didibus21:07:28

But I guess it never needed the args in the defmulti

mfikes21:07:24

Right. I often catch myself putting an args vector—it really goes in the dispatch fn

didibus21:07:14

So now I'm curious, can defmulti be overloaded?

mfikes21:07:02

By that, do you mean multi-arity?

didibus21:07:46

Ya, like 2 arguments go to one set of dispatch fn, 3 argument another, etc.

oscar21:07:38

You can pass a dispatch-fn that has multiple arities (fn ([x] x) ([x y] y)). You just need to make sure that you don't dispatch to any of your methods with an arity that they don't understand.

didibus21:07:45

that's fancy

mfikes21:07:08

Yeah—it would seem that things just need to “line up” at runtime

didibus21:07:30

I think not, but I thought I'd ask

didibus23:07:00

Any reason *main-cli-fn* doesn't have a default value? Would have been nice to default to -main for example.

mfikes23:07:38

@didibus If it were to default to -main, which one would it default to? (In other words *main-cli-fn* needs to be set to a function value, but it is up to you to set it to foo.core/-main, bar.core/-main, or any other function like baz.core/quux.)

mfikes23:07:41

(As an aside, now that cljs.main is a thing, its --main / -m argument is an alternative.)

didibus23:07:38

@mfikes Hum, ya, good point. I guess I was imagining gen-class could still be used to identify -main. But gen-class doesn't exist, for good reasons. I guess it would have been confusing to have a no-op gen-class used only for that