This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-22
Channels
- # announcements (2)
- # aws (5)
- # babashka (17)
- # beginners (108)
- # calva (28)
- # chlorine-clover (7)
- # clj-kondo (14)
- # cljs-dev (9)
- # cljsrn (2)
- # clojure (118)
- # clojure-europe (50)
- # clojure-finland (5)
- # clojure-france (15)
- # clojure-italy (9)
- # clojure-nl (14)
- # clojure-spec (11)
- # clojure-uk (43)
- # clojuredesign-podcast (1)
- # clojurescript (35)
- # clojutre (2)
- # clr (3)
- # community-development (6)
- # conjure (9)
- # core-async (41)
- # cursive (7)
- # data-science (7)
- # datomic (11)
- # events (1)
- # figwheel-main (4)
- # fulcro (20)
- # ghostwheel (9)
- # graalvm (18)
- # helix (46)
- # leiningen (14)
- # observability (2)
- # off-topic (23)
- # pathom (4)
- # re-frame (5)
- # reitit (5)
- # rum (2)
- # shadow-cljs (32)
- # spacemacs (8)
- # specter (5)
- # sql (36)
- # timbre (3)
- # vim (15)
- # xtdb (2)
- # yada (2)
Tried converting a big reagent app to use the bundle target and webpack, it seems to work fine locally but production build takes a very long time (from 90 seconds to 16minutes) and some cljsjs deps didn’t work in the advanced compiled output… I should probably just upgrade all the cljsjs deps to their npm versions and not mix npm/cljsjs
seems that webpack is the slow part, seeing a node process which is using a single core for most of the duration
I'm following the [Krell reagent tutorial](https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial), but running clj -m krell.main -co build.edn -c -r
I'm getting compiler/analyzer exceptions because it can't find react-dom
should I install react-dom just to satisfy that dependency (even though I imagine it won't be used), or is there a way to not have it compile reagent.dom
?
yay! @dnolen I did have to add a :paths ["src"]
to deps.edn
, I think that should be updated in the tutorial?
maybe it's a red herring... it wasn't finding awesome_project/core.cljs
, when I added it it did
~/d/testdeps ❯❯❯ echo "{}" > deps.edn
~/d/testdeps ❯❯❯ clojure -Spath
src:/Users/mk/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar:/Users/mk/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar:/Users/mk/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
yeah :paths
should be set for you, and I haven't heard about that one before from others
Yes for me too, src
is default included in path without to specify in deps.edn
...strange for you @plexus
since always
Is it possible to get webpack tree shaking for a project I'm importing into a cljs project?
Specifically, I maintain a react component lib at work, and I'd like to import some of those components into a cljs project.
@brandon149 what is your CLJS project using to build?
I'm using shadow-cljs
I'm not married to it, it's just what I'm most familiar with
wait, really?
In that case, I need to double check some stuff
so if you require your JS components in a cljs namespace like:
(ns my-app.feature
(:require ["component-lib/Foo" :as Foo]))
it should only include the Foo
file and any dependencies of itthis is assuming some things, like you’re deploying your component library as either CommonJS or ESM
ah, right now I require the whole lib and the final bundle is massive
you can see the example of how to fix this here: https://github.com/thheller/shadow-cljs/issues/412
I’m not sure how your component library is structured, but the idea is that you want to require just the files that you need and shadow-cljs will handle the rest
I never intended it to be consumed by non-js libs, so hopefully it works out 😅
Thanks-a-million