This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-14
Channels
- # aws (1)
- # bangalore-clj (1)
- # beginners (48)
- # boot (65)
- # braveandtrue (1)
- # cider (1)
- # clara (15)
- # cljs-dev (7)
- # clojure (179)
- # clojure-austin (1)
- # clojure-denmark (2)
- # clojure-greece (68)
- # clojure-italy (7)
- # clojure-russia (41)
- # clojure-serbia (9)
- # clojure-spec (44)
- # clojure-uk (27)
- # clojured (15)
- # clojureremote (20)
- # clojurescript (70)
- # community-development (2)
- # core-async (10)
- # cursive (14)
- # datomic (36)
- # defnpodcast (3)
- # emacs (13)
- # events (13)
- # hoplon (33)
- # immutant (18)
- # instaparse (2)
- # jobs (29)
- # jobs-discuss (71)
- # klipse (38)
- # lein-figwheel (4)
- # leiningen (1)
- # mount (34)
- # off-topic (36)
- # om (3)
- # onyx (51)
- # pedestal (5)
- # perun (8)
- # proton (2)
- # rdf (8)
- # re-frame (33)
- # reagent (24)
- # remote-jobs (1)
- # rum (6)
- # spacemacs (2)
- # specter (14)
- # sql (5)
- # testing (6)
- # untangled (1)
- # vim (10)
- # yada (3)
Is re-frame also suited for usage server side? I noticed cljc is used a lot in the repo
@borkdude have you seen this FAQ? https://github.com/Day8/re-frame/blob/master/docs/FAQs/Why-CLJC.md
I think you can get away with just core.async if it's "just" server code. You don't need the whole subscription for rendering machinery
Someone shared a library that dispatch
events between server and client code not so long ago, pipelines...something :thinking_face:
I would use it mainly for preventing callback hell, but that isnβt a problem on the JVM, but on NodeJS it could be useful
hello. Here in docs the creating of reagent components is discussed: https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-2--a-function-returning-a-function
I have a question about form-2: why canβt we just do (let [some-setup β¦] (defn the-component [β¦] β¦))
and use it directly instead of having a function that returns this thing?
on the second thought though, we would have to parameterize the setup, so never mind
how do you guys trace events flying around in your apps? Iβve just added the https://github.com/Day8/re-frame-tracer, itβs cool, but it requires to wrap large chunks of code. Any alternatives? Iβm spoiled a bit by redux devtools extension.
Guys, I need some help. I started a project with re-frame but, I couldnβt configure my file structure, I guessβ¦ I created one file per a panel. ; Yes, I have panels. Can you show me an example for big re-frame application structure. Not from the documentation please.
@scknkkrer this is the tree from src
for a re-frame project with a backend. Maybe not exactly "big" yet (one month into development)
src
βββ backend
βΒ Β βββ projectname
βΒ Β βββ activity.clj
βΒ Β βββ external_source.clj
βΒ Β βββ issue.clj
βΒ Β βββ protocols.clj
βΒ Β βββ resource
βΒ Β βΒ Β βββ activity.clj
βΒ Β βΒ Β βββ frontend.clj
βΒ Β βΒ Β βββ issue.clj
βΒ Β βΒ Β βββ login.clj
βΒ Β βΒ Β βββ misc.clj
βΒ Β βββ routes.clj
βΒ Β βββ scheduler.clj
βΒ Β βββ server.clj
βΒ Β βββ store.clj
βΒ Β βββ system.clj
βΒ Β βββ util.clj
βββ common
βΒ Β βββ projectname
βΒ Β βββ schema.cljc
βΒ Β βββ workflow.cljc
βββ frontend
βββ projectname
βββ cofx.cljs
βββ core.cljs
βββ data
βΒ Β βββ persist.cljs
βββ db.cljs
βββ events.cljs
βββ fx.cljs
βββ interceptors.cljs
βββ page
βΒ Β βββ issue.clj
βΒ Β βββ issue.cljs
βΒ Β βββ summary.clj
βΒ Β βββ summary.cljs
βββ routes.cljs
βββ style.clj
βββ subs.cljs
βββ util.cljs
βββ views.cljs
@zak, Itβs big for me. But, how could you configure this structure. Can you write about it ? One db initializer or per panels/pages. One event file or per panels/pages ?
I think, I did something wrong. All wrong. π Because your structure is really organized.
This was based on the re-frame lein template. Mostly just renamed clj
to backend
and cljs
to frontend
To answer your question, the core namespace calls (reagent/render)
with a root passed in from the views namespace and dispatches one :initialize-db
using (re-frame/dispatch-sync)
@scknkkrer Another option you might consider would be to treat your panel(s) as a directory / module which is self-contained. You might find some helpful info here- https://github.com/Day8/re-frame/wiki/A-Larger-App#larger-apps. I came back to a project after some time, and I found it quite helpful to have the modules in their own ns. i.e. auth, users, etc.
unless there's some HTML5 tag of some sort, my understanding was: for download links: the server provides a mime-type, the browser decides "oh, this is a zip file, not a html/css/png; I should download it"
yeah; basically I just have a link, but for some reason it was implemented in javascript
@shader: you might want to consider using open
instead of location
so you can make the target _blank
@negaduck We have https://github.com/Day8/re-frame-trace which is similar to https://github.com/gaearon/redux-devtools but it's not really ready yet