This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-01
Channels
- # announcements (1)
- # babashka (1)
- # beginners (45)
- # business (3)
- # calva (43)
- # clojure (57)
- # clojure-spec (6)
- # clojure-uk (4)
- # clojured (8)
- # clojurescript (14)
- # cryogen (3)
- # datomic (2)
- # emacs (36)
- # fulcro (20)
- # garden (2)
- # jobs (2)
- # lumo (3)
- # meander (9)
- # off-topic (1)
- # other-lisps (1)
- # reagent (13)
- # shadow-cljs (25)
- # spacemacs (20)
- # tools-deps (11)
@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"}}}
... }}
Thanks! I really like the design system, I just didn't have time to figure out how to prune it :)
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.
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?
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>
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.
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!
Hereās the embryonic project, in case anyoneās curious: https://github.com/Deep-Symmetry/bytefield-svg
@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)))
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.
dunno how current/accurate this still is https://shadow-cljs.github.io/docs/UsersGuide.html#cider
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.
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.
But shadow-cljs
also provides clj-repl
... Was I wrong expecting shadow-cljs to cover both backend and frontend tasks?
it is written in CLJ so you can run CLJ code ... but there is no specific support for anything "backend"