This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-30
Channels
- # announcements (14)
- # aws (2)
- # beginners (167)
- # calva (25)
- # cider (124)
- # cljs-dev (2)
- # cljsrn (7)
- # clojars (2)
- # clojure (113)
- # clojure-europe (2)
- # clojure-italy (6)
- # clojure-spec (30)
- # clojure-uk (90)
- # clojurescript (20)
- # code-reviews (16)
- # cursive (28)
- # data-science (2)
- # datomic (89)
- # duct (97)
- # emacs (4)
- # figwheel-main (12)
- # fulcro (37)
- # graphql (3)
- # java (3)
- # jobs (2)
- # juxt (3)
- # kaocha (37)
- # leiningen (2)
- # luminus (2)
- # off-topic (30)
- # onyx (2)
- # pathom (3)
- # qlkit (1)
- # re-frame (7)
- # reagent (2)
- # reitit (62)
- # remote-jobs (9)
- # shadow-cljs (26)
- # tools-deps (19)
- # vim (1)
- # yada (8)
Hey all, I'm trying to do some general profiling to find bottlenecks in a shadow-cljs node app. Ideally I'd like to just flip a flag when testing and get a report. I've fiddled with a number of inbuilt nodejs profiling options, but they're all too low-level or don't use my source maps or what have you. I found tufte, which is kind of nice, but I'd rather not whitelist forms for my current purposes, and I got lots of errors when I added it to my project. Is there a good way to do this? Alternatively, is there a way to crawl a namespace and wrap functions defined there with my own profiling code?
you can run your node script with node --inspect-brk your-script.js
and open
. that'll let you use the chrome devtools to profile stuff. maybe that helps?
@jstaab I had something similar going in a clj project for walking a ns and instrumenting fns for https://github.com/xsc/iapetos
not sure if useful https://gist.github.com/rboyd/de554c7cdc977cc827a19a071c297ad4
@rboyd have I read correctly that that implementation relies on alter-var-root
to do the instrumentation? I don't believe that lives in clojurescript
(defmacro instrument-ns! [ns-sym]
`(doseq [[k# v#] (ns-publics '~ns-sym)]
(set! (symbol '~ns-sym k#) :whatever)))
I imagine it's because I'm doing this dynamically, and I'm not in macroland at the point I call set!, but I'm not sure how to get my ns-publics result from clojure, since if I call it outside the syntax quote it says the namespace doesn't exist
Hello everybody! Why are type functions different for Clojure and ClojureScript? Why does ClojureScript type doesn't support the :type meta? Clojure type
(defn type
"Returns the :type metadata of x, or its Class if none"
{:added "1.0"
:static true}
[x]
(or (get (meta x) :type) (class x)))
Clojurescript type
(defn type
"Return x's constructor."
[x]
(when-not (nil? x)
(.-constructor x)))
Does anyone know a ClojureScript app that can be used to teach beginners?
This one's a classic https://github.com/bhauman/flappy-bird-demo-new and showcases the awesomeness of hot-code reloading at the repl
But there are a whole host of "learning modules" that run on https://www.maria.cloud/ if you open the side panel on the left. Mostly about learning clojure in general, but runs on a self-hosted clojurescript instance right in the browser.
this was a cool site: https://www.learnreagent.com/
Thanks!