untangled

NEW CHANNEL: #fulcro
adambros 2016-07-06T01:00:05.001675Z

ok after talking with tony i’ll be putting it off until they are formally released

tony.kay 2016-07-06T15:58:44.001676Z

Just FYI. My current job just got kinda crazy (acting as interim CTO). So, my involvement here will be somewhat reduced for a while.

tony.kay 2016-07-06T15:59:29.001677Z

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.

2016-07-06T18:47:57.001678Z

iCTO 🙂 as steve jobs would say

tony.kay 2016-07-06T18:48:19.001679Z

😄

currentoor 2016-07-06T19:49:55.001680Z

lol

curtosis 2016-07-06T22:41:00.001683Z

hmmm... (reset) doesn't seem to be actually reloading server code. Any clues where to look?

2016-07-06T22:41:13.001684Z

hm, works for me

2016-07-06T22:41:18.001685Z

the code is in user.clj

2016-07-06T22:41:31.001686Z

it's just using stuart sierra components reset

curtosis 2016-07-06T22:41:45.001687Z

(refresh) (go) also doesn't reload... I'm having to shut down the repl and restart it to see server code changes.

2016-07-06T22:42:09.001688Z

try untangled-todomvc vanilla code base

2016-07-06T22:42:11.001689Z

should work there

curtosis 2016-07-06T22:43:40.001690Z

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.

curtosis 2016-07-06T22:45:04.001691Z

I'm even seeing the correct list of namespaces in the :reloading message from (reset)

curtosis 2016-07-06T22:45:48.001692Z

and yet I'm still getting old versions of read methods getting called.

2016-07-06T22:49:52.001693Z

i began my codebase starting with untangled-todomvc as the base, haven't had issues

2016-07-06T22:50:20.001694Z

(not sure why that's happening)

curtosis 2016-07-06T22:52:45.001695Z

have you rolled the untangled versions forward? (todomvc is back on 0.4.9/0.4.8)

curtosis 2016-07-06T22:52:56.001696Z

(which shouldn't affect this, just curious)

curtosis 2016-07-06T22:54:21.001697Z

I think I started my codebase the same way, fwiw

2016-07-06T22:55:31.001698Z

my untangled-client deps? yes

2016-07-06T22:55:40.001699Z

[navis/untangled-client "0.5.4-20160620.191104-1"

2016-07-06T22:55:47.001700Z

[org.omcljs/om "1.0.0-alpha36"]

2016-07-06T22:55:59.001701Z

[navis/untangled-spec "0.3.8" :scope "test"]

curtosis 2016-07-06T22:56:55.001702Z

I'm on client 0.5.3, server 0.6.0, om 1.0.0-alpha37.

2016-07-06T22:57:48.001703Z

cool, i'll upgrade my om version

2016-07-06T22:58:17.001704Z

[navis/untangled-server "0.4.8" :exclusions [io.aviso/pretty org.clojure/clojurescript]]

curtosis 2016-07-06T22:59:21.001705Z

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.

2016-07-06T23:00:07.001706Z

i could give you myc ode... but it's just the same as todomvc, not sure

curtosis 2016-07-06T23:00:28.001707Z

like, there's no reason this shouldn't work.

2016-07-06T23:00:38.001708Z

i ended up changing it actually , but not because of any issues iwth the old code

2016-07-06T23:00:49.001709Z

(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))

curtosis 2016-07-06T23:00:58.001710Z

(modulo my own stupidity, obv)

tony.kay 2016-07-06T23:01:27.001711Z

@curtosis: did you write everything you've added to be a component so that your'e getting a full reload?

curtosis 2016-07-06T23:03:32.001712Z

@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.

tony.kay 2016-07-06T23:04:34.001714Z

remember that multimethods are entries in a map

tony.kay 2016-07-06T23:04:52.001715Z

so, if you change the dispatch symbol, perhaps there's an old entry

tony.kay 2016-07-06T23:05:02.001716Z

but if you've restarted repl that wouldn't be the case

tony.kay 2016-07-06T23:05:16.001717Z

I would expect tools namespace to be clearing that, so don't know.

curtosis 2016-07-06T23:05:23.001718Z

yeah.... it's kind of baffling.

curtosis 2016-07-06T23:07:01.001719Z

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))

tony.kay 2016-07-06T23:07:18.001720Z

yeah, what is the body of the multimethod in question?

curtosis 2016-07-06T23:08:02.001721Z

(defmethod api-read :sources-list [e k p]
  (timbre/info "query: " (op/ast->expr (:ast e)))
  {:value table})

tony.kay 2016-07-06T23:08:05.001722Z

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

tony.kay 2016-07-06T23:08:21.001723Z

what is table?

tony.kay 2016-07-06T23:08:40.001724Z

if you change the info logging stmt, is IT reflected?

curtosis 2016-07-06T23:08:43.001725Z

hmmm... not to my recollection, but I should check the refresh dirs

curtosis 2016-07-06T23:09:00.001726Z

no, in fact that's my latest change - changing the logging. 😛

curtosis 2016-07-06T23:09:06.001727Z

table is just a map

curtosis 2016-07-06T23:09:44.001728Z

I could wrap it in an atom, but I have another query returning a dereferenced atom and it has the same problem

tony.kay 2016-07-06T23:09:54.001729Z

yeah, I;ve not experienced a problem like this. You're manually running a (reset) from the repl, right?

tony.kay 2016-07-06T23:10:01.001730Z

And you just said the logging sttmt wasn't changing

tony.kay 2016-07-06T23:10:07.001731Z

so, you're obviously not getting reloaded

tony.kay 2016-07-06T23:10:24.001732Z

OR you have the same multimethod TWICE in the code, and the second is overwriting the first

curtosis 2016-07-06T23:10:26.001733Z

yep

curtosis 2016-07-06T23:10:41.001734Z

just the one multimethod

tony.kay 2016-07-06T23:10:42.001735Z

my cousin grep might help

curtosis 2016-07-06T23:10:44.001736Z

lol

tony.kay 2016-07-06T23:10:51.001737Z

(my initials are awk)

tony.kay 2016-07-06T23:11:18.001738Z

about 3 UNIX nerds just got that joke...evidently on another channel

curtosis 2016-07-06T23:12:04.001739Z

(set-refresh-dirs "src/server" "specs/server") should pick up everything under src/server, right?

curtosis 2016-07-06T23:12:12.001740Z

I did get it indeed.

curtosis 2016-07-06T23:12:37.001741Z

briefly pondered making a cgrep = cousin-grep joke.

tony.kay 2016-07-06T23:12:37.001742Z

oh...why isn't dev/server in there?

tony.kay 2016-07-06T23:13:42.001744Z

there is something in my distant memory that says you want it

tony.kay 2016-07-06T23:13:48.001745Z

can't say why

tony.kay 2016-07-06T23:13:53.001746Z

cause I don't remember

curtosis 2016-07-06T23:14:10.001747Z

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.

curtosis 2016-07-06T23:14:14.001748Z

I'll try that.

tony.kay 2016-07-06T23:14:18.001749Z

k

tony.kay 2016-07-06T23:14:41.001750Z

I seem to remember having problems if I didn't have that...probably something about system closing over stuff

curtosis 2016-07-06T23:17:03.001751Z

et voilà. that was it!

curtosis 2016-07-06T23:17:30.001752Z

adding a comment to my code now to remember why it's there. 😉

curtosis 2016-07-06T23:18:01.001753Z

thanks!

curtosis 2016-07-06T23:19:02.001754Z

now back to getting data back into the client side....

curtosis 2016-07-06T23:21:03.001755Z

aka learning to get the reconciler to do my work for me....