This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-28
Channels
- # arachne (2)
- # aws (5)
- # aws-lambda (5)
- # beginners (4)
- # boot (25)
- # cljs-dev (270)
- # cljsjs (1)
- # cljsrn (72)
- # clojars (5)
- # clojure (201)
- # clojure-belgium (5)
- # clojure-brasil (4)
- # clojure-italy (2)
- # clojure-korea (2)
- # clojure-russia (24)
- # clojure-spec (24)
- # clojure-uk (22)
- # clojurebridge (1)
- # clojurescript (125)
- # cloverage (3)
- # cursive (41)
- # datomic (37)
- # dirac (4)
- # emacs (2)
- # hoplon (421)
- # lein-figwheel (1)
- # leiningen (5)
- # luminus (2)
- # mount (1)
- # off-topic (18)
- # om (44)
- # om-next (4)
- # onyx (44)
- # pedestal (3)
- # proton (9)
- # re-frame (21)
- # reagent (21)
- # ring-swagger (12)
- # specter (9)
- # sql (2)
- # untangled (62)
- # vim (16)
how should I write a task for side effects?
does
(deftask foo []
(dosh “side” “effecting” “command"))
just work?@anmonteiro no, tasks must return a fileset
so with-pass-thru
maybe?
awesome
thanks
It seems like require
s inside pod/with-eval-in
are slower than outside.
(time (require ‘some.ns)) ;; 0.1 ms
(time (require ‘some.ns :reload)) ;; 20 ms
(pod/with-eval-in some-pod
(time (require ‘some.ns))) ;; 4500 ms
Any idea why this is so? 😮@martinklepsch suggested that outside was faster because it was caching from a require
further up, but as you can see, there is a :reload
keyword in the second require
, and while it takes a little longer than the one above it, it’s several orders of magnitude faster than inside the pod.
Or is (require … :reload)
still faster than a fresh require
?
@levitanong I think :reload
does not reload all transitive dependencies of a namespace which is what a "fresh" require does
@martinklepsch I see… I did do a time
on the top level ns
, and it did take about 4s. So it does seem like :reload
does something differently from a fresh require.
Now my question is, what do you mean by "transitive dependencies”?
@levitanong when you require a namespace that namespace may require other namespaces these are "transitive dependencies"
I guess you could also call it indirect but transitive is often used in the context of Maven dependencies and I think it makes sense here too
@martinklepsch so if for example a namespace foo
depends on a namespace bar
, and that in turn depends on a namespace baz
, a :reload
on foo only refreshes foo
, and won’t see any changes to baz
?
I'm not 100% sure if that is true but it would explain the differences you're seeing
Yes, require :reload doesn't reload changed namespaces transtitively
there is :reload-all
option which reloads all namespaces always
which can be very slow
Okay, it is clear to me now. Thanks, @martinklepsch and @juhoteperi! 😄
@symbit are you behind a proxy/firewall? maybe you need to configure proxy settings?
https://github.com/boot-clj/boot/wiki/Boot-Environment under :proxy is how to configure with boot
although, it's odd it's failing for maven central but not for clojars... both are https...