This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-06
Channels
- # announcements (7)
- # aws (8)
- # babashka (9)
- # babashka-sci-dev (11)
- # beginners (37)
- # calva (50)
- # cider (15)
- # clj-kondo (30)
- # clj-otel (3)
- # cljdoc (16)
- # cljs-dev (26)
- # cljsrn (4)
- # clojure (168)
- # clojure-doc (1)
- # clojure-europe (17)
- # clojure-gamedev (4)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-spec (17)
- # clojure-uk (16)
- # clojurescript (27)
- # community-development (3)
- # css (3)
- # cursive (9)
- # datomic (25)
- # emacs (1)
- # events (4)
- # fulcro (2)
- # google-cloud (2)
- # graphql (11)
- # gratitude (9)
- # humbleui (16)
- # hyperfiddle (2)
- # jobs (1)
- # london-clojurians (1)
- # lsp (16)
- # malli (2)
- # off-topic (71)
- # pedestal (4)
- # polylith (9)
- # portal (94)
- # reagent (6)
- # reitit (2)
- # releases (1)
- # remote-jobs (2)
- # sci (9)
- # shadow-cljs (49)
- # spacemacs (8)
- # tools-build (2)
- # tools-deps (39)
- # vim (7)
- # xtdb (6)
One simplistic approach is to have a command basically copying the css (probably in a “dist” folder within the package in node_modules), and add it as an html tag in your html template. If you don't want to set up a postcss/webpack flow. Something like this in package.json: `"scripts": { "copy-css": "cp ./node_modules/@mylib-xxxx/dist/the-css….css ./public/css/the-css”`
https://shadow-cljs.github.io/docs/UsersGuide.html#build-hooks comes to mind, but I'm not sure what you're searching for
yeah, I mean only for the first compile, ie when the app is ready, but I can do it with a compile hook that only does something the first time it's called
is there also an easy way to pass state to https://github.com/nextjournal/clerk/commit/c3b7e36dbd22b823a30159248d293ccb2536fdaf#diff-0715252f101f7970d11ac0d8396c68d292b1f376ad23cffffe7db2fcfa6843bcR15 ?
to shadow.cljs.devtools.cli-actual/main
I mean or should i be using a different entrypoint?
why are you calling that at all? that is only the entry point for the command line tools. what is the goal there?
maybe looking for https://shadow-cljs.github.io/docs/UsersGuide.html#embedded?
thanks, yeah that’s better. I thought it would be much more work to get the same thing but turns out it’s only two lines 🙃
only difference to my invocation via main
is that I’m seeing a few extranous log lines
May 07, 2022 1:43:39 PM io.undertow.Undertow start
INFO: starting server: Undertow - 2.2.4.Final
May 07, 2022 1:43:39 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.8.0.Final
May 07, 2022 1:43:39 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.8.0.Final
May 07, 2022 1:43:39 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.1.0.Final
May 07, 2022 1:43:40 PM io.undertow.Undertow start
INFO: starting server: Undertow - 2.2.4.Final
shadow-cljs - HTTP server available at
then you can just require this https://github.com/thheller/shadow-cljs/blob/20c75b6b11a64a6910a4f95f4dcae195f76d0562/src/main/shadow/cljs/silence_default_loggers.clj#L1
well shadow.cljs.devtools.api/watch
returns when the build finishes. that might be enough?
much nicer: https://github.com/nextjournal/clerk/commit/de32491b390c43e8a66340447a983b888b7e289f Thanks again!
shadow-cljs starts one. might be useful since that one also supports cljs while the other one does not?
booting only nrepl takes 4-5s on my machine, and nrepl via shadow adds another ~3 seconds…
another small things why I’m starting nrepl manually: then the same port file is written regardless of when I use jack-in
(for clj-only dev) vs starting only shadow
unsure if it might make sense for shadow to delete .nrepl-port
when it boots. Maybe after checking that there’s nothing listening on the port but might also be too much magic…
no, shadow won't delete that file as that would interfere with stuff it doesn't control. it writes its own .shadow-cljs/nrepl.port
file
yeah, but when I kill the process that’s writing .nrepl-port
and start shadow afterwards I manually need to delete it
when working on clerk, I sometimes do clj-only dev, and jack-in using cider, so shadow isn’t even on the classpath. This writes a .nrepl-port
file. When I kill that process or it dies, the .nrepl-port
sticks around, and when I launch nrepl via shadow next time, cider doesn’t consider shadow’s shadow-cljs/nrepl.port
file, because the other one takes precedence and I need to manually delete it so I can connect again.
seems like something cider should handle on its own? I mean it knows if the connect succeeded or not?
Hi everyone. Hope you are all doing well! What docker image do you use to run shadow-clj apps? I found these two, but they seem kinda unmaintained
Do you mean, to compile the code? I usually use a node docker image with Alpine and just install OpenJDK on it
I mean use as runtime (for dev and prod)
I have no idea what you mean then... Shadow-cljs is only to compile ClojureScript into Javascript, the resulting code is pure JS and you only need to run on a webserver (for browser targets), or on node (for node library and script targets), or at Android and iOS (for react-native). In that sense, maybe you need to look for a apache or nginx docker, or a node docker to run your compiled code?
Is there any way to use def
but alter the :arglists
meta? I tried the suggested solutions but they all failed to update :arglists
(tried with alter-meta!
, that didn't change any metadata at all, tried with (declare ^{:arglists '([a b])}
my-fun)`, that also didn't work)
var metadata doesn't exist at runtime in cljs. if only lives in the analyzer data on the compiler CLJ side. as such any var based meta programming is severly limited and imho should not be considered at all. just treat it as if vars don't exist. what is your goal with modifying :arglists
?