This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-22
Channels
- # announcements (28)
- # babashka (77)
- # beginners (122)
- # calva (40)
- # circleci (3)
- # clj-kondo (47)
- # cljs-dev (9)
- # clojure (119)
- # clojure-australia (1)
- # clojure-europe (88)
- # clojure-nl (3)
- # clojure-uk (33)
- # code-reviews (64)
- # core-logic (37)
- # cursive (10)
- # datomic (13)
- # emacs (1)
- # fulcro (4)
- # graalvm (1)
- # graphql (5)
- # helix (4)
- # integrant (25)
- # jobs (1)
- # jobs-rus (1)
- # off-topic (3)
- # pathom (12)
- # random (1)
- # re-frame (48)
- # reagent (1)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (4)
- # ring (6)
- # ring-swagger (1)
- # shadow-cljs (21)
- # sql (8)
- # tools-deps (25)
- # vim (15)
- # xtdb (12)
Hello @b Maybe my example repo here can help you: • https://github.com/PrestanceDesign/usermanager-reitit-integrant-example
@admin055 this is already helpful, thanks! Now for your continued workflow, would you (def mydb (:database.sql/connection integrant.repl.state/system))
to continue working on this?
You're welcome. I'm not sure to exactly understand your question.
Assuming you're in usermanager.model.user-manager and you want to create a new function that takes db, like get-user-by-first-name
how would you write it? of course that's an easy example and the SQL would probably be right on the first try, but how would you interactively develop and test it in the running system
I use the reloaded workflow with Integrant-repl https://github.com/weavejester/integrant-repl as my example repo does. in this way it is possible to reset the app state, etc.
Which editor do you use?
I'm sorry this may be a bit cumbersome but I'm actually not sure if other people do the kind of def
I do above or how they handle iterative development on the stateful stuff
in mount I have the state right there so I can treat it like a global (in another language), there is no disconnect between my REPL development and the application, but in integrant there has to be (at least for the parts that are iterative on the stateful stuff)
OK, I see. You want to keep continuing to iterate with the interactive REPL workflow.
So your approch seems fine for me.
As you can see, my deps.edn
contains this :dev
alias https://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/deps.edn#L13
yeah but there is no state, except the state that is handled by integrant.repl.state/system
I use Emacs (Spacemacs too).
I have this dir-locals file https://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/.dir-locals.el when I jack-in, this allows to load integrant-repl at the level of the user
namespace of the REPL.
After that you can write your new function, require it in the user ns and call it with mydb
for eg.
It was to say that it was possible. But I think in reality with Integrant-repl it's more about using reset, etc with keyboard shortcuts as I configured for Emacs with the cider-ns-refresh hook. https://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/.dir-locals.el#L5
After that I am not yet an expert so maybe others will have advice on this. 🙂
Did you already read this old post who was the first iteration of the reloaded workflow? https://www.cognitect.com/blog/2013/06/04/clojure-workflow-reloaded