This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-02
Channels
- # announcements (3)
- # aws (8)
- # babashka (87)
- # babashka-sci-dev (3)
- # beginners (34)
- # calva (35)
- # clerk (2)
- # clj-commons (47)
- # cljdoc (10)
- # cljs-dev (21)
- # clojure (19)
- # clojure-android (1)
- # clojure-austin (2)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (67)
- # clojure-uk (9)
- # clojuredesign-podcast (7)
- # clojurescript (24)
- # code-reviews (20)
- # cursive (6)
- # datomic (12)
- # emacs (14)
- # events (1)
- # fulcro (7)
- # gratitude (1)
- # hoplon (8)
- # hyperfiddle (23)
- # juxt (22)
- # meander (11)
- # nyc (3)
- # overtone (2)
- # podcasts-discuss (1)
- # reagent (3)
- # releases (1)
- # sci (27)
- # shadow-cljs (73)
- # squint (4)
- # thejaloniki (3)
- # xtdb (7)
@thheller regarding updating the gcc version: exactly 1 test in clojurescript master branch fails when using v20230802
, so we may want to wait before using this version in shadow-cljs.
lein test :only cljs.build-api-tests/cljs-2077-test-loader
ERROR in (cljs-2077-test-loader) (Reflector.java:416)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.IllegalArgumentException: No matching field found: sourceMapOutputPath for class com.google.javascript.jscomp.CompilerOptions
at clojure.lang.Reflector.setInstanceField (Reflector.java:416)
cljs.closure$make_options.invokeStatic (closure.clj:355)
cljs.closure$optimize_modules.invokeStatic (closure.clj:1448)
...
cljs.build_api_tests/fn (build_api_tests.clj:207)
...
this patch is sufficient to fix the test and make everything succeed… what I find strange is that the field CLJS is attempting to set has been private for over a year… so why would it pass in the may version but not the august version??
good catch, i didn't read the year correctly. given what you've said about shadow-cljs not using cljs.closure, then all that is left is to test shadow-cljs itself
is there a way to choose aliases per build, and per release/dev?
I am depending on a library, but also want to move images from that library into the resources/public/images folder. I thought about using a build hook to move the images, but is there another way as well?
Can you use a symlink into node_modules
?
the library depended on is in our own control as well by the way
preferably the interface is such that we only add that library in our project.clj and the resources are shared, but can imagine this is blocked for security reasons or so
maybe by adding something like
:resource-paths ["src/resources" "path/to/library/resources"]
thanks! and for a release build?
yes nginx just serves
ah okay so for that i do need a build step
thanks!
I’m using this in my .clojure/deps.edn
:main-opts ["-m" "shadow.cljs.devtools.cli" "--config-merge" "{:devtools {:preloads [my-preload]}}"]
My problem is that I need the preload to replace the preloads vector in the project deps.edn
, not add to it. Is there a way to do that?the current approach is to keep the tooling strictly out of the main project. If that’s impossible, I’ll consider alternatives
doesn't mean there can't be but I want to understand the use case before considering anything
So to be more specific and concrete, we have: 1. A preload for a dev tool in the project 2. Per-dev tooling that require preloads. Some require a certain order relative to the pre-configured one
(ns foo.preload2 (:require [foo.preload1]))
even with :preloads [foo.preload2 foo.preload1]
this ensures that 1 loads before 2
yeah, but since all of these except the pre-configured one are optional, they can’t really require each other
I could also add all tooling as aliases in project deps.edn. There’s still the issue of how to compose the preloads in config-merge
can you specify what these preloads do in the first place? I guess I don't quite get what they do
or have a script that launches shadow, and solve this on the CLI by having the default watch startup provide --config-merge {:preloads [default-preload]}
• Malli function instrumentation init • Malli clj-kondo config generation watcher • Flow-storm debugger • Hashp logging tool Where Flow-storm is optional, and has to be first if it’s included
I guess you could use a build hook. thats just CLJ code that can do pretty much anything
We have a script that sets up parameters for shadow-cljs, I managed to fix it there by specifying aliases and preloads, with defaults. That does what we need. Thanks a lot for talking through this with me!
Is it possible to have different aliases per build and per dev/release?
the :flow-storm
alias has the flow-storm code, but I do not want the flowstorm code in the release build.
the problem I'm encountering is that when run via cider, the only aliases that seem to be respected are the ones used in the top level
:deps -> :aliases
path
the only thing that controls what ends up in your build is your code and build config
thus if you require any flowstorm related code in your namespaces it will be part of your build
deps.edn or aliases are not relevant to this in any way as a required namespace is always required and not optional
so you can just leave it in the config for release builds, it won't affect the build
Ok -- but my question was how can you selectively include aliases
you can launch via clj directly, and nothing is stopping you from using whatever aliases there
I'd recommend using your development aliases by default in shadow-cljs and running via clj directly for release builds
Unless we can change deps on a per build basis, I'd need two different shadow-cljs files
as I just explained. you can do whatever you want when running with CLJ directly. shadow-cljs itself does not and will not support defining per build aliases
Ok, great 🙂 Does it support different shadow-cljs files? clj -A:whatever
doesn't play as nicely with CIDER for me
if not I'll work around it
Ok, thanks 🙂