This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-19
Channels
- # announcements (5)
- # beginners (40)
- # cider (3)
- # clara (9)
- # cljs-dev (2)
- # cljsrn (4)
- # clojure (8)
- # clojure-spec (24)
- # clojure-uk (4)
- # clojurescript (3)
- # cursive (6)
- # data-science (3)
- # datomic (53)
- # emacs (3)
- # figwheel-main (11)
- # fulcro (37)
- # lein-figwheel (17)
- # off-topic (13)
- # parinfer (1)
- # re-frame (9)
- # reagent (2)
- # remote-jobs (7)
- # shadow-cljs (75)
- # tools-deps (4)
- # yada (16)
uhm, no....the side effects must be somewhere else...these defmethods
are confusing...I will confirm later if it really works 😄
I guess this is correct? :devtools {:preloads [testing.with-diff-reporter]}
the full entry is:
{:target :node-test
:output-to ".cljs/tests.js"
:ns-regexp ".*-test"
:autorun true
:devtools {:preloads [testing.with-diff-reporter]}
:release {:compiler-options {:optimizations :simple
:variable-renaming :off
:property-renaming :off
:pretty-print true
:source-map true}
:autorun false}}
I made sure and a normal require works...I am overriding the cljs.test
multimethods, are those required before :preloads
or after?
@richiardiandrea :dev {:preloads [...]}
currently. forgot that should be in :devtools
. will fix later
if you want to mess with cljs.test
options however I suggest copying https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/test/node.cljs and adjust whatever you need and your ns via :runner-ns
. its main
fn will be called when running the test script
Will try with preloads just to see what happens, the resort to that. Not to write a runner is convenient 😄
hello, I just did a big bump on shadow from 2.4.10 to 2.6.1 and now getting these:
RuntimeException java.io.EOFException
com.cognitect.transit.impl.ReaderFactory$ReaderImpl.read (ReaderFactory.java:114)
cognitect.transit/read (transit.clj:319)
cognitect.transit/read (transit.clj:315)
shadow.build.cache/read-cache (cache.clj:49)
shadow.build.cache/read-cache (cache.clj:33)
shadow.build.classpath/find-jar-resources/fn--10051 (classpath.clj:565)
shadow.build.classpath/find-jar-resources (classpath.clj:564)
shadow.build.classpath/find-jar-resources (classpath.clj:553)
shadow.build.classpath/find-resources (classpath.clj:623)
shadow.build.classpath/find-resources (classpath.clj:621)
shadow.build.classpath/index-path* (classpath.clj:843)
shadow.build.classpath/index-path* (classpath.clj:840)
Caused by:
EOFException
com.cognitect.transit.impl.JsonParser.parse (JsonParser.java:44)
com.cognitect.transit.impl.ReaderFactory$ReaderImpl.read (ReaderFactory.java:112)
cognitect.transit/read (transit.clj:319)
Exception in thread "main" java.lang.NoSuchMethodError: com.cognitect.transit.TransitFactory.writer(Lcom/cognitect/transit/TransitFactory$Format;Ljava/io/OutputStream;Ljava/util/Map;Lcom/cognitect/transit/WriteHandler;Ljava/util/function/Function;)Lcom/cognitect/transit/Writer;
at cognitect.transit$writer.invokeStatic(transit.clj:157)
at cognitect.transit$writer.invoke(transit.clj:139)
at shadow.build.cache$write_stream.invokeStatic(cache.clj:9)
at shadow.build.cache$write_stream.invoke(cache.clj:8)
any ideas what might be that?
fixed by manually adding transit-java dep on latest
shadow-cljs depends on transit-clj which depends on transit-java so it should be there regardless?
@thheller plain shadow-cljs in this case
maybe some other dep of mine was overriding the transit version?
Is there a dep-tree option to Shadow?
in the meantime you can try shadow-cljs pom
and mvn dependency:tree
if you have maven installed
Ahh! Perfect!
Anyone know how to fix cannot infer externs for https://github.com/Day8/re-frame-template/blob/master/src/leiningen/new/re_frame/src/cljs/routes.cljs#L18 Seems to break the entire app because I set up navigation before mounting components
@urbanslug (fn [^js event] ...)
@urbanslug but isn't the token coming from a closure router usually? that shouldn't require externs. are you sure thats the problem?
@thheller would be hard to support local deps (like deps :local/root) on shadow deps? I have been in mane cases were it would be very nice to use that
Have you used accountant? From the readme on accountant this seems like it should be possible
(defn hook-browser-navigation! []
(doto (History.)
(gevents/listen
EventType/NAVIGATE
(fn [event] (secretary/dispatch! (.-token event))))
(.setEnabled true)))
(defn setup-routing!
[]
(accountant/configure-navigation!
{:nav-handler #(hook-browser-navigation!)
:path-exists? (fn [path] (secretary/locate-route path))}))
whats your issue? routing is not that hard. sometimes seems libraries just make it harder
hmm I want to transact the app state when links are clicked so that I can change views
https://github.com/venantius/accountant looking at the docs it seems you are setting :nav-handler
incorrectly
(accountant/configure-navigation! {:nav-handler (fn [path] ...) :path-exists? (fn [path] ...)})
(defroute root-path "/" [] (swap! app-state assoc :view :index))
(defroute map-path "/posts" [] (swap! app-state assoc :view :posts))
so if I start at / and click a link for posts that runs :on-click #(accountant/navigate! "/posts")
but if I press back the url bar will update witout the app-state change ties to the route. Even when I refresh it still ignores the contents of the url bar
let me move my call to setup-routing!
to my init so that websocket stuff doesn't affect it and see