This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-15
Channels
- # ai (35)
- # announcements (3)
- # babashka (16)
- # babashka-sci-dev (2)
- # beginners (37)
- # biff (16)
- # calva (5)
- # cider (2)
- # clj-commons (81)
- # clj-kondo (29)
- # cljfx (2)
- # cljs-dev (4)
- # clojars (4)
- # clojure (92)
- # clojure-europe (72)
- # clojure-losangeles (8)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (1)
- # clojurescript (20)
- # clojutre (2)
- # conjure (2)
- # data-science (18)
- # datomic (1)
- # emacs (10)
- # fulcro (49)
- # joyride (1)
- # kaocha (23)
- # leiningen (8)
- # lsp (14)
- # meander (5)
- # off-topic (93)
- # polylith (4)
- # re-frame (20)
- # reagent (9)
- # reitit (2)
- # remote-jobs (8)
- # sci (1)
- # shadow-cljs (21)
- # testing (3)
- # vim (27)
- # xtdb (35)
Does anyone have suggestions for performance profiling tools? Is it, for example, possible to load cljs source maps in the Chrome Performance tab? So we can see more clearly what cljs functions are being called?
Also with re-frisk tracing on we can see reasonably clearly what evens take what time, but maybe there are better ways I am missing.
re-frame-10x has some timings as well. But your browser's profiling is the most fine-grained solution possible. And yes, source maps should work there if they work in the Sources tab.
ah thanks
They don’t work in Sources tab so have to configure those properly locally
The app.js.map is available when I navigate to the URL, but it does not show up in Sources, only app.js does 😕 any idea?
we use shadow-cljs, and the end of the file app.js has
//# sourceMappingURL=app.js.map
the app.js.map file does exist as well
we do add a “cache buster” at the end of the file in index.html
<script src="/js/compiled/app.js?version=COMMIT_HASH"></script>
but in sources this app.js.map is just not visible
(sources tab)
Do you have source maps enabled in the browser?
Is the source map accessible via the /js/compiled/app.js.map
URL?
Yes and yes
I'm doing some unit testing for my re-frame app, and I'm following the examples here: https://github.com/day8/re-frame-test#how-it-works However, when I run my tests, I get a load of warnings like this in the console:
re-frame: Subscribe was called outside of a reactive context.
See:
Digging into the re-frame and reagent code, I have found that I can suppress this warning by wrapping the test body in a reagent.ratom/check-derefs
call like this:
(deftest init
(rf-test/run-test-sync
(reagent.ratom/check-derefs
(fn []
(let [showing (rf/subscribe [:showing])]
(is (= :all @showing)))))))
This looks pretty ugly. Is there a better way?Are you running inside the run-test-sync
macro?