This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-24
Channels
- # announcements (13)
- # asami (9)
- # aws (3)
- # babashka (13)
- # babashka-sci-dev (7)
- # beginners (32)
- # calva (59)
- # cider (9)
- # clj-kondo (5)
- # cljsrn (14)
- # clojure (98)
- # clojure-brasil (5)
- # clojure-dev (1)
- # clojure-europe (30)
- # clojure-france (12)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (7)
- # clojurescript (20)
- # conjure (2)
- # datahike (7)
- # datalog (38)
- # datomic (29)
- # events (1)
- # fulcro (72)
- # graalvm (1)
- # gratitude (3)
- # helix (7)
- # honeysql (3)
- # improve-getting-started (2)
- # introduce-yourself (1)
- # leiningen (13)
- # lsp (17)
- # malli (11)
- # meander (8)
- # nextjournal (3)
- # off-topic (5)
- # pathom (2)
- # portal (43)
- # rdf (2)
- # re-frame (8)
- # reagent (7)
- # reitit (1)
- # shadow-cljs (27)
- # spacemacs (31)
- # sql (2)
- # tools-deps (3)
- # vim (1)
- # xtdb (12)
Funny that should be the topic right now. I'm here to ask if there's a recommendation for how to break up that vendor bundle because the page is taking 5s to load!
In my case there's a dependency needed for generating PDFs which isn't needed immediately. That adds something like 2.5mb to the js. (https://react-pdf.org/)
@olivergeorge the setup described here https://code.thheller.com/blog/shadow-cljs/2019/03/03/code-splitting-clojurescript.html
one example I have from the shadow-cljs UI is https://github.com/thheller/shadow-cljs/blob/051b5ecc7d701ef45b3bbc839685ac6ea03d4ad7/shadow-cljs.edn#L87-L96
there I have codemirror which is also a pretty large dependency. I delay loading it until it is actually used.
Thank you
Seems like :js-provider :external might complicate this
But that's speculation. I’ll give it a go.
the way webpack handles code splitting is entirely different than the closure compiler. so the two don't really get along.
in theory it should be possible to combine the two somehow. just haven't figured out how that would need to look on the webpack side or how you'd even configure that
if some webpack export wants to help out I'd be happy to write the cljs side of things 😛
Thanks. Yep. All a bit messy.
I would happily ditch webpack but the pesky WASM dependency gets in the way.
in that case it can be easily integrated but it all depends on how that wasm glue code came about
I did some stuff a while ago, maybe that is still accurate in some way https://github.com/thheller/wasm-pack-cljs
Thanks again. I'm really not across the wasm details. This react-pdf dep is wrapping pdfkit which is probably quite professional I guess.
I also created this a while ago https://github.com/thheller/reagent-pdfjs
with https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve you can make just about anything happen
I’ll look into that - thanks again
@thheller UX suggestion: the "dependency trace" tooltip in the build report tends to go off-screen (and thus become unreadable) when there are lots of modules. It'd be better to use an expand/collapse toggle like what you already have for the "groups".
I’m trying to set up a web worker, but I keep getting the error worker.js:67 Uncaught Error: Namespace "goog.dispose" already declared.
. Does anyone know why this is?
shadow-cljs config:
:worker {:init-fn my.app.worker/load!
:depends-on #{:shared}
:web-worker true}}
my.app.worker:
(ns my.app.worker)
(js/console.log "worker/read!")
(defn load! []
(js/console.log "worker/load!"))
http://my.app:
(defn init []
(let [worker (js/Worker. "/js/worker.js")]
(.addEventListener worker "message" notify-worker-message)))