Fork me on GitHub

Can anyone tell me why I'm getting the error at the top?

[2020-02-23 08:51:46.509 - WARNING] provide conflict for #{sheluchin.client} provided by app/sheluchin/client.cljs and {"/sheluchin/client.cljs" #{sheluchin.client}}

{:lein {:profile "+dev"}
 :nrepl     {:port 9000}

 :dev-http  {8000 "resources/public"}

 ; Ignored since :lein is set
 ; :source-paths ["src/app"]

 :builds    {:main      {:target        :browser
                         :output-dir    "resources/public/js/main"
                         :asset-path    "/js/main"
                         :dependencies  [[cider/piggieback "0.4.1"]
                                         [fipp "0.6.21"]]
                         :repl-options  {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}

                         :modules       {:main  {:init-fn sheluchin.client/init}}
                         :devtools      {:after-load sheluchin.client/init
                                         :preloads    [com.fulcrologic.fulcro.inspect.preload]
                                         :repl-pprint true}
                         :compiler-options {:external-config {:guardrails {}}
                                            :closure-defines {'goog.DEBUG true}}}}}

(defproject app "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url ""
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url ""}
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [com.fulcrologic/fulcro "3.0.1"]]
  :main ^:skip-aot sheluchin.client
  :target-path "target/%s"
  :source-paths ["src/app"]
  :profiles {:uberjar {:aot :all}
             :dev {:source-paths ["src/app"]
                   :dependencies [[org.clojure/clojurescript "1.10.597"
                                    :exclusions []
                                  [thheller/shadow-cljs       "2.8.83"]
                                  [binaryage/devtools         "0.9.10"]]}})


Invalid Filename, got app/sheluchin/client.cljs but expected sheluchin/client.cljs (or .cljc)

   1 | (ns sheluchin.client

   2 |   (:require

   3 |     [com.fulcrologic.fulcro.application :as app]

   4 |     [com.fulcrologic.fulcro.components :as comp :refer [defsc]]

   5 |     [com.fulcrologic.fulcro.dom :as dom :refer [div h1 h2 h3 button ul li]]


I have :source-paths ["src/app"] set, so ns sheluchin.client should correspond to src/app/sheluchin/client.cljs, no?


it should. did you restart lein/shadow-cljs after changing the paths?


(if you changed the paths while it is runing they won't apply)


Hmm, thought I did that last time too, but doing it again for good measure seems to have fixed it.


is tree shaking for node_modules not turned on by default? I'm running a build report and seeing that all of react-native-web (300kb 😬) is being included even though I'm only using a portion of it. reading docs it says advanced optimizations are only done if :js-provider is set to closure . which I imagine is the issue here. but if some of my other packages aren't compatible with closure compiler, is there way way to exclude them from advanced optimization, or to specifically include the packages I want optimized?


also looks like all of clojurescript itself is being included (i.e. pprint and spec are bundled).. though not sure if that's bc other cljs deps are depending on it


In general external JS can't be tree shaken / DCE'd


ah so any JS package you include will include all its exports? i imagine we can’t post process cljs output with babel either :thinking_face: any workarounds for this?


Often in large libs you can include just the files you need

🆗 4

not all CLJS code is compatible with DCE either. thats why you see pprint and spec


as for JS your requires should be as exact as possible (if possible at all)


anyone successfully using shadow-cljs with emacs clojure-lsp with project generated npx create-cljs-project ? go to definition for the libs does not seem to work (:require [reagent.core :as r]) i.e. can’t jump to reagent code


How recent is your clojure-lsp? I think the patch to understand shadow-cljs project landed a few days ago. Also the parser hasn’t been updated for strings in the ns require form yet


might be too old in homebrew, will try to install manually, thanks!


Did that help?


seems like homebrew formula is using this one: so it is kind of the latest according to the github, though reinstalling it made it crash every time now


Pulled the repo and done lein bin to get the recent bin, since the one that is provided is not up to date, works now, thanks!