Fork me on GitHub
#clojurescript
<
2018-04-19
>
mv03:04:32

Is there a preferred example for how to structure a codebase for a clojure backend, cljs frontend web app?

gklijs04:04:12

@mv #luminus provides a nice setup.

mv04:04:15

Thanks!

mv05:04:32

What should I be looking for when I get this error: Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V

bumblehead05:04:04

is there a non-browser unit-testing tool recommended for clojurescript?

thheller07:04:26

@mv most likely a dependency conflict with guava. check with lein deps :tree and try to resolve the conflicts.

🙏 4
fmn07:04:50

@mv If you are using datomic and experiencing such error try adding [com.google.guava/guava "24.1-jre"] to your dependency

🙏 4
ingesol10:04:13

I made a #kee-frame channel for https://github.com/ingesolvoll/kee-frame. Don't hesitate to ask questions or make suggestions! I'm also following kee-frame messages on this channel.

bhauman11:04:38

deployed figwheel 0.5.16-SNAPSHOT

bhauman12:04:50

@robert-stuttaford working away on the figwheel as per the usual 🙂

robert-stuttaford12:04:17

-grin- i don’t doubt it! you’ve been doing stellar work dude

bhauman12:04:46

@robert-stuttaford thanks! and it seems like you've been pretty darn active yourself

bhauman12:04:56

things going well?

robert-stuttaford12:04:56

super well - super busy!

bhauman12:04:02

it sure sounds like it

borkdude14:04:42

What’s happening here?

(let [{:keys [:tags]} '(:tags '(:intervention))] tags) ;;=> (quote (:intervention))
(let [{:keys [:tags]} [:tags [:intervention]]] tags) ;;=> nil

borkdude14:04:44

I mean, the first destructuring returns something while the data structure destructured isn’t a map

borkdude14:04:23

Ah, my colleague explained. The first case is support for optional args

dpsutton14:04:44

optional args?

borkdude15:04:34

optional keyword args: (foo 1 2 3 :opt1 4 :opt2 5)

borkdude15:04:01

where (defn foo [x y z & opts] ...)

borkdude15:04:37

so opts will be a sequence '(:opt1 4 :opt2 5) and apparently destructuring works for this as well.

Alex Miller (Clojure team)15:04:51

yes, you can associatively destructure a sequential collection as if it were a map

borkdude15:04:27

@alexmiller then why (let [{:keys [:tags]} [:tags [:intervention]]] tags) ;;=> nil

Alex Miller (Clojure team)15:04:58

vectors already are associative (by map of index to value) so won’t work for those

Alex Miller (Clojure team)15:04:12

will work for sequences or lists

borkdude15:04:25

so if you wrap it in seq it’ll work

lwhorton18:04:16

is there a way I can “shadow over” someone’s namespace?

ns.lib-a

(def :a/some-ns-kw)

ns.my-code
(def :a :lib.b/some-ns-ks)

ns.my-other-code
{my-code "hello"}

lwhorton19:04:37

seems fishy. i’m wrapping a library but I don’t want my app code to have to depend on that library’s namespaced keys, so I just want to point from my own artificial namespaced kws to theirs.

cjohansen19:04:58

you’d have to manually translate

lwhorton19:04:19

how do you mean?

cjohansen19:04:16

I’m not sure I understand the question, but there’s no way to automatically translate them. You’d have to replace your namespaced keys with the library’s on the way in, and the other way around back out

cjohansen19:04:42

but I don’t really understand your code sample

lwhorton19:04:46

the more i think about it I think i’m trying to mix a clj macro which is referring to a cljs ns. i think my real and entirely different question is can clj macros write code to refer to cljs namespaces. i don’t see why not.

severo22:04:37

anybody using vim-fireplace with piggieback to develop in cljs?

andre.stylianos12:04:21

@UA4N902JG there's a #vim channel. Probably better to ask there.

lwhorton15:04:22

yessir. after much ado @UA4N902JG I was able to get it working simply with :Piggieback :id-of-app via shadow-cljs, but its similar with lein

severo16:04:46

@U0W0JDY4C managed to get it working thanks to a topic in #vim 🙂