Fork me on GitHub
Michaël Salihi07:09:42

Before start to writing a script, is Shadow-cljs manage to clean up the output directory (remove all cljs-runtime, etc) after releasing an app?


you mean like rm -rf public/js? no it does not

Michaël Salihi07:09:40

Not really. I mean when releasing process run, is there already an option to remove production useless files/directories like cljs-runtime before deploying. This dir size is over 60Mb for my project.

Michaël Salihi07:09:08

In public/js/cljs-runtime


I just run rm and then shadow-cljs release app

Michaël Salihi07:09:58

I think I saw a few things going on about this a while ago.


rimraf from npm is also useful. shadow-cljs itself does not have anything to delete stuff


sure you can write a hook if you really must do that from within shadow-cljs but I don't see the point personally so there is nothing

Michaël Salihi07:09:40

Yeah write a hook would be overkill. 🙂 Thanks


is it possible to use d3-graphviz with shadow, and if so would that require any additional configuration for compiling wasm? i’m getting an error that localhost:8080/js/graphvizlib.wasm is not found, and further warnings that wasm streaming compile failed: TypeError: WebAssembly: Response has unsupported MIME type 'text/plain' expected 'application/wasm' and falling back to ArrayBuffer instantiation .


shadow-cljs does not support compiling or bundling wasm. something its enough to manually copy the wasm file to some location though


can't say for that lib. don't know what it looks like


i see, thanks!


shadow-cljs can't find the namespace I put all info together. any idea what may cause the problem? (message was long moved to thread)


[email protected]:~/dev/react-native/scforward$ npx shadow-cljs watch app
shadow-cljs - config: /home/r/dev/react-native/scforward/shadow-cljs.edn
shadow-cljs - server version: 2.15.10 running at 
shadow-cljs - nREPL server started on port 34207
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
The required namespace "" is not available.

####### Folder structure ####### 
├── react-native
│   ├── android
│   ├── ios
│   ├── app
│   ├── App.js
│   ├── app.json
│   ├── babel.config.js
│   ├── index.js
├── shadow-cljs.edn
├── src
│   ├── scforward
│   │   └── app.cljs
│   └── test
└── yarn.lock

####### shadow-cljs.edn ####### 
 [[reagent "0.8.0-alpha2"]]

["src/scforward" "src/test"]
  {:target :react-native
   :output-dir "react-native/app"
   :js-options {:js-package-dirs ["react-native/node_modules"]}}}}

###### src/scforward/app.cljs ####### 
    [shadow.react-native :refer (render-root)]
    ["react-native" :as rn]
    [reagent.core :as r]))

;; must use defonce and must refresh full app so metro can fill these in
;; at live-reload time `require` does not exist and will cause errors
;; must use path relative to :output-dir

(defonce splash-img (js/require "../assets/shadow-cljs.png"))

(def styles
  ^js (-> {:container
           {:flex 1
            :backgroundColor "#fff"
            :alignItems "center"
            :justifyContent "center"}
           {:fontWeight "bold"
            :fontSize 24
            :color "blue"}}

(defn root []
  [:> rn/View {:style (.-container styles)}
   [:> rn/Text {:style (.-title styles)} "Hello!"]
   [:> rn/Image {:source splash-img :style {:width 200 :height 200}}]])

(defn start
  {:dev/after-load true}
  (render-root "scforward" (r/as-element [root])))

(defn init []


your :source-paths needs to be adjusted


thank you it's solved


any tips to migrate away from :libs (aka Google closure style ns) to shadow-cljs?


just put it into your classpath and use it?


if you named everything correctly it just works without additional config