Fork me on GitHub
#pedestal
<
2017-04-25
>
vlaaad14:04:46

Hi! I'm having trouble with vase — I want to retract attribute's value in entity, and can't find a way to do it: vase/transact either retracts entity fully, or asserts new facts about entity. How can I retract only one attribute/value?

ddeaguiar14:04:18

although :db-op only supports retracting an entity hmm

vlaaad14:04:17

@ddeaguiar yeah, been there, with no results

ddeaguiar14:04:59

hrm. It may require the creation of an interceptor. Unfortunately I can’t dig into this atm 😞

sineer18:04:13

I spent hours trying to figure out why my pedestal router can't pickup newly modified "master-routes" when running in the repl 😞 I pass this to pedestal.service/service ... ::http/routes #(deref #'routes/master-routes)

sineer18:04:20

when I (run-dev) in repl it starts jetty server and everything works, when I modify master-routes to let's say add a route it never works until I kill cider and restart run-dev even too my master-routes def has changed

sineer18:04:05

I don't get it. when I (deref #'routes/master-routes) I can see my changes, why is it pedestal router can't pick them up ?

ddeaguiar18:04:46

If you’re working on an app created from the pedestal-service lein template, you need to reload the service namespace

ddeaguiar18:04:08

or at least the fn in question

sineer18:04:30

I'm using the figwheel template with boot so I may be confused a little

ddeaguiar18:04:15

still, if you’ve got a repl then reloading the namespace should work

sineer18:04:51

Hrmm, I think I tried that by using cider-refresh and boot-refresh but I'll try again

sineer18:04:03

It doesn't seem to be doing anything since the (run-dev) fn is already called and my router is setup to deref the master-routes var each lookup so I really don't get it 😞

sineer18:04:34

I don't even know how I can kill the (run-dev) without killing cider

ddeaguiar18:04:59

I use C-c C-k which I think is bound to cider-load-buffer

ddeaguiar18:04:22

clearly I’m using emacs

ddeaguiar18:04:27

sorry if that doesn’t help

sineer18:04:12

yes it does work, I see cider re-eval the buffer and I did that for service, server and routes namespaces

sineer18:04:29

But again pedestal did not pickup my routes changes

sineer18:04:44

even too I can see in repl that (deref #'master-routes) has my changes

ddeaguiar18:04:30

you also need to be careful with cider-refresh

ddeaguiar18:04:47

I’d restart the repl and try again without doing a cider-refresh

ddeaguiar18:04:08

cider-refresh can throw things out of sorts

ddeaguiar18:04:22

that is as technical as I can get about it :0

sineer18:04:52

Ok I'm commenting it out and trying it without

sineer18:04:30

Damn it works!

sineer18:04:11

All this time I wonder what was wrong, I tried a few time before trying out cider refresh but I must've been doing something wrong...

sineer18:04:21

Thanks a lot my friend!

ddeaguiar18:04:44

FWIW, I avoid cider-refresh

sineer19:04:15

Ok thanks for the hint, I wanted to avoid it too if I could but I figure I'd give it a try when I failed to reload code without it not sure why, I guess I just need more cider/repl practice 🙂

ddeaguiar19:04:21

not sure what it’s doing different under the covers but I prefer invoking clojure.tools.namespace.repl refresh and refresh-all directly in a repl

ddeaguiar19:04:45

last I looked into this I couldn’t spot the difference but I definitely observed different behavior

ddeaguiar19:04:32

I also don’t refresh as much as I used to. I focus on reloading the namespace I’m in

sineer19:04:24

Yeah its probably something to do with it reloading lots of namespace at once, I just tried re-enabling cider-refresh and doing the cider-refresh in emacs and I confirm that it doesn't work...

sineer19:04:25

It's very strange too because if I do deref #'master-routes I can see my changes but the old master-route is still being used by pedestal.

sineer19:04:48

lost several hours to figure that out heh, oh well. Thanks again! 🙂

ddeaguiar19:04:54

np, glad to help!