This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-12
Channels
- # admin-announcements (8)
- # alda (11)
- # announcements (53)
- # architecture (2)
- # aws (10)
- # beginners (69)
- # boot (403)
- # braid-chat (160)
- # cider (10)
- # cljs-dev (14)
- # cljsjs (26)
- # cljsrn (34)
- # clojure (223)
- # clojure-art (1)
- # clojure-brasil (4)
- # clojure-dev (10)
- # clojure-france (1)
- # clojure-gamedev (1)
- # clojure-nl (14)
- # clojure-russia (20)
- # clojure-seattle (8)
- # clojure-sg (1)
- # clojurebridge (2)
- # clojurescript (156)
- # code-reviews (2)
- # community-development (305)
- # cursive (5)
- # datavis (33)
- # datomic (38)
- # devcards (4)
- # dirac (39)
- # dunaj (3)
- # emacs (5)
- # events (2)
- # funcool (45)
- # hoplon (3)
- # instaparse (24)
- # jobs (2)
- # ldnclj (77)
- # lein-figwheel (4)
- # leiningen (1)
- # mount (49)
- # nyc (14)
- # off-topic (52)
- # om (125)
- # omnext (4)
- # onyx (13)
- # other-lisps (1)
- # overtone (8)
- # parinfer (31)
- # plastic (6)
- # portland-or (3)
- # quil (4)
- # re-frame (6)
- # reading-clojure (16)
- # reagent (212)
- # ring-swagger (11)
- # robots (5)
- # spacemacs (4)
- # specter (1)
- # yada (26)
@fappy, interesting. I noticed that recently some of the circle builds randomly fail due to cljs tests complaining about cleanup-if-dirty
, but then they get rebuilt, and the problem goes away. might have to do with an order things get compiled / referenced.
(i.e. I know it is a problem, since I see it happens sometimes, but did not pinpoint the reason yet)
@tolitius: it works as long as I :refer [cleanup-if-dirty]
... I suppose it's because I'm in ClojureScript and the defstate
macro expansion refers to cleanup-if-dirty
@tolitius: perhaps if defstate
is the only one who uses cleanup-if-dirty
then it can be a local let-fn
inside the macro expansion and cljs users would not need to :refer
it in addition to defstate
?
@tolitius: a second question: in ClojureScript, it looks like a defstate is not actually :start
ed until the moment someone @ deref's it --- that is, :refer
ing it is not enough to :start
a dependency.... Is this as-designed (the start-up order for everything will be the same) or is this an unexpected difference from pure Clojure?
@fappy the rational for derefing is here: https://github.com/tolitius/mount/blob/master/doc/clojurescript.md#managing-state-in-clojurescript (long story short, in cljs :advanced
you can't rely on several Clojure namespace API) but if you are not planing to use :advanced
to start with, you don't have to go into cljc
mode
since we already have several cljs projects that use mount (+ the mount cljs example app: https://github.com/tolitius/mount/tree/master/dev/cljs/app) and they do not need to require it..
can you run boot test-cljs
or lein do clean, doo phantom test once
(whichever you prefer) from the mount root and see if it passes for you?
$ time lein do clean, doo phantom test once 0.1.9-SNAPSHOT
;; =============================================================
;; Testing with Phantom:
Testing mount.test.fun-with-values
Testing mount.test.private-fun
Testing mount.test.parts
Testing mount.test.cleanup-dirty-states
Testing mount.test.stop-except
Testing mount.test.start-without
Testing mount.test.start-with
Testing mount.test.suspend-resume
Ran 9 tests containing 71 assertions.
0 failures, 0 errors.
12.66s user 1.16s system 142% cpu 9.704 total
that still requires phantom which is still in the process of --recurse-submodules
before building from source
if it is a problem, there are a couple of other things to try:
1. You can run a cljs example app, and see if it works for you (it does not have :require
cleanup-if-dirty
)
2. You can give me something to checkout and try, if that is ok, of course
may have to give you something since phantom build from source failed on my machine. (it didn't think libQt5Bootstrap.a
was compatible when searching for libQt5Bootstrap.a
)
@tolitius: https://github.com/frankhenderson/mount-question is an almost minimal repo of the warning in my environment
@tolitius: I think all I needed was to add (mount/in-cljc-mode)
to my core namespace. The warning is gone now.
you'll definitely need it, if you are going as far as ClojureScript production deploys, since then you'll use :advanced
compilation optimization level, which would mangle all the namespaces
glad it works, and that is probably why we have not seen it before since, so far everyone I know using mount on cljs do run it cljc mode. I would still like to understand the reason though..
Well... this will just be a server-side app. In cases where I don't care about disk usage, I won't have to use :advanced
... there will be no downloading of my generated js
I see.. if you don't mind to run in this mode for now, that would be good. I'll try to piece together the reason.
ok thanks. (I still have to learn how to use the generated source-map to make sense of the mangled names in a stack trace. I think the browser does it for everyone else but my use case doesn't include a browser!)
yea.. that's definitely not your env or anything on your side:
boot.user=> (start-repl)
cljs.user=> (require-macros '[mount.core :refer [defstate]])
nil
cljs.user=> (defstate a :start 42)
clojure.lang.ExceptionInfo: Unable to resolve var: cleanup-if-dirty in this context at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :tag :cljs/analysis-error}
cljs.user=>
cljs.user=> (require '[mount.core :as mount])
nil
cljs.user=> (mount/in-cljc-mode)
:cljc
cljs.user=> (defstate a :start 42)
#'cljs.user/a
cljs.user=> a
#object[mount.core.DerefableState]
cljs.user=> @a
42
@fappy: looks like (:require [mount.core])
at the app entry should be enough. no need to run it in cljc
mode