Fork me on GitHub

Looks like in ClojureBridge they still use figwheel instead of shadow-cljs. Anyone know why people would choose figwheel?


Because shadow-cljs is better? I myself can’t think of any reason to choose cljsbuild and figwheel, so I’m curious. Let me rephrase my question, nowadays what advantage does figwheel (or maybe cljsbuild and all the cljsjs stuff) have over shadow-cljs?


both are great tools


Same reason people still use lein even though deps.edn exists. People have tools that work really well for them; why change?


I've switched from figwheel & lein to shadow-cljs and deps.edn in the last year. shadow-cljs provides significantly faster compile time but can be harder to get working with Emacs CIDER. One of the biggest reasons I was willing to try switching was thheller's top notch support in this channel. No regrets, though the compile time is the main benefit I've seen so far. On deps.edn vs lein... the startup time is the only real benefit I've realized yet, but there's some interesting things you can do with deps.edn. Just haven't needed them. It was a much harder switch than figwheel -> shadow-cljs though.


what problems have you found with CIDER?


Biggest wall I hit was trying to use deps.edn to "wrap" shadow-cljs. Your startup invocation becomes clj -A:shadow-cljs watch app, but I couldn't find a way to get that working with cider-jack-in-cljs


I ended up just sticking with cider-jack-in-cljs + shadow-cljs , but my automation uses the clj -A:shadow-cljs release app alias to release the app as it avoids needing a docker image that has shadow-cljs installed


(The reason I needed deps.edn in the first place was to authenticate to a private maven2 repo)


use a prefix to edit the jack in command and type whatever you want


C-u C-c M-J and then just type in clj -A:shadow-cljs watch app


I did mess around with that but could never quite get CIDER working. I suspected it had to do with the dependency injections or initialization hooks that CIDER does when running via clj vs shadow-cljs


I'll poke it real quick and see what error comes out, already deleted my previous logs


if you can get a minimal example without any sensitive stuff i can poke around. I think bozhidar is working on cljs support and i want shadow to be first class in CIDER


That's generous of you, thank you. I'll setup a public repo to demo this and get back to you tomorrow.


ping me with it in #cider and i'll check it out

👍 4
replied to a thread:why not?

Because shadow-cljs is better? I myself can’t think of any reason to choose cljsbuild and figwheel, so I’m curious. Let me rephrase my question, nowadays what advantage does figwheel (or maybe cljsbuild and all the cljsjs stuff) have over shadow-cljs?


Ha guess I’m not the only one with this question.


I didn't get far with figwheel, but from my experience shadow-cljs solves every problem I've ran into in a clean way: • dev http server • can run clojure code (as opposed to lumo et al) • repl ALL THE TARGETS • fantastic integration with npm packages since I personally prefer repl + load file / eval-defun, I'm finding shadow-cljs a lot faster to use than figwheel, which seems dependent on "hot reload" rather than eval


Yeah I know! That’s why I’m asking.


I wish shadow-cljs was the default solution, and people advertise it as the default solutiton.


I guess one would have to ask in the #figwheel what they like about it, that they don't think shadow-cljs solves 🙂


I guess one could say that figwheel only solves one problem. I do however agree that I'd personally recommend shadow-cljs over figwheel. doesn't mean that figwheel is bad though 🙂


I think if you come from another programming language, maybe figwheel is easier to get started with? the docs for shadow-cljs are pretty intimidating 😄


There is an npm starter script you can use to generate shadow-cljs project (`npx create-cljs-project your-projec` )


I came from a js+go+python background. I think figwheel and all the cljsbuild stuff are intimidating


sure, but that doesn't mean that it's easier to comprehend the tool 🙂 when you come from another language, you're generally used to very sparse tooling (`compile-binary source.ext`), so regardless of which tool you choose, it's going to feel like a lot. and shadow-cljs solves so many problems, so might be figwheel feels easier to get started with


this is purerly conjecture on my part


haha, I see 🙂 I got interested in cljs because of the nice figwheel youtube intro


it was very easy to understand what problem figwheel solves


maybe one ought to make a similar video for shadow-cljs? 🙂 looking here it's not immediately clear what problem shadow-cljs solves:


just some thoughts ^^


Does shadow-cljs automatically load user.cljs if it’s on the classpath?


I’m trying to write instructions for how best to include some code only at dev time. I think you could either put it in user.cljs, or put it in a preload


use a prelaod always


cljs/user.cljs is loaded but applies to all builds and REPLs so I wouldn't use it


aha, thanks!


Speaking of preloads, what’s the best way to set up spec instrumentation for a build? I tried calling instrument in a preloads namespace, but that didn’t work (I’m guessing because it gets called before the specs are defined?)


☝️ specifically trying to set up instrumentation for my tests build


in your preloads namespace you need to require all namespaces that you want to instrument


that way it'll be loaded after those namespaces to ensure it can actually instrument them


I see, thanks thheller


Hi, I'm running a fresh lein new re-frame todo +10x +cider +test and at localhost:9630 the Builds tab and the Inspect tab work fine, but the REPL tab just says Loading... forever. Any ideas to try?


use the cider REPL. the web thing is actually gone in the latest version. it'll return when I have more time to work on it

👍 4

Does shadow cache dependencies in the usual .m2 directory? I’m playing with Netlify and I see that my builds always have to re-fetch all dependencies during the shadow-cljs - updating dependencies phase.


I'm using three.js as a node module and importing it to my cljs app works just fine thanks to shadow. three.js also comes with some examples. is it possible to easily import these underlying modules as well, similar to how you can just do import { Ocean } from './jsm/misc/Ocean.js'; in js?