This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-17
Channels
- # announcements (8)
- # atom-editor (8)
- # aws (1)
- # babashka (96)
- # beginners (128)
- # calva (7)
- # cider (12)
- # cljsrn (1)
- # clojure (75)
- # clojure-europe (28)
- # clojure-hamburg (2)
- # clojure-italy (7)
- # clojure-nl (7)
- # clojure-norway (3)
- # clojure-uk (13)
- # clojurescript (26)
- # conjure (2)
- # cursive (18)
- # data-science (7)
- # datalog (21)
- # datomic (9)
- # duct (15)
- # expound (29)
- # figwheel-main (14)
- # fulcro (59)
- # helix (4)
- # jobs (2)
- # kaocha (19)
- # leiningen (15)
- # luminus (4)
- # malli (57)
- # meander (2)
- # off-topic (2)
- # pathom (12)
- # pedestal (8)
- # re-frame (53)
- # reitit (9)
- # remote-jobs (1)
- # shadow-cljs (64)
- # spacemacs (1)
- # specter (2)
- # tools-deps (12)
- # tree-sitter (2)
- # vim (11)
- # xtdb (17)
In my event-fx registration, is it possible to use subscriptions to query the db? I don't need the reactivity of subs, but I don't want to duplicate the code in the sub query handler.
In particular the sub query I want to use itself is a layer 3 (materialised view) subscription, so I can't simply refactor out the body of the sub into a standalone function
https://github.com/day8/re-frame/blob/master/docs/FAQs/UseASubscriptionInAnEventHandler.md The initial discussion: https://github.com/day8/re-frame/issues/255
For creating a "production" version of my re-frame app I'm not at all clear what to do. I couldn't see a section in the docs on this. Ideally I'd like it to be packed into the smallest possible vessel, maybe even using something like Electron. Am I missing some docs?
What you describe sounds completely orthogonal to re-frame. Re-frame is just a state management library, that's it.
Eh? You use re-frame to build an app. You might argue "Why are you asking this here?" there's nothing specific about packaging up a re-frame based application — which would be fair enough. But I don't think the question itself is unreasonable. I ask here because I'm building the app with re-frame and I assume others are likewise and might give me some pointers for how they've distributed the release versions of their app.
@sandbags
You may want to look at template like re-frame-template
. It will create a scaffold re-frame application for you. That scaffold will supply dev and prod builds (read the docs provided).
Ah, @U051MTYAB thank you. In fact I am based on that template but I hadn't appreciated it handled a prod build. I will take another look, thanks.
As @U2FRKM4TW pointed out, this is not really a re-frame issue. This is a build tool issue. Look towards shadow-cljs etc.
Yes my lack of any recent JS/CLJS/Reagent use/experience is catching me out here. I was just hoping to tap the wisdom of people building apps with re-frame.
Build tool, yes, but also packaging. And deployment, assuming we're talking about a web app (although you mentioned Electron above, which is for desktop apps).
This is an app built with re-frame but it's intended as a desktop app, hence why ultimately I might prefer to use something like Electron. But I haven't done this kind of stuff in ages (if at all) and am a bit at sea with all the options/frameworks/etc…
Maybe looking at some template would help to get some ideas when talking specifically at electron https://github.com/chimez/shadow-electron-re-frame-starter
Thanks alpox. I saw that was wondering if it was still good after 2 years (so much moves so fast). I'll definitely give it a look now, thank you.
I did not try it lately so chances are that things changed but I would guess not by much. It should still help to get an idea.
Is the use of 'electorn' rather than 'electron' whimsy/mispelling? Or is there something I should be aware of there do you think?
Thats a simple miss-spell.
You install electron globally under the name "electron" npm install electron -g
which also provides you with the cli-tool named electron
Okay I figured as much but thought it wise to check. I've not really any knowledge of JS eco-system/Electron beyond the general.
If you run into questions concerning the JS ecosystem you can write me a PM - I'm still doing more in the JS ecosystem than Clojure due to my job. (But with Electron I did only some hobby-testing)
The re-frame-template says to use lein release
for a production build. Is that https://github.com/technomancy/lein-release ? This appears to be 10yr old and superceded by https://github.com/technomancy/lein-tar but is, in any case, complaining about my lack of gpg and something about not being able to sign a tag. That seems to be lein vcs
at work. Looking at the docs for that I've passed --no-sign
as an argument which stopped it complaining about that but now it errors with "On branch master. nothing to commit, working tree clean. java.lang.Exception: Couldn't commit. git exit code: 1" but, when I tried it with something to commit it was complaining that my working tree wasn't clean! Neither lein release or lein tar seem to mention anything about git in their docs so I am wondering if I am looking at the wrong thing?
Yep its an alias for lein shadow release. @sandbags
Prehaps unfortunate naming if it is going to cause confusion.
@U0G75S29H in this case somehow I was missing the :release
alias in my project.clj and so something was happening but it's not clear what — in this case I think it was confusing
Thanks for the feedback @sandbags :thumbsup: I'll have to think about how to best mitigate it.
it was unclear from your message, since you started talking about some other things
If I don't use --no-sign
I get errors about gpg being missing and not being able to sign a git tag.
I've just searched my project.clj for any sign of it and I can't see it. I certainly didn't add it myself as this is the first I've heard of it.
I just did this:
$ lein new re-frame foo
$ cd foo
$ lein release
and it downloaded all of the needed dependencies, built the app successfullyafter you’ve done that, I would ensure that you don’t have any lein profiles that are interfering. You can check that by looking in ~/.lein/profiles.clj
:aliases {"dev" ["do"
["shell" "echo" "\"DEPRECATED: Please use lein watch instead.\""]
["watch"]]
"watch" ["with-profile" "dev" "do"
["shadow" "watch" "app" "browser-test" "karma-test"]]
"prod" ["do"
["shell" "echo" "\"DEPRECATED: Please use lein release instead.\""]
["release"]]
"release" ["with-profile" "prod" "do"
["shadow" "release" "app"]]
"build-report" ["with-profile" "prod" "do"
["shadow" "run" "shadow.cljs.build-report" "app" "target/build-report.html"]
["shell" "open" "target/build-report.html"]]
"karma" ["do"
["shell" "echo" "\"DEPRECATED: Please use lein ci instead.\""]
["ci"]]
"ci" ["with-profile" "prod" "do"
["shadow" "compile" "karma-test"]
["shell" "karma" "start" "--single-run" "--reporters" "junit,dots"]]}