This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-15
Channels
- # announcements (1)
- # babashka (1)
- # beginners (43)
- # cider (2)
- # clj-kondo (29)
- # clojure (61)
- # clojure-austin (18)
- # clojure-dev (7)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (5)
- # clojuredesign-podcast (8)
- # cloverage (1)
- # conjure (1)
- # data-science (1)
- # datahike (36)
- # datavis (1)
- # datomic (23)
- # emacs (14)
- # hyperfiddle (28)
- # lsp (5)
- # missionary (1)
- # music (1)
- # off-topic (11)
- # re-frame (11)
- # reitit (5)
- # releases (1)
- # shadow-cljs (65)
- # spacemacs (13)
- # squint (33)
- # tools-deps (56)
Quick question:
I'm making a fullstack project (pedestal + reframe) and so far I've been using the same repl that npx shadow-cljs watch app
spawns to run my clj stuff (in a different nrepl session than the piggybacked cljs one). Where does this repl picks its deps / source paths from? If I want to add an additional source path, should I switch to moving all my deps in an alias in deps.edn
and use it with :deps [:cljs]
in shadow-cljs, or I can somehow define further (:dev) aliases to be used from deps.edn
in shadow-cljs.edn
?
it entirely depends on your preference what you do. everything in deps.edn, clj in deps.edn, cljs in shadow-cljs.edn, all works
(i have already read this section of the guide, I'm just asking if this is the only way)
So for starters where does the repl of shadow-cljs pick its classpath and source paths from?
if you want ONE repl that handles CLJ and CLJS I recommend moving everything to deps.edn
So my last question is, with :deps [:alias-1 :alias-2] in shadow-cljs.edn you can use multiple source paths from multiple aliases
with :deps
set, :source-paths
and :dependencies
in shadow-cljs.edn
are not used and can be removed
Another minor cross check: I suppose when defining the :deps vector in shadow-cljs.edn it also uses the default deps and paths from the root of the deps.edn right?
so with deps it will call exactly clj -A:cljs:dev -M -m shadow.cljs.devtools.cli watch app
if you do npx shadow-cljs watch app
I'm curious why Node targets in shadow-cljs default to advanced optimizations. This page: https://clojurescript.org/guides/quick-start#running-clojurescript-on-node.js ...says: "Note: Under Node.js there is little reason to use advanced optimizations. ... For Node.js, simple
or none
optimizations suffice."
because I think that :advanced
is still very useful. you are free to set it to :simple
, but I disagree with that statement
OK simple enough! 👍
have you documented what you find useful w/ node + advanced? no need to elaborate here if you haven't. just curious if I can go educate myself on my own time somewhere.
https://www.npmjs.com/package/shadow-cljs the package is 237 kB, with :simple
it'll be considerably larger
makes sense. thanks!
Any reason the :target :esm
:modules {:name {:exports ...}}
construct couldn't support :exports-var
instead like the :node-library
target? I'm building both from the same codebase and it would be great if I could point both of those at the same var w/ my exports. May have to deal w/ keywords vs. symbol keys, I guess.
in CommonJS module.exports = some.ns.foo;
is valid, while ESM export some.ns.foo
is not
hmm... not sure I follow the implications there fully. I have the same data structure repeated in two different places mapping keywords to fully-qualified vars in one place and unqualified symbols to the same fully-qualified vars in the other. would like to DRY that up if possible. but it sounds like it's complicated so happy to leave it at that if so.
seems odd that it would be impossible since it's basically the same data structure in both places. just symbol keys in one and keywords in the other.
i.e. this: https://github.com/fluree/fluree.crypto/blob/38b2b2c9de8592ad3f3912b87302799c063411f4/shadow-cljs.edn#L34 vs this: https://github.com/fluree/fluree.crypto/blob/38b2b2c9de8592ad3f3912b87302799c063411f4/shadow-cljs.edn#L26
where the latter is pointing at this: https://github.com/fluree/fluree.crypto/blob/38b2b2c9de8592ad3f3912b87302799c063411f4/src/fluree/crypto.cljc#L212
I see
for :node-library
it literally just emits module.exports = fluree.crypto.js_exports;
ah OK
makes sense now thanks 👍