This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-31
Channels
- # beginners (153)
- # cider (30)
- # cljs-dev (8)
- # cljsrn (8)
- # clojure (105)
- # clojure-dev (6)
- # clojure-dusseldorf (5)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-russia (34)
- # clojure-spec (23)
- # clojure-uk (54)
- # clojurescript (104)
- # core-matrix (3)
- # crypto (1)
- # cursive (17)
- # datomic (90)
- # duct (13)
- # editors (5)
- # emacs (1)
- # events (1)
- # figwheel-main (9)
- # fulcro (54)
- # hoplon (18)
- # hyperfiddle (2)
- # jobs-rus (1)
- # lein-figwheel (5)
- # leiningen (3)
- # luminus (52)
- # mount (6)
- # off-topic (22)
- # other-languages (3)
- # parinfer (7)
- # powderkeg (3)
- # re-frame (52)
- # reagent (58)
- # rum (4)
- # shadow-cljs (49)
- # spacemacs (12)
- # sql (13)
- # tools-deps (2)
- # yada (1)
I am trying to use re-frame-debux with re-frame-10x. I spent a couple of hours getting it set up and playing with it but can't get re-frame-debux to work. I'm hoping someone will recognize the error messages and be able to tell me the obvious thing I've missed. We have been using re-frame for almost two years (love it) and I just circled back around to checking out re-frame-10x.
I've checked the prereq's and versions - all good: clj 1.8 and cljs 1.9.946
I've got the dependencies set up with the two libs. tracing
in :project/dev :dependencies and tracing-stubs
in production :dependencies.
cljsbuild :compiler settings
:preloads [day8.re-frame-10x.preload]
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true
"day8.re_frame.tracing.trace_enabled_QMARK_" true}
If I try to add [day8.re-frame.tracing :refer-macros [fn-traced defn-traced]]
to my handlers.cljs file as :require
and then use either of the macros, figwheel fails to compile with Could not Analyze ... Analysis Error
targeted at the first use of the macro.
If I instead add [day8.re-frame.tracing :refer [fn-traced defn-traced]]
to in :require-macros
, figwheel will compile the code, but I get a bunch of warnings and the app throws errors when I try to load it in the browser
WARNING: Use of undeclared Var day8.re-frame.tracing/is-trace-enabled? at line 39 src/st/handlers.cljs
WARNING: No such namespace: debux.dbgn, could not locate debux/dbgn.cljs, debux/dbgn.cljc, or JavaScript source providing "debux.dbgn" at line 39 src/st/handlers.cljs
WARNING: Use of undeclared Var debux.dbgn/dbgn at line 39 src/st/handlers.cljs
Successfully compiled "target/cljsbuild/public/js/app.js" in 71.553 seconds.
Any idea what I'm doing wrong?In case anyone runs into a similar problem to what I outlined above, after some digging it appears that any kind of frequent tracing or polling wreaks havoc on re-frame-10x and makes it unusable (I also tried and event based approach using :dispatch-later
with similar results). Unfortunately the trace/event filtering in re-frame-10x appears broken. Using core.async helped side-step the tracing altogether.
is there an example for client-side routing with permission checks that i could follow? i've been trying to roll my own but i keep messing it up
the flow i'm trying to has login / remember me functionality with remote authentication, and when a user accesses some routes it should be checked whether they are logged in or not. at the moment i have a race condition between the remember me functionality and setting credentials in the router / permission checks. i've looked into async-flow-fx but it doesn't feel right
i'm getting warnings no handler registered for effect "event"
in my console. what should i make of that?
Sounds like you might have a line of code somewhere that calls (re-frame.core/dispatch [event])
?
Actually now that I look again (and have had a bit more coffee), that’s saying no handler registered for effect, so something is trying to get an effect handler for the value event
so maybe a reg-event-fx
handler somewhere is returning {:db (some-db-value) event [:some-event]}
instead of {:db (some-db-value) :dispatch [:some-event]}
?
I can't get routing working, namely the ability to make figwheel dev server to serve routes from my re-frame app. I found this repo https://github.com/quangv/re-frame-html5-routing checked it out and it works as expected, you go to any route and it runs index.html which starts the SPA, however, it uses bidi & pushy, I use secretary & accountant, will it make difference/work if I switch to bidi & pushy? Or it is something else in my project.clj? I added :ring-handler
and dev_server.clj
as in the example project, do I have to add something else?
@armikhalev https://github.com/quangv/re-frame-html5-routing/blob/master/src/clj/my_app/dev_server.clj
yeah, I have that in my app. Also, I'm using it with Spacemacs, maybe Cider messes up something?
my project based on https://github.com/Day8/re-frame-template
if you mean :ring-handler
option, then yes, it is :ring-handler my-app.dev-server/handler
in fact you can ignore all the other stuff in that server and just return the index.html
🎉it works! @bhauman thank you for help! So basically I just misspelled the namespace, stupid mistake, but the good thing, that this same approach works with secratary/accountant if any newcomers like me wonder if there is any difference
what might be the best way to capture a re_frame db state before / after an error occurs? i was thinking an interceptor that just always maintains a ref to the current db - 1
, and on error serialize both before/after db states. this also sounds like something that might already exist?
I have re-frame-10x working, but for the Event part. I've described trying to plug in the re-frame-debux to get the Event portion working. Is anyone using the Event tracing successfully?
@lwhorton I have been using console log stmts inside event handlers to introspect. That said, re-frame-10x does let you inspect the app-db in the browser and can show you the diff between two "Epochs" ie periods of events.
Is anybody here using datascript with re-frame? Via which library (I am currently reading the documentation of re-posh
)? Is it a good experience as a dev or does it create problems?
About a year ago I wanted to use it in my project, but it turned out that datascript was about 10 times slower than using multiple get-in
. In the end, I used a heavily modified version of subgraph.
10 times is huge! Did you happen to find out why it was so slow?
Not that huge if you make a small number of queries. 🙂 In my case, there was a decent amount, so using datascript would result in tens to hundreds of lost milliseconds. You should check issues on their GitHub page - there were discussions about performance issues.
@vincent.cantin, ditto on the performance limitations with datascript, and also ended up building ontop of subgraph. The flexibility of having normalized data with pull semantics, but still having your db be an associative structure is huge.
I did not know subgraph, will consider it. Thx!
@vincent.cantin i hesitate to use it. as awesome as it would be to have auto-normalized data in a datalog-backed query engine… sometimes its just too much effort to go against the flow