Fork me on GitHub
#shadow-cljs
<
2020-03-01
>
coby04:03:02

I ran into that exact problem. My solution was to stop using ant-design. šŸ˜¢

tekacs22:03:43

@UH85MNSKE in case you ever want to come back to ant, here's my override file, which I provide to shadow-cljs like this:

:builds
{:app
 {:js-options
  :js-options
   {:resolve {"@ant-design/icons" {:target :file :file "overrides/ant-design-icons.js"}}}
  ... }}

coby22:03:16

Thanks! I really like the design system, I just didn't have time to figure out how to prune it :)

deep-symmetry06:03:48

Hello, everyone! Iā€™m a Clojure developer diving for the first time into ClojureScript work, and was pointed at shadow-cljs in response to a question on the #clojurescript channel, and am already delighted at how it is helping me, but I am sure I will have a bunch of questions along the way. The first one is, I canā€™t seem to get a cljs REPL working in CIDER. And I fear the answer may simply be ā€œthatā€™s because your project doesnā€™t support that kind of operation.ā€ But I want to be sure.

deep-symmetry06:03:53

Iā€™m building a Node library, whose purpose is a function that takes as input an EDN string and returns an SVG string. So, there is no server that is running, itā€™s just a script. Which might be why CIDER complains that there is no cljs REPL even after I seem to have jacked in?

deep-symmetry06:03:50

Hmm. I just tried killing everything and jacking back in, and get:

;;  Startup: /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.2 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.23.0-SNAPSHOT server
;;
;; ClojureScript REPL type: node
;; ClojureScript REPL init form: (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))
;;
Execution error (AssertionError) at shadow.cljs.devtools.server.nrepl/shadow-cljs-repl (nrepl.clj:29).
Assert failed: (keyword? repl-env)
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.shadow.user>

deep-symmetry06:03:20

So, it seems kind of connected, but when I do things in my .cljs buffer that needs a REPL, CIDER still complains about there being no CLJS REPL available.

deep-symmetry08:03:36

But there is no urgency: I have been able to complete my port to ClojureScript successfully! This is huge, I am finally going to be able to retire LaTeX, and will be able to create the kinds of beautiful packet diagrams that its bytefield package offered by instead using a Clojure-based DSL inside Asciidoc documents. Woo hoo!

deep-symmetry08:03:07

Hereā€™s the embryonic project, in case anyoneā€™s curious: https://github.com/Deep-Symmetry/bytefield-svg

thheller09:03:25

@deep-symmetry that doesn't look like you are using the correct setup on the cider side. this is not the command it should be using the shadow-cljs.

ClojureScript REPL init form: (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))

thheller09:03:39

I don't use cider and don't know how to configure it but that is the wrong command

deep-symmetry23:03:58

It turns out if I start npx shadow-cljs node-repl in the terminal before I try to connect CIDER, it works! This will make me much happier as I continue to evolve this project. And the ease with which shadow-cljs allowed me to build a Node module is just delightful.

deep-symmetry03:03:46

Ok, thanks. I guess CIDER has fallen behind in their auto-configuration for shadow-cljs. (I didnā€™t change anything in the configuration.) Working without a REPL was painful, but thankfully it was only a small, focused task! Next time I do more ClojureScript work I will see if they have fixed it, or dig deeper.

otwieracz12:03:52

Hey, in shadow-cljs.edn I've got :main target of type :browser which produces UI. I also have .clj foo.core/init function for backend and API. What's the proper way of starting backend together with frontend? shadow-cljs watch main obviously only keeps .js file up to date.

thheller12:03:40

shadow-cljs only handles CLJS related things. CLJ server you need to run separately

otwieracz12:03:34

But shadow-cljs also provides clj-repl... Was I wrong expecting shadow-cljs to cover both backend and frontend tasks?

otwieracz12:03:42

(ie for full-stack apps?)

thheller12:03:25

it is literally in the name shadow-cljs

thheller12:03:56

it is written in CLJ so you can run CLJ code ... but there is no specific support for anything "backend"

otwieracz12:03:11

So for full stack it's expected to work with lein or boot?

thheller12:03:51

or plain deps.edn yes

thheller12:03:22

you are not gonna be using shadow-cljs in production so why tie your development server to it

otwieracz13:03:49

Yeah, that's right.

otwieracz13:03:20

But it seems super useful for development to just fire shadow-cljs clj+cljs repl instead of clj and shadow separately.