This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-24
Channels
- # architecture (4)
- # aws (1)
- # beginners (76)
- # boot (172)
- # cider (17)
- # cljs-dev (10)
- # cljs-experience (24)
- # cljsrn (45)
- # clojure (129)
- # clojure-berlin (1)
- # clojure-finland (1)
- # clojure-italy (8)
- # clojure-seattle-old (1)
- # clojure-sg (1)
- # clojure-spec (31)
- # clojure-uk (28)
- # clojurescript (88)
- # cursive (11)
- # data-science (1)
- # datomic (44)
- # fulcro (48)
- # hoplon (5)
- # jobs (3)
- # jobs-discuss (1)
- # leiningen (6)
- # luminus (42)
- # lumo (17)
- # off-topic (9)
- # om (29)
- # onyx (15)
- # pedestal (7)
- # protorepl (20)
- # re-frame (24)
- # reagent (46)
- # ring-swagger (2)
- # specter (2)
- # sql (3)
- # uncomplicate (58)
- # unrepl (29)
- # yada (5)
@stvnmllr2 re-com has a good type ahead component
How would I look at the app-db in the browser. I put it up on amazon, and something isn't working. So need to try to look at it in hopes of figuring something out
maybe it got obfuscated with the uberjar compile? Guess i can put something in to print it out on the screen
@mikethompson thanks for the tips
@stvnmllr2 https://github.com/Day8/re-frame/blob/master/docs/FAQs/Inspecting-app-db.md
my guess is that the the re-frame ns is munged from advanced compiling. Don't know how I'd go about inspecting the db then. Maybe someone else knows?
@roosta Seemed the advanced compile broke some other stuff. So guessing I need to add some more js to externs?
@stvnmllr2 if you're using external js libraries probably. You could look into extern inference to save you some trouble but that has its own pitfalls. Theres a lot of info about this on the http://clojurescript.org webpage. A place to start could be here: https://clojurescript.org/reference/dependencies
yeah. I had a few js files in my proj, so had to add those. Don't understand all the details on that page, but will eventually read it and try to grok it
its a lot to take in, i've been coding clojurescript for a while now and it still trips me up
I'm having one of those "I know it's my bug, but I don't know where to look" moments. I have a reg-sub-raw that occasionally gets into an infinite (or very long?) loop of being called; more than once per second. What's really strange is that this only seems to happen (I think) when Figwheel causes the page to reload. It then continues until I click on a button, triggering events etc. After that, it behaves fine. Judging by the speed of the loop, I assume this is some variation of my code touching something that causes reagent to refresh. But, I'm not really sure how to debug this, especially given the apparent figwheel interaction. I'm currently refactoring/cleaning all the code around this, so I may find the problem. But, I'm feeling kind of stuck, so any hints would be VERY welcome. Here's the key function in my code:
(defonce local-id-num (atom 0))
(defn local-id [path]
(str "ID-" (swap! local-id-num inc) "-" path))
(defn firebase-on-value-sub [app-db [_ path]]
(let [ref (fb-ref path)
id (local-id path) ;;; ID to disambiguate multiple watches on same
;;; node. (Firebase uses the handler to do this,
;;; which we could use too. But, this is better
;;; for debugging, at very little cost)
callback #(>evt [::on-value-handler id (js->clj-tree %)])]
(.on ref "value" callback #(js/alert %))
(rv/make-reaction
(fn [] (get-in @app-db [::cache id] []))
:on-dispose #(do (.off ref "value" callback)
(>evt [::on-value-handler id nil])))))
(re-frame/reg-sub-raw :firebase/on-value firebase-on-value-sub)
@stvnmllr2 when trying to figure out problems to do with advanced compilation, be sure to use :pseudo-names true
and :print-input-delimiter true
and :pretty-print true
@deg you can try using re-frame-trace to debug this
It's still alpha but I think would be very helpful for this kind of situation