This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-24
Channels
- # announcements (30)
- # asami (9)
- # babashka (37)
- # beginners (120)
- # calva (26)
- # cider (3)
- # clara (9)
- # clj-commons (7)
- # clj-kondo (17)
- # cljsrn (2)
- # clojure (32)
- # clojure-europe (56)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (4)
- # clojurescript (34)
- # conjure (1)
- # copenhagen-clojurians (8)
- # core-async (21)
- # cursive (2)
- # datahike (2)
- # datascript (5)
- # events (4)
- # fulcro (32)
- # graalvm (10)
- # heroku (3)
- # introduce-yourself (1)
- # jobs (2)
- # lsp (3)
- # luminus (1)
- # malli (8)
- # meander (15)
- # minecraft (1)
- # nrepl (2)
- # off-topic (57)
- # pathom (2)
- # polylith (35)
- # reagent (6)
- # reitit (8)
- # releases (1)
- # rewrite-clj (7)
- # shadow-cljs (21)
- # timbre (4)
- # tools-build (1)
- # tools-deps (33)
- # vrac (8)
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?
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.
In public/js/cljs-runtime
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
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
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)
r@pop-os:~/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 #######
{:dependencies
[[reagent "0.8.0-alpha2"]]
:source-paths
["src/scforward" "src/test"]
:builds
{:app
{:target :react-native
:init-fn
:output-dir "react-native/app"
:js-options {:js-package-dirs ["react-native/node_modules"]}}}}
###### src/scforward/app.cljs #######
(ns
(:require
[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"}
:title
{:fontWeight "bold"
:fontSize 24
:color "blue"}}
(clj->js)
(rn/StyleSheet.create)))
(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 []
(start))
any tips to migrate away from :libs
(aka Google closure style ns) to shadow-cljs?