This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-21
Channels
- # announcements (39)
- # architecture (7)
- # aws (9)
- # babashka (111)
- # beginners (139)
- # bristol-clojurians (1)
- # calva (47)
- # chlorine-clover (5)
- # cider (17)
- # clj-kondo (26)
- # clojars (25)
- # clojure (251)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (22)
- # clojure-france (1)
- # clojure-hungary (6)
- # clojure-losangeles (8)
- # clojure-nl (18)
- # clojure-spec (3)
- # clojure-uk (68)
- # clojured (32)
- # clojurescript (32)
- # core-async (10)
- # core-typed (120)
- # cursive (8)
- # datascript (10)
- # datomic (11)
- # docker (2)
- # emacs (6)
- # figwheel-main (4)
- # fulcro (10)
- # graalvm (92)
- # hoplon (2)
- # instaparse (9)
- # jobs (3)
- # jobs-discuss (31)
- # joker (2)
- # kaocha (1)
- # lambdaisland (5)
- # leiningen (10)
- # luminus (1)
- # lumo (14)
- # meander (30)
- # mid-cities-meetup (1)
- # midje (1)
- # off-topic (46)
- # pathom (22)
- # perun (2)
- # re-frame (10)
- # reitit (1)
- # remote-jobs (8)
- # shadow-cljs (71)
- # spacemacs (7)
- # sql (40)
- # tools-deps (31)
- # tree-sitter (11)
- # vim (14)
- # vscode (2)
- # xtdb (5)
@thheller Congrats on a great performance by shadow in the state of Clojure survey, more REPL users than figwheel main now!
To be honest, that was my reaction as well when I first heard an advice about trying shadow-cljs out. "Wha... what? Why? Another build tool? No, I'm exhausted by their proliferation, thank you."
I'm trying to get a new Fulcro3 project started using lein instead of deps.edn as the Fulcro tutorial suggests. When trying to run npx shadow-cljs start
, I get this in my error log:
Exception in thread "main" Syntax error compiling . at (shadow/build/closure.clj:69:5).
Followed by a massive stacktrace that - at least to me - doesn't contain anything useful in determining what the error is. How might I go about figuring out what the issue is? I'm not terribly familiar with build tools and it might very well be a simple error in my config files, but I don't know how to determine that.Hmm, I could pair those down to bare essentials. I copied them over from a previous project, but went to latest shadow-cljs.
(defproject prj "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"
:profiles {:uberjar {:aot :all}
:dev {:source-paths ["src/prj/"]
:dependencies [[org.clojure/clojurescript "1.10.520"]
[thheller/shadow-cljs "2.8.83"]
[binaryage/devtools "0.9.10"]]}})
; [cider/piggieback "0.4.1"]]}})
; [fulcrologic/fulcro-spec "3.1.4"]
; [com.fulcrologic/guardrails "0.0.9"]]}})
try
[org.clojure/clojurescript "1.10.597"
:exclusions [com.google.javascript/closure-compiler-unshaded
org.clojure/google-closure-library
org.clojure/google-closure-library-third-party]]
Hmm, yeah, that worked. That's definitely not something I would have figured out lol
Hi all ! I'm new to shadowjs and trying to include [cljs-web3 "0.19.0-0-11"] to a re-frame project using shadow-cljs but I keep having this error while building:
The required JS dependency "web3" is not available, it was required by "cljsjs/web3.cljs".
Search in:
/Users/jfleury/Documents/Git/multis-interview/node_modules
You probably need to run:
npm install web3
I'm stuck on this, as when I run "npm install web3", it works, but package.json keeps being rewritten by the command lein-shadow - running shadow-cljs...
somehow... I don't understand how to add a js package to project.clj
... Can anyone help me on that ?as for the web3 stuff you just install that that and require it directly (no cljsjs). (:require ["web3" :as web3])
or whatever the actual package name is
Thanks, but the problem seems to be that I can't really install a npm package without adding something somewhere in project.clj or somewhere else, as the whole package.json is reset each time I launch my code... My project.clj is set like that:
(defproject xxx "lein-git-inject/version"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.597"
:exclusions [com.google.javascript/closure-compiler-unshaded
org.clojure/google-closure-library
org.clojure/google-closure-library-third-party]]
[thheller/shadow-cljs "2.8.83"]
[reagent "0.9.1"]
[binaryage/devtools "0.9.10"]
[clj-commons/secretary "1.2.4"]
[re-frame "0.11.0"]
[day8.re-frame/tracing "0.5.3"]
[day8.re-frame/test "0.1.5"]
[day8.re-frame/re-frame-10x "0.5.2"]
[cljs-web3 "0.19.0-0-11"]
[district0x.re-frame/web3-fx "1.0.5"]]
:plugins [[day8/lein-git-inject "0.0.11"]
[lein-shadow "0.1.7"]
[lein-shell "0.5.0"]]
:middleware [leiningen.git-inject/middleware]
:clean-targets ^{:protect false} [:target-path
"shadow-cljs.edn"
;"package.json"
;"package-lock.json"
"resources/public/js"]
:shadow-cljs {:nrepl {:port 8777}
:builds {:client {:target :browser
:output-dir "resources/public/js"
:modules {:client {:init-fn xxx.core/main
:preloads [day8.re-frame-10x.preload]}}
:compiler-options {:closure-defines {re-frame.trace.trace-enabled? true
day8.re-frame-10x.debug? true
day8.re-frame.tracing.trace-enabled? true}}
:devtools {:http-root "resources/public"
:http-port 8280}}
:karma-test {:target :karma
:ns-regexp "-test$"
:output-to "target/karma-test.js"
:compiler-options {:pretty-print true
:closure-defines {re-frame.trace.trace-enabled? true}}}}}
:aliases {"dev-auto" ["shadow" "watch" "client"]
"test-once" ["do"
["clean"]
["shadow" "compile" "karma-test"]
["shell" "karma" "start" "--single-run" "--reporters" "junit,dots"]]
"test-auto" ["do"
["clean"]
["shadow" "watch" "karma-test"]]
"karma-watch" ["shell" "karma" "start" "--reporters" "junit,dots"]})
no clue. I recommend using shadow-cljs.edn
and package.json
for CLJS and not using lein-shadow
then you don't have those worries. I have never used lein-shadow and I'm not involved with it so can't help
and you can then remove the :shadow-cljs
stuff as well. basically what the plugin does is copy that to shadow-cljs.edn
Is there an easy way to configure shadow such that I can run a lein plugin before compile? Essentially, it would be cool if I could call This is dumb, doing this at a higher level :)lein cljfmt
on my code right before watch recompiles everything on saving a cljs file.
i'm configuring my shadow-cljs builds incorrectly somehow, but i can't tell how. in my shadow-cljs.edn, the builds section looks like this:
{:source-paths
["src/cljc/"
"src/cljs/"
"test/cljs/"]
:dependencies
[[reagent "0.9.0-rc1"]
[cider/cider-nrepl "0.22.0-beta8"]]
:nrepl
{:port 8202}
:builds {:dev {:target :browser
:modules {:main
{:entries [my-app.frontend]
:depends-on #{:cljs-base}}
:tracker
{:entries [my-app.tracker]
:depends-on #{:cljs-base}}
:cljs-base
{:entries []}}
:output-dir "resources/public/assets/js"
:asset-path "/assets/js"}
:test {:target :browser-test
:test-dir "test/resources/public"
:devtools {:http-port 8021
:http-root "test/resources/public"}}}}
it seems like the :test
build configuration is clobbering the :dev
build entirely; with my shadow-cljs.edn like that, if i do a dev build, i get a test build
i believe that emacs is running the equivalent of shadow-cljs watch dev
, which i guess runs a process that serves the files?
> if i do a dev build, i get a test build how do you know you get a test build instead of a dev build?
oh no, i'm mistaken. i believe shadow-cljs is just writing the compilation results to a place where my webserver can find them
various reasons; my test builds take much longer than my dev builds; emacs launches a UI when it runs shadowc-ljs, and it takes me to the test page when i run the test builds
emacs asks to launch a browser window when you start a shadow-cljs build, yes. does it perchance open your browser to localhost:8021?
if i omit the :test
build configuration entirely, emacs will take me to localhost:9630
I’m struggling to see evidence that the :dev
build is not running. when you open the page on your separate web server, do you not see your application running and changes not hot loading?
last night i was seeing test builds. i restarted every thing and now things are fine... sorry for the goose chase, this seems to be user-error on my part 😕
if it opened to localhost:8021, it’s going to show your last test build even if the watch isn’t running