Fork me on GitHub

is it safe to retain the .shadow-cljs directory between release builds of clojurescript? we previously have been deleting that folder before we run a release build, in fear of stale cache or dependencies. retaining it makes our build at least 1 minute faster, so we want to see if its safe to no longer delete it between release builds


yes, safe. I never delete mine. no cache issues for a couple years now


cool, thank you!


hi I'm using below build config and :module-hash-names doens't work, the output is still client.js file without any hash :thinking_face:

:client {:target :esm
           :runtime :browser
           :output-dir "dist/client"
           :modules {:client {:entries [app.client]
                              :exports {hydrate app.client/hydrate-app}}}
           :devtools {:before-load app.client/stop
                      :after-load app.client/start}
           :module-hash-names 8
           :build-options {:manifest-name "manifest.json"}}


:module-hash-names currently is only supported for :browser builds

👍 2

I've read but I'm still a bit confused on the best practice for packaging a cljs library that depends on a [single] js library. Currently the js and externs are included in the project. Should I just the stub namespace with js/goog.exportSymbol described in the shadow docs and add that stub to the library source code and call it a day? Specifically, I'm trying to address this issue in this project:


you can change this file


to provide decimal.js instead of decimal.extern.decimaljs


then in the code actually (:require ["decimal.js" :as dec]) or so


and then also add :npm-deps {"decimal.js" "version"} to the deps.cljs file


shadow-cljs will be happy with that


and the others will just use the bundled foreign lib as before


or need to hange the js/Decimal uses as well to use the alias. I'm not entirely sure what you need to add to deps.cljs for that to work though


suggest looking at cljsjs/react or so, they do that


Awesome, thanks!


Ugh, back to EISDIR! All my RN experiments seem to end here. 😭 Any thoughts on how this suddenly arises? Thx! 🙏

Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (node:fs:626:3)
    at tryReadSync (node:fs:391:20)
    at Object.readFileSync (node:fs:428:19)
    at UnableToResolveError.buildCodeFrameMessage (/Users/kennethtilton/dev/matrix/cljs/shadow/matrixrn/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:304:17)
    at new UnableToResolveError (/Users/kennethtilton/dev/matrix/cljs/shadow/matrixrn/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:290:35)
    at ModuleResolver.resolveDependency (/Users/kennethtilton/dev/matrix/cljs/shadow/matrixrn/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
    at DependencyGraph.resolveDependency (/Users/kennethtilton/dev/matrix/cljs/shadow/matrixrn/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
    at /Users/kennethtilton/dev/matrix/cljs/shadow/matrixrn/node_modules/metro/src/lib/transformHelpers.js:271:42
    at Server.<anonymous> (/Users/kennethtilton/dev/matrix/cljs/shadow/matrixrn/node_modules/metro/src/Server.js:842:41)
    at (<anonymous>)
....etc etc


n.m. Looks like quite a mess overall.


hmm odd. maybe there is a directory with the same name of a file or so?


OMG. Happens only if (a) I have the dev console open (b) in the Expo debugger_ui, @U05224H0W. Then:

DevTools failed to load source map: Could not load content for : Fetch through target failed: Target not supported; Fallback: HTTP error: status code 500, net::ERR_HTTP_RESPONSE_CODE_FAILURE


don't know what that means sorry. not a shadow-cljs error, proably RN


Oh, sorry, @U05224H0W. It means I can just ignore those. 🙂 Part of getting up to speed on a new stack and is figuring out which garbage coming out of our tools can be ignored. I prolly gave up on three efforts because sth was going wrong and then I noticed the EISDIRs and gave them the credit. It's a good thing I like this game! 🙂


Yes, Expo is blaming RN. I am always happy to see FB engineers dragged thru the mud. 🙂


Hi all, I’m trying to use the lib in a helix project and I’m struggling to get the css importing. I can load from CDN, but the css is larger and they recommend not to do this, but instead allow for webpack to tree shake the css. How would I convert an import statement like @import "antd/dist/antd.css"; listed in their docs which pulls from node_modules/antd to work with a shadow project?

Ryan Jerue19:09:46

I just have this stuck in the head of my index.html

<link rel="stylesheet" href="" integrity="sha512-Gfp2ZD1ULgfgThJArElWdfu/bPK67HVrx+rKfLfclPyRUlf68R7uHIy5zaPnZpv6ZuIX/ykmJCv3Q1bnfZngEg==" crossorigin="anonymous" referrerpolicy="no-referrer" />


Any thoughts on size though? @U01GNU0Q0MB - I see they mention they strongly recommend not importing from Cdn


What do you think?


I guess it’s pretty well cached at this point

Ryan Jerue19:09:20

As for size, this is just the CSS being loaded. If you were to do it using an import, it would import the same thing. Size argument comes into play with the actual js components

Ryan Jerue19:09:47

I’m not sure what optimizations shadow will do (if any) for tree shaking. Webpack will do a ton which is why they don’t suggest the cdn


I see ok great


Got it makes sense.


by the way I’m using postcss and tailwind jit and that is working well. Wondering if I should be plugging in antd css into that build pipeline somehow?

Fredrik Andersson21:09:32

I'm trying to use Firebase 9.0.1 web-api. Googles documentation names the version "Firebase Modular Web SDK v. 9.0" which I suppose means that it utilize es6 modules? I'm not well versed in es6 so I don't understand this very well. I just wan't to know how I would use them in clojurescript with shadow-cljs