This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-20
Channels
- # ai (4)
- # aleph (1)
- # babashka (127)
- # beginners (89)
- # calva (44)
- # cider (22)
- # clerk (74)
- # clj-commons (5)
- # clj-kondo (3)
- # cljs-dev (51)
- # clojure (117)
- # clojure-europe (22)
- # clojure-nl (2)
- # clojure-norway (100)
- # clojure-uk (2)
- # clojurescript (64)
- # data-science (26)
- # datalevin (3)
- # datascript (2)
- # emacs (10)
- # events (5)
- # figwheel-main (12)
- # helix (2)
- # honeysql (15)
- # hoplon (3)
- # jobs-discuss (32)
- # malli (3)
- # polylith (3)
- # re-frame (2)
- # reitit (15)
- # releases (2)
- # sci (14)
- # shadow-cljs (14)
- # specter (2)
- # tools-build (7)
- # xtdb (16)
@grzegorz.rynkowski whether the workspaces dep is on the classpath or not has no effect for a release build, so just always having the :ws
alias active is not a problem. a build only uses whats directly required by the code, not everything on the classpath. not sure why you'd need it to be disabled for release
. you can always run a release build manually via clj
or clojure
, with whatever aliases you want though. npx shadow-cljs release app
is equiv to clj -A:whatever:aliases -M -m shadow.cljs.devtools.cli release app
generally shadow-cljs has no option to selectively uses aliases because it isn't needed https://code.thheller.com/blog/shadow-cljs/2018/02/08/problem-solved-source-paths.html
Hi folks - I have one .js
file required locally from the classpath (i.e. not from npm) - it, however, also depends on some npm bits, etc. :advanced
compilation seems to be making a dog's breakfast of it - externs aren't really being inferred, etc, and so method calls (& properties) are being renamed even though they have to be preserved because they are interop with some npm packages.
Can I disable :advanced
optimizations for the local js files, much like npm deps don't go through it?
If not, is my best bet to write a manual externs file?
OK, I'll give that a try. I don't need to access cljs from it, so that bit is fine. Thanks!
commonjs is processed just like any other npm code, but on the flip side your CLJS code accessing it might then need externs 😛
Rewriting it as cjs seems to have done the trick, though. It's a bit hacky, but perfectly livable. Thanks!
Hi everyone! I'm trying out the reader conditionals in order to make my project's config behave differently on Node vs. the browser. Here is what I have:
(ns config.env
(:require #?@(:node [[config.server :as server]]
:cljs [])))
#?(:node
(defn setting [path]
(let [result (get-in server/env pointer)]
(when (nil? result) (js/console.warn "Got a nil config value for " pointer))
result))
:cljs
(defn setting [pointer]
:noop))
My node build, however, consistently uses the :cljs
variant, the :node
is ignored. What may I be doing wrong? Using Shadow-cljs 2.23.8 (directly from the Clojure CLI, not npm).