ok after talking with tony i’ll be putting it off until they are formally released
Just FYI. My current job just got kinda crazy (acting as interim CTO). So, my involvement here will be somewhat reduced for a while.
The other team members will be around to answer questions/help with bugs. The more you can narrow down any issues you find the better.
iCTO 🙂 as steve jobs would say
😄
lol
hmmm... (reset)
doesn't seem to be actually reloading server code. Any clues where to look?
hm, works for me
the code is in user.clj
it's just using stuart sierra components reset
(refresh) (go)
also doesn't reload... I'm having to shut down the repl and restart it to see server code changes.
try untangled-todomvc vanilla code base
should work there
urgh. I don't have that set up in IntelliJ atm to make sure everything's the same. but i guess it's the thing to do.
I'm even seeing the correct list of namespaces in the :reloading
message from (reset)
and yet I'm still getting old versions of read methods getting called.
i began my codebase starting with untangled-todomvc as the base, haven't had issues
(not sure why that's happening)
have you rolled the untangled versions forward? (todomvc is back on 0.4.9/0.4.8)
(which shouldn't affect this, just curious)
I think I started my codebase the same way, fwiw
my untangled-client deps? yes
[navis/untangled-client "0.5.4-20160620.191104-1"
[org.omcljs/om "1.0.0-alpha36"]
[navis/untangled-spec "0.3.8" :scope "test"]
I'm on client 0.5.3, server 0.6.0, om 1.0.0-alpha37.
cool, i'll upgrade my om version
[navis/untangled-server "0.4.8" :exclusions [io.aviso/pretty org.clojure/clojurescript]]
it's so crazy... I have a map my basic test query returns via an api-read multimethod. I change a number in the map, (reset)
the server, reload the client page, and I still get the old number in the response.
i could give you myc ode... but it's just the same as todomvc, not sure
like, there's no reason this shouldn't work.
i ended up changing it actually , but not because of any issues iwth the old code
(defonce system nil)
(defn stop []
(alter-var-root #'system
(fn [s] (when s (component/stop s) nil))))
(defn start []
(alter-var-root #'system
(fn [s]
(if s s
(-> (system/make-system) (component/start))))))
(defn reset []
(stop)
(refresh :after 'user/start))
(modulo my own stupidity, obv)
@curtosis: did you write everything you've added to be a component so that your'e getting a full reload?
@tony.kay: Vacuously yes. 🙂 As in, all I've added is an api-read multimethod into the existing component. And in fact, when I do a (reset)
I see :reloading (my-server.api my-server.system)
if I've changed the file; :reloading ()
if I haven't.
remember that multimethods are entries in a map
so, if you change the dispatch symbol, perhaps there's an old entry
but if you've restarted repl that wouldn't be the case
I would expect tools namespace to be clearing that, so don't know.
yeah.... it's kind of baffling.
my user.clj is basically straight from todomvc:
(defn stop "Stop the running web server. Is a no-op if the server is already stopped" []
(when @system
(swap! system component/stop)
(reset! system nil)))
(defn go "Load the overall web server system and start it." []
(init)
(start))
(defn reset
"Stop the web server, refresh all namespace source code from disk, then restart the web server."
[]
(stop)
(refresh :after 'user/go))
yeah, what is the body of the multimethod in question?
(defmethod api-read :sources-list [e k p]
(timbre/info "query: " (op/ast->expr (:ast e)))
{:value table})
and have you mucked with the refresh dirs? Perhaps there is stuff that should be refreshed that isn't, and some path of closure is hitting you
what is table
?
if you change the info logging stmt, is IT reflected?
hmmm... not to my recollection, but I should check the refresh dirs
no, in fact that's my latest change - changing the logging. 😛
table
is just a map
I could wrap it in an atom, but I have another query returning a dereferenced atom and it has the same problem
yeah, I;ve not experienced a problem like this. You're manually running a (reset)
from the repl, right?
And you just said the logging sttmt wasn't changing
so, you're obviously not getting reloaded
OR you have the same multimethod TWICE in the code, and the second is overwriting the first
yep
just the one multimethod
my cousin grep might help
lol
(my initials are awk)
about 3 UNIX nerds just got that joke...evidently on another channel
(set-refresh-dirs "src/server" "specs/server")
should pick up everything under src/server
, right?
I did get it indeed.
briefly pondered making a cgrep = cousin-grep joke.
oh...why isn't dev/server
in there?
there is something in my distant memory that says you want it
can't say why
cause I don't remember
hmm... good question. though the code I'm changing isn't under dev/server
... maybe it's to do with the general namespace-swizzling voodoo.
I'll try that.
k
I seem to remember having problems if I didn't have that...probably something about system closing over stuff
et voilà . that was it!
adding a comment to my code now to remember why it's there. 😉
thanks!
now back to getting data back into the client side....
aka learning to get the reconciler to do my work for me....