This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-18
Channels
- # aws-lambda (3)
- # beginners (57)
- # boot (3)
- # bristol-clojurians (1)
- # cider (38)
- # cljs-dev (23)
- # clojure (35)
- # clojure-italy (32)
- # clojure-nl (6)
- # clojure-spec (35)
- # clojure-uk (132)
- # clojurescript (34)
- # cursive (22)
- # data-science (1)
- # datomic (54)
- # devcards (1)
- # duct (5)
- # editors (7)
- # euroclojure (4)
- # fulcro (40)
- # graphql (1)
- # hoplon (6)
- # immutant (5)
- # jobs (1)
- # off-topic (22)
- # om (1)
- # planck (17)
- # portkey (1)
- # protorepl (12)
- # re-frame (97)
- # reagent (67)
- # reitit (16)
- # ring-swagger (1)
- # shadow-cljs (98)
- # spacemacs (8)
- # sql (20)
- # tools-deps (60)
how can I force shadow-cljs to use a local version of a library (installed via lein install
for example) instead of fetching it from clojars, etc.? I know I can override individual files, but in this case I'm testing changes to the library's dependencies so it'd be easier to use the JAR that I've locally built.
awesome. i did try that, but haven't realised that the library in question has subprojects that also needed to be lein install
d. thank you, it's very easy with shadow-cljs, as always.
Hello, I just noticed that shadow-cljs doesn't pick up changes after a while watching a build. I'm on shadow-cljs 2.4.2.
Well, It's actually really vague 😛.. I'm running shadow like so npx shadow-cljs watch app
and after a while shadow is not compiling new changes anymore. @timovanderkamp ran into the same issue today. If it occurs again and when I have more info I will keep you updated
How would I phrase require('dotenv').load()
in a shadow :require
statement?
Thank you!
Can someone help with: https://stackoverflow.com/questions/50911612/how-to-get-devcards-working-with-shadow-cljs
you are most likely running into https://github.com/bhauman/devcards/pull/135
Just looking in the fulcro template right now, and can't see a call to start-devcard-ui!
there, yet it uses cards.
@cjmurphy https://github.com/fulcrologic/fulcro-lein-template/blob/fd57821e03b05313d2e3c36306f1e02e955c184d/resources/leiningen/new/fulcro/shadow-cljs/src/cards/fulcro_template/cards.cljs#L5
maybe you were looking at fulcro-template
? that was the old one that we usually clone
Yes I was looking at fulcro-template
. Never have looked at fulcro-lein-template
as cloning has always been good enough for me. Didn't realise that fulcro-template
had become old. That should give me enough to fix the issue. Thanks @wilkerlucio
no problem 🙂
question about file structure: i have a couple of files that have many functions in them (server calls and state manipulation). almost everything in my code base depends on them. the problem is that compilation is is taking 9-10 seconds. i’m a little surprised by that because it only causes 12 files to recompile and this is not a huge code base.
is this expected, and if so, should i just work on breaking up the files so that the dependencies are more targeted?
@lee.justin.m what are you doing in that file? 9-10 sec seems excessive? how long does compiling cljs.core take on your machine?
@thheller any edit, even to a comment, will cause the recompile. how do i test cljs.core?
I'd love to get my hands on that file just to use it as a basis to tweak the compiler 😉
(note that i am not running a server while doing this, in case it matters. i usually just run the watch command directly and i killed it before doing this test)
I have some ideas for making live-reload perf better but they all involve using the analyzer data more intelligently
currently if you change one file all the files that depend on that file directly are also recompiled
say you change (defn foo [a b])
to (defn foo [a b c])
the others need to be recompiled to get the warnings
before i asked my question, i didn’t have verbose on, so i was just reporting the total recompile time, which was 10s. now that i restarted, the total recompile time is 1.6 seconds.
i think i’ve noticed this before but didn’t believe it, but now i’ll pay closer attention (and i should have data because verbose is on)
hey all - I started working on an idea I’ve been thinking about for awhile - a new lib for creating React components using hiccup: https://github.com/Lokeh/hx
interested in getting some feedback from people and thought users of shadow-cljs users might appreciate some of the goals 😅
$
this is a really neat trick (unfortunately the code format in Cursive always breaks it apart 😞
I like the ease of use that reagent has in that it gets annoying having to type (compile-hiccup ...
over and over when you break out for some actual Clojure code
this https://github.com/thheller/shadow/wiki/shadow.markup takes care of having to type :div.page-title
and just calling (page-title ..)
looks better anyways 😉
I think that the thing I appreciate the most about hiccup is it gives you the ability to run transformations over the code before actually computing the React tree
although when you start taking the all-macro approach like hx the value might be less 😛
https://code.thheller.com/blog/shadow-cljs/2018/06/15/why-not-webpack.html Am I reading this correctly that npm deps do go through google closure in a clever way?
Hi thheller, I encountered an issue releated with cljs.spec.alpha/fspec
: the code always throw error Error: Var clojure.test.check.generators/return does not exist, clojure.test.check.generators never required
even though I have already required clojure.test.check.generators
. I reproduced the issue in
@bolasblack yes, 1.10.312
currently has a problem
But if I use clj --main cljs.main --repl
, the code works fine
You can have a try with my repo
@bolasblack sorry 1.10.238
in combination with shadow-cljs
its a shadow-cljs issue really. one of the compiler hacks I did for externs inference breaks due to a change in what code the exists?
macro generates
I understand 🙂
This issue is not so important to me, so I can wait until you are willing to fix it. 🙂
@lilactown one feedback, I find cool the trick for $
, but this also is a problem... it generates syntax, I might be a purist here, but I dislike it in same way I dislike =>
on midje, it seems cool until you want to apply paredit things, then the beatly of simplicity falls apart, I really got used to om.next style of having functions, they are easier to separated from vectors while reading, are faster (since there is pre-processing, they already return the elements). for $
I would hater you just have a function that does it: $ [:div "bla"]
vs ($ :div "bla")
and the later doesn't need macro expansion 😉
I only tested it with my editor setup (spacemacs clojure layer) but if it doesn’t work under Cursive or paredit then that’s a problem
I’ve been thinking about adding an interceptor-style way of extending the hx.react/compile
macro so it might be a good way to add it as an optional transform
I’m trying to avoid putting too many things into the hx
lib… I do want to explore how I can enable transforms like that to be added easily, though
I already have a reagent-like state management with atoms implemented in https://github.com/Lokeh/hx/blob/master/src/hx/state.cljc 😂 I need to split it out from hx
though