This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-19
Channels
- # announcements (10)
- # babashka (40)
- # beginners (21)
- # biff (3)
- # clj-kondo (84)
- # clj-together (1)
- # clj-yaml (21)
- # clojure (53)
- # clojure-dev (10)
- # clojure-europe (26)
- # clojure-nl (3)
- # clojure-norway (29)
- # clojure-uk (6)
- # clojurescript (11)
- # community-development (2)
- # data-science (6)
- # datomic (15)
- # deps-new (4)
- # emacs (10)
- # gratitude (1)
- # helix (3)
- # hoplon (4)
- # hyperfiddle (35)
- # jobs-discuss (44)
- # lsp (31)
- # meander (14)
- # membrane (24)
- # pathom (2)
- # practicalli (1)
- # rdf (3)
- # re-frame (18)
- # releases (1)
- # shadow-cljs (28)
- # xtdb (4)
I've played around with Remix a bit, based on the shadow-next idea with using build hooks: https://github.com/martinklepsch/remix-cljs — I'm now running into Namespace "goog.debug.Error" already declared.
— Obviously lots of moving parts with Remix but would be curious if anything has changed about how this could be approached with shadow?
thats usually a sign that something is trying to load the cljs output twice? so my guess would be that remix is trying to reload all code before the request?
main.js?version=0.1.3061:1426 TypeError: base is not a constructor
at $.widget (widget.js:105:18)
at eval (sortable.js:41:10)
at eval (sortable.js:36:3)
at shadow$provide.module$node_modules$jquery_ui$ui$widgets$sortable (sortable.js:18:1)
at shadow.js.jsRequire (js.js:66:18)
at shadow.js.require (js.js:113:20)
:component-did-mount
(fn []
(.sortable (jquery
(str "#" container-id))
#js {:revert true
:start (fn [_event ui]
(set! (.-startPosition (.-item ui)) (.index (.-item ui))))
:update (fn [event ui]
(rf/dispatch [::events/reorder-media
{:media-type media-type
:from (int (.-startPosition (.-item ui)))
:to (int (.index (.-item ui)))}])
(.preventDefault event))})
(.disableSelection (jquery (str "#" container-id)))
Hey guys. My bundle size suddenly jumped from 2 MB to 9 MB. I run npx shadow-cljs run shadow.cljs.build-report app public/report.html
to see what's going on and it reports Module: :main [JS: 1.85 MB] [GZIP: 461.65 KB]. That's what I would expect, but not the reality.
• I only have 1 bundle.
• I build by npx shadow-cljs compile app
.
• I haven't touched compiler-options
.
• The only recent change I did to shadow-cljs.edn
was to change :deps true
to :deps {:aliases [:cljs]}
in order to be able to prevent ShadowCLJS from taking so much MEM via :aliases {:cljs {:jvm-opts ["-Xmx256M"]}}
in deps.edn
. That hardly feels related.
What's going on? How can I debug this? Esp. if the report is telling me one thing and the reality is different.
deps.edn
{:paths ["src"]
:aliases {:cljs {:jvm-opts ["-Xmx512M"]}}
:deps {org.clojure/test.check {:mvn/version "1.1.1"}
org.clojure/spec.alpha {:mvn/version "0.3.218"}
thheller/shadow-cljs {:mvn/version "2.22.2"}
reagent/reagent {:mvn/version "1.2.0"}
metosin/reitit {:mvn/version "0.6.0"}
io.github.arttuka/reagent-material-ui {:git/sha "4fc4b44891919d2b84160eb411d52227dd89e0a5"}
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
; Dev dependencies.
binaryage/devtools {:mvn/version "1.0.6"}}}
shadow-cljs.edn
{:deps {:aliases [:cljs]}
:builds
{:app {:asset-path "/js"
:modules {:main {:init-fn bm-web.core/main}}
;
:js-options {:anon-fn-naming-policy :unmapped}
:output-dir "public/js"
:target :browser}}
:dev-http {3000 "public"}}
The thing that surprises me the sudden jump from 2 to 9 MB. That's just huge. I included MUI X DatePicker and Day js, MUI is huge, but not this huge.
Ah! Thanks @U05224H0W
Yeah MUI really leaves me speechless at times. Both how huge it is and the complexity of that thing. Anyway, I'll stop ranting.
I must have switch to compile
recently by mistake and then as I do C-r
to fetch it from history, that's where I kept propagating that mistake. Blimey.
if you pull in @mui/icons-material
then you are bundling 11,000 SVG icons (~2,000 icons with 4-5 variants each), which add up to around 5-6 MB last time I checked
Hey people! I'd like to ask if it's possible to use pnpm instead of npm with shadow-cljs? Whenever I try to do that, a bunch of react deps don't get installed, and these are not user-facing dependencies either. But doing the same with npm works fine. Any ideas what might be the issue?
pnpm doesn't install peer-dependencies by default, the issue may not be clojure specify, but pnpm specific, I don't remember which flags are needed to enable peer-dependencies it was something like https://pnpm.io/npmrc#shamefully-hoist. hope this helps you.
Discussion on peer deps on pnpm github https://github.com/orgs/pnpm/discussions/3995
That worked, although it seems like you should set your .npmrc
variable before you start installing anything.
Thanks!