This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-27
Channels
- # bangalore-clj (2)
- # beginners (37)
- # boot (16)
- # cider (17)
- # clara (4)
- # cljs-dev (351)
- # cljsrn (16)
- # clojure (219)
- # clojure-belgium (4)
- # clojure-dev (3)
- # clojure-france (2)
- # clojure-italy (24)
- # clojure-russia (23)
- # clojure-spec (55)
- # clojure-switzerland (3)
- # clojure-uk (89)
- # clojurescript (121)
- # cursive (2)
- # datomic (29)
- # devops (2)
- # graphql (8)
- # hoplon (15)
- # immutant (5)
- # lein-figwheel (4)
- # liberator (3)
- # luminus (18)
- # off-topic (9)
- # om (6)
- # onyx (31)
- # pedestal (48)
- # precept (9)
- # re-frame (19)
- # reagent (63)
- # ring-swagger (69)
- # robots (1)
- # slack-help (14)
- # spacemacs (12)
- # sql (2)
- # test-check (4)
- # unrepl (28)
- # untangled (5)
- # yada (3)
@mgrbyte perhaps Pedestal’s service-tools watch
impl could help, or at least provide inspiration. https://github.com/pedestal/pedestal/blob/master/service-tools/src/io/pedestal/service_tools/dev.clj#L23
@ddeaguiar thanks. am not sure it would/does in this case. I'm wondering what the vase dev's workflow is?
So I don’t think the workflow is that different that when you work with a traditional Pedestal service. Just reload the service namespace after making any changes to the vase edn file.
@ddeaguiar ah ok. I thought I was doing that (and have been using ns-tracker), so must be doing something stupid
It’s been a while since I’ve worked with Vase so I’ll double check later today as well
can you clarify what action you're thinking of when you say "reload the service namespace" pls. with cider in emacs I do that by re-evaluating the form - not sure what the equiv. is in a regular repl
@ddeaguiar In the repl I do: (run-dev)
, then (require '[my-app.ns] :reload)
after changing the edn resource file - would you expect that to reflect changes? (it doesn't currently in my setup)
So I’m typically doing this in emacs and use cider-load-buffer
after making changes. I don’t recall what that does under the covers
I similarly run this in cider connecting (repl runing separately in the terminal). I use cider-eval-buffer
will try load instead.
so I finally figure out a way. Had missed that run-dev
will return the service-map and one can (server/stop service-map)
and re-restart
This is because the value of ::server/routes
is a fn and evaluated on every request (https://github.com/cognitect-labs/vase/blob/master/template/src/leiningen/new/vase/server.clj#L52)
perhaps it's because I'm using the mutliple vase resource files as per the petstore-full sample?
hmm, I wouldn’t think so. if your service map routes
value is a function, it will be executed on every request. If that function loads vase resource files, then they’ll get loaded on every request
still no joy. I stop and restart the repl, and I see my changes (w/no errors). changing my edn resource file alone, no changes seen. 😕
so can confirm this doesn't work. I checked out vase, started the petstore-full sample with lein run-dev
then edited resources/petstore-full.categories.edn
to add a new route, change isn't picked up
Used the describe-api endpoint to check that (http://localhost:8888/api)
The vase descriptors are only being loaded when run-dev
is invoked https://github.com/cognitect-labs/vase/blob/master/samples/petstore-full/src/petstore_full/server.clj#L13
That’s a suboptimal dev experience but one could argue that was not the point of this sample
Just be sure to limit hot-reloading to dev because it does have a performance impact
ok, having read the code think I've got a good idea how this will work. thanks for your help and patience @ddeaguiar 🙂
Glad you were able to figure things out @mgrbyte. When in doubt stick to what’s done in the Pedestal/Vase lein templates. Sometimes the examples stray from that and it’s unclear why.
Sorry to be asking endless vase newbie questions here. I can't tell if this is a datomic problem or a vase problem but I keep getting a back the following kind of response when I'm trying to post to create new entities {"whitelist":[{}],"transaction":[[13194139534318,50,"2017-06-27T19:46:27Z"]]}