This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-12
Channels
- # announcements (19)
- # babashka (33)
- # beginners (96)
- # bitcoin (6)
- # cider (11)
- # circleci (5)
- # clj-kondo (22)
- # cljs-dev (4)
- # cljsjs (2)
- # clojure (65)
- # clojure-australia (9)
- # clojure-berlin (1)
- # clojure-europe (53)
- # clojure-italy (2)
- # clojure-nl (2)
- # clojure-uk (42)
- # clojurescript (9)
- # conjure (1)
- # cursive (33)
- # data-oriented-programming (1)
- # data-science (6)
- # datomic (12)
- # emacs (12)
- # fulcro (7)
- # graphql (4)
- # honeysql (5)
- # jobs (2)
- # juxt (8)
- # lsp (30)
- # malli (9)
- # off-topic (9)
- # other-languages (1)
- # re-frame (17)
- # reagent (11)
- # reitit (5)
- # releases (2)
- # remote-jobs (3)
- # shadow-cljs (39)
- # spacemacs (6)
- # sql (2)
- # testing (3)
- # tools-deps (43)
- # vim (5)
- # xtdb (11)
Is there a good way to develop shadow-cljs locally and use in other projects? Like lein install
, except if you want to use it the recommended way (npm)?
the recommended way still just uses the installed version in .m2
so that has nothing to do with it
what do you intend to do? another way is just putting the shadow-cljs src/main
into the source paths of your project
Sounds good if lein install works. Just checking if I can solve one of the problems with inspect that I noticed earlier (where taps don't work if you do them too quickly on a page load)
if you intend on working on it while working on a project I'd definitely recommend just adding the source path to the project
I do this frequently. all projects in ~/code
so just :source-paths ["src/main" "../shadow-cljs/src/main"]
. while keeping the normal shadow-cljs dependency to get all other transitive dependencies and stuff
I'm playing with monorepo multiproject multibuild settings and I'm getting a fresh error. I'm not sure where I went wrong
with deps.edn
alias:
:dev-cljs
{:extra-deps {thheller/shadow-cljs {:mvn/version "2.11.22"}
...
:main-opts ["-m" "shadow.cljs.devtools.cli" "watch" "ui"]}
and shadow-cljs.edn
build:
{:ui {:target :browser
:output-dir "projects/ui/public/js"
:asset-path "projects/ui/js"
:module-hash-names false
:modules {:ui {:init-fn ui.main/init!
:preloads [devtools.preload
day8.re-frame-10x.preload]}}
:dev {:compiler-options {:infer-externs :auto
:closure-defines
{re-frame.trace.trace-enabled? true
day8.re-frame.tracing.trace-enabled? true}}}
:devtools {:repl-pprint true
:preloads [shadow.remote.runtime.cljs.browser]
:http-root "projects/ui/public"
:http-port 8280}}}
When i load the app in the browser, I get "is the watch for this app running?". I only changed paths to move the location of shadow-cljs.edn
up a couple of directories. Any help appreciated.@jasonhlogic first of all your :asset-path
looks incorrect. likely that should just be /js
?
the error you get is when the files you are loading were not produced by the running shadow-cljs instance
so likely if you changed some paths or so you have some older files still somewhere that are not used instead of the new output
I changed the :assset-path
to "/js", but I still get the same error. My command is:
clojure -M:defaults:ui:dev-cljs
where defaults
is a set of override-deps
to version-lock libraries shared across projects and ui
is:
{:extra-deps {ui/ui {:local/root "projects/ui"}}}
which adds the project-level deps.edn
you are opening http://localhost:8280 I presume?
simple test. shutdown shadow-cljs and open the http://localhost:8280
then I'm out of ideas. there really isn't much that goes into this. shadow-cljs places the files in the :output-dir
and the :http-root
serves them
it is easy to miss one place and is still using an old file from some other directory
you can also remove :preloads [shadow.remote.runtime.cljs.browser]
. that has been the default for a while now.