Fork me on GitHub

I have a lazy loading question: I noticed that together with lazy loading of code I should b lazy loading of css. I know shadow does not deal with css. But it would be great to listen to module load events. So as soon as a module starts loading, I would like to load the associated css. Is this possible?


@hoertlehner not with the built-in loader but you can easily wrap that to add your own css loading


thanks @thheller your fast answers are incredibly helpful for me in using shadow-cljs. I really dont know how you find the time to provide such great support! thanks!

Justin Chandler14:07:36

Hey everyone! I'm trying to get the Puppeteer library to work with ClojureScript/ShadowCLJS and I'm getting this error when requiring it: Closure compilation failed with 1 errors --- node_modules/puppeteer/lib/cjs/puppeteer/common/AriaQueryHandler.js:33 Cannot convert ECMASCRIPT_2018 feature "RegExp named groups" to targeted output language Is there a way to configure the goog compiler to swap out the targeted output language to a later ecmascript and use the feature anyway through the shadow.edn or something or is there more to this kind of compatibility problem?


@chandler.justin.s :compiler-options {:output-feature-set :es-next} in your build config


not sure why you are getting this error though? are you trying to compile for the browser? puppeteer only works for node?

Justin Chandler16:07:58

@thheller Ahhh you're right, I did forget to change my target to Node! Hahaha I would've spent all day on that. Thank you, I appreciate it!


when compiling a project that has uses a :bootstrap build I’m getting a lot of Uncaught ReferenceError: goog is not defined when the compiler is loaded in the application, I don’t get it during development and I’m not sure why… :thinking_face:


My two builds:

{:app      {:target            :browser
             :output-dir        "target/cljsbuild/public/js"
             :asset-path        "/js"
             :module-hash-names true
             :modules           {:app {:entries []}}
             :compiler-options  {:warnings {:infer false}}
             {:watch-dir "resources/public"
              :preloads  [re-frisk-remote.preload
             {:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}}
             {:resolve {"dom-helpers/class/addClass"    {:target  :npm
                                                         :require "dom-helpers/addClass"}
                        "dom-helpers/class/removeClass" {:target  :npm
                                                         :require "dom-helpers/removeClass"}}}}
  :bootstrap {:target :bootstrap
              :output-dir "target/cljsbuild/public/js/bootstrap"
              :asset-path "/js/bootstrap"
              ;; These are the namespaces we expose to the bootstrapped compiler
              :entries [cljs.js
              {:warnings {:infer false}}

              ;; many macro namespaces can't be evaluated in ClojureScript -
              ;; so we exclude them here to avoid runtime errors. Note that
              ;; it's ok to include code that consumes Clojure (jvm) macros,
              ;; but only selfhost-compatible macros can be evaluated "live".
              :exclude #{cljs.js}}


compiling with shadow-cljs release app bootstrap


you must compile with :optimizations :simple in your app build :compiler-options


the default :advanced does not work with self-hosted