This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-09
Channels
- # aws (3)
- # beginners (61)
- # boot (1)
- # cider (80)
- # clara (5)
- # cljs-dev (5)
- # cljsrn (19)
- # clojure (40)
- # clojure-dev (29)
- # clojure-dusseldorf (2)
- # clojure-greece (21)
- # clojure-italy (16)
- # clojure-russia (7)
- # clojure-spec (31)
- # clojure-uk (70)
- # clojurescript (31)
- # cursive (21)
- # data-science (5)
- # emacs (7)
- # fulcro (23)
- # graphql (4)
- # java (18)
- # jobs (1)
- # jobs-discuss (25)
- # juxt (14)
- # nrepl (2)
- # off-topic (18)
- # om-next (2)
- # onyx (3)
- # re-frame (16)
- # reagent (50)
- # ring-swagger (5)
- # shadow-cljs (70)
- # specter (5)
- # sql (24)
- # tools-deps (16)
- # vim (41)
Hi all, I’m just getting started with fulcro and exploring the shadow-cljs version of the app template a bit. I can connect and drop into the cljs repl. The prompt indicates I’m in the cljs.user namespace. But, if I were to create a matching “cljs/user.cljs” file, none of the code in the file seems to be loaded. Any idea what I might be doing wrong?
@odie oh I forgot about that. it currently doesn't check the filesystem and always generates one. please open a ticket so I don't forget it again
Oh! Good thing I asked! I’ve been messing around with this for too long, thinking I must be missing something obvious. 😃 Will open a ticket!
@odie fixed in 2.3.21
. as a bonus :devtools {:repl-init-ns my.app}
is now also supported
I'm trying to run shadow-cljs with lein. Without lein, I have no problems. With lein:
$ shadow-cljs watch app
shadow-cljs <project-home>
shadow-cljs - config: <project-home>/shadow-cljs.edn version: 2.3.19
shadow-cljs - running: lein run -m shadow.cljs.devtools.cli --npm watch app
Exception in thread "main" java.lang.RuntimeException: Unable to find static field: ECMASCRIPT6 in class com.google.javascript.jscomp.CompilerOptions$LanguageMode, compiling:(shadow/cljs/closure.clj:712:13)
at clojure.lang.Compiler.analyze(Compiler.java:6792)
@kurt-o-sys with lein
you need to put clojurescript into your deps
check lein deps :tree
which clojurescript version you are using (and which closure-compiler version)
[org.clojure/clojurescript "1.10.238" :scope "provided"]
is in the dependencies
in lein...
and which com.google.javascript/closure-compiler-unshaded
version in particular as that is causing the problem
$ lein deps :tree | grep clojure-compiler-unshaded
lein ... Possibly confusing dependencies found:
[thheller/shadow-cljs "1.0.20170629"] -> [org.clojure/tools.reader "1.0.0"]
overrides
[re-frame "0.10.5"] -> [org.clojure/clojurescript "1.9.908"] -> [org.clojure/tools.reader "1.0.5"]
and
[com.taoensso/tempura "1.2.0"] -> [com.taoensso/encore "2.94.0"] -> [org.clojure/tools.reader "1.2.1"]
and
[org.clojure/clojurescript "1.10.238"] -> [org.clojure/tools.reader "1.3.0-alpha3"]
Consider using these exclusions:
[re-frame "0.10.5" :exclusions [org.clojure/tools.reader]]
[com.taoensso/tempura "1.2.0" :exclusions [org.clojure/tools.reader]]
[org.clojure/clojurescript "1.10.238" :exclusions [org.clojure/tools.reader]]
[thheller/shadow-cljs "1.0.20170629"] -> [ring/ring-core "1.6.1" :exclusions [clj-time]]
overrides
[ring "1.6.3"] -> [ring/ring-jetty-adapter "1.6.3"] -> [ring/ring-servlet "1.6.3"] -> [ring/ring-core "1.6.3"]
and
[ring "1.6.3"] -> [ring/ring-servlet "1.6.3"] -> [ring/ring-core "1.6.3"]
and
[ring "1.6.3"] -> [ring/ring-jetty-adapter "1.6.3"] -> [ring/ring-core "1.6.3"]
and
[ring "1.6.3"] -> [ring/ring-devel "1.6.3"] -> [ring/ring-core "1.6.3"]
and
[ring "1.6.3"] -> [ring/ring-core "1.6.3"]
Consider using these exclusions:
[ring "1.6.3" :exclusions [ring/ring-core]]
[com.rpl/specter "1.1.0"] -> [riddley "0.1.12"]
overrides
[thheller/shadow-cljs "1.0.20170629"] -> [aleph "0.4.3"] -> [manifold "0.1.6"] -> [riddley "0.1.14"]
Consider using these exclusions:
[thheller/shadow-cljs "1.0.20170629" :exclusions [riddley]]
[thheller/shadow-cljs "1.0.20170629"] -> [ring/ring-core "1.6.1" :exclusions [clj-time]] -> [commons-fileupload "1.3.2"]
overrides
[ring "1.6.3"] -> [ring/ring-jetty-adapter "1.6.3"] -> [ring/ring-servlet "1.6.3"] -> [ring/ring-core "1.6.3"] -> [commons-fileupload "1.3.3"]
and
[ring "1.6.3"] -> [ring/ring-servlet "1.6.3"] -> [ring/ring-core "1.6.3"] -> [commons-fileupload "1.3.3"]
and
[ring "1.6.3"] -> [ring/ring-jetty-adapter "1.6.3"] -> [ring/ring-core "1.6.3"] -> [commons-fileupload "1.3.3"]
and
[ring "1.6.3"] -> [ring/ring-devel "1.6.3"] -> [ring/ring-core "1.6.3"] -> [commons-fileupload "1.3.3"]
and
[ring "1.6.3"] -> [ring/ring-core "1.6.3"] -> [commons-fileupload "1.3.3"]
Consider using these exclusions:
[ring "1.6.3" :exclusions [commons-fileupload]]
[compojure "1.6.0" :exclusions [instaparse]] -> [ring/ring-codec "1.0.1"] -> [commons-codec "1.6"]
overrides
[org.clojure/clojurescript "1.10.238"] -> [com.cognitect/transit-clj "0.8.300" :exclusions [org.clojure/clojure]] -> [com.cognitect/transit-java "0.8.324"] -> [commons-codec "1.10"]
and
[thheller/shadow-cljs "1.0.20170629"] -> [com.cognitect/transit-clj "0.8.300" :exclusions [org.msgpack/msgpack]] -> [com.cognitect/transit-java "0.8.324"] -> [commons-codec "1.10"]
Consider using these exclusions:
[org.clojure/clojurescript "1.10.238" :exclusions [commons-codec]]
[thheller/shadow-cljs "1.0.20170629" :exclusions [commons-codec]]
right, ok.
ok, my bad... took some template from somewhere.
well, maybe I didn't check the docs enough, I have in my project.clj
things like yagni, kibit, yagni etc. I'm not sure how to do it in shadow-cljs
:
:aliases {"eastwood" ["with-profile" "lint" "eastwood"]
"kibit" ["do"
["with-profile" "lint" "shell" "echo" "== Kibit =="]
["with-profile" "lint" "kibit"]]
"yagni" ["do"
["with-profile" "lint" "shell" "echo" "== Yagni =="]
["with-profile" "lint" "yagni"]]
"bikeshed" ["do"
["with-profile" "lint" "shell" "echo" "== Bikeshed =="]
["with-profile" "lint" "bikeshed" "--max-line-length=140"]]
"cljfmt-check" ["do"
["with-profile" "lint" "shell" "echo" "== cljfmt check cljs =="]
["with-profile" "lint" "cljfmt" "check" "src/cljs"]]
"cljfmt-fix" ["do"
["with-profile" "lint" "shell" "echo" "== cljfmt fix cljs =="]
["with-profile" "lint" "cljfmt" "fix" "src/cljs"]]
"check-deps" ["with-profile" "lint" "ancient" "all"]
"lint" ["do" ["eastwood"] ["kibit"] ["yagni"] ["bikeshed"] ["cljfmt-check"]]}
(I just started using shadow-cljs, due to issues with npm, well...)
shadow-cljs is a breeze, btw... will present it in a workshop on http://jsconf.be
Question on the new proxy-url setting
If I’m running the cljs app on port 8020, will the proxy setting allow me to forward to a different port? I’m trying that, and it’s not working.
Just the shadow server, I mean.
But that app needs an XHR call forwarded to port 9000
The http-port is already set to the default, I haven’t changed it.
Correction.
It’s set to 8020, yes, lol.
I’ll keep experimenting.
Got it!
It was http vs https
if whatever server is running on port 9000 is capable of serving files you could just use that
@thheller hmmm if I crib some ideas from you would you want me to mention your name and give you credit?
@bhauman don't worry about it. I don't think there is a single new original new idea in anything I have done in shadow-cljs.
probably a good idea. I didn't check how long that takes after I put it in but probably should have.
I am playing with custom builds, simple, just a post build hook to copy some files as documented here https://shadow-cljs.github.io/docs/UsersGuide.html#_example.
(ns build.browser-post-process
(:require [shadow.build :as build]
[shadow.build.targets.browser :as browser]))
(defn core [{::build/keys [stage mode config] :as state}]
(let [state (browser/process state)]
(when (and (= :flush stage) (= :dev mode))
;; do task here
state)))
and config :target build.browser-post-process/core
in a build called b2
when running shadow-cljs watch b2
in "shadow-cljs": "^2.3.20"
I get
...
...
shadow-cljs - watching build :b2
[:b2] Configuring build.
[2018-05-09 16:32:38 - WARNING] failed to handle server msg: {:type :start-autobuild}
java.lang.AssertionError: Assert failed: (build-api/build-state? %)
at shadow.build$configure.invokeStatic(build.clj:175)
at shadow.build$configure.invoke(build.clj:175)
...
...
am i missing something? cheers!@fj.abanses the build.browser-post-process/core
must always return the state it receives
@thheller ouch!! 😞 sorry the code in the user guide has some typos and i misinterpreted it.
(ns build
(:require [shadow.build :as build]
[shadow.build.targets.browser :as browser]))
(defn custom [{::build/keys [stage mode config] :as state}]
(let [state (browser/process state]
(when (and (= :flush stage) (= :dev mode))
(call-rsync)
state))
(browser/process state
and also the closing paren for the (when
I can fix the docs and send a pull request if it helps you.@fj.abanses thx. fixed it.