This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-12
Channels
- # bangalore-clj (4)
- # beginners (40)
- # boot (53)
- # cider (34)
- # cljs-dev (9)
- # cljsrn (11)
- # clojure (113)
- # clojure-boston (5)
- # clojure-dev (9)
- # clojure-dusseldorf (4)
- # clojure-russia (8)
- # clojure-spec (11)
- # clojure-uk (12)
- # clojurescript (88)
- # cloverage (17)
- # conf-proposals (4)
- # core-async (30)
- # cursive (9)
- # datomic (107)
- # euroclojure (5)
- # hoplon (196)
- # luminus (10)
- # off-topic (20)
- # om (24)
- # om-next (1)
- # onyx (80)
- # parinfer (3)
- # pedestal (16)
- # planck (44)
- # proton (8)
- # protorepl (1)
- # re-frame (19)
- # reagent (7)
- # spacemacs (2)
- # untangled (29)
- # yada (25)
I'd be interested in exploring it further. Doing multiple transacts at once is probably not encouraged (since they should compose into one)...but I fail to understand what the exact problem might be that causes the error
The intention is to have mutations that need to load data do the process described (load-data-action)...that is why I wrote it: so you could compose loads with other mutations within the mutation. that said, you should be able to add the load-data
mutation into your transact (transact! this '[(f) (untangled/load-data ...)]
I kind of like putting untangled/load-data directly in the transact rather than writing a new transaction for each load
should be easy enough to write a simple om app that runs multiple transactions in the same function call. i’ll ask on #C06DT2YSY
@robert-stuttaford: Here's my fix:
(defn refresh-dirs
"Remove `resource` path from refresh-dirs"
([] (refresh-dirs repl/refresh-dirs))
([dirs]
(let [resources-path (-> "public" resource .getPath File. .getParent)
exclusions #{resources-path}
ds (or (seq dirs) (cp/classpath-directories))]
(remove #(contains? exclusions (.getPath %)) ds))))
(defn reset
"Destroys, initializes, and starts the current development system"
[]
(stop)
(apply repl/set-refresh-dirs (refresh-dirs))
(repl/refresh :after 'user/go))
Getting the path to the resource directory feels a bit hacky (what if I have multiple resource paths?) but that's a problem to solve another day.
@jasonjckn: I'm using the Reloaded workflow on the backend, and both the client and backend code is in the same project. By default, clojure.tools.namespace.repl/refresh
includes the resource
directory in the classpath. When Figwheel compiles files, it copies cljc files into the resource directory. When repl/refresh
then loads these files as well, and they were stomping on my backend code.
That repl/set-refresh-dirs
then sets the repl/refresh-dirs
Var that repl/refresh
looks at. And it solved my problem.
Here was a test-case that I wrote up that displays the problem I was having: https://github.com/grzm/bad-om-transit
@grzm: thanks for the explanation, maybe I have hit this issue actually, so i'll try your fix out
@jasonjckn: you're welcome 🙂
Caused by: java.lang.IllegalStateException: var: repl/refresh-dirs is not public, compiling:(user.clj:34:7)
@jasonjckn: Interesting. How are you including tools.namespace.repl?