This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-03
Channels
- # beginners (111)
- # boot (1)
- # braveandtrue (4)
- # calva (2)
- # cider (16)
- # clara (35)
- # cljdoc (4)
- # cljs-dev (22)
- # clojure (80)
- # clojure-dev (17)
- # clojure-europe (3)
- # clojure-italy (57)
- # clojure-japan (1)
- # clojure-nl (4)
- # clojure-serbia (1)
- # clojure-spec (25)
- # clojure-uk (108)
- # clojurescript (67)
- # cursive (17)
- # data-science (5)
- # datascript (6)
- # datomic (6)
- # devcards (1)
- # events (1)
- # expound (13)
- # figwheel (2)
- # figwheel-main (6)
- # fulcro (7)
- # jobs-discuss (8)
- # kaocha (1)
- # luminus (3)
- # nrepl (6)
- # off-topic (58)
- # re-frame (1)
- # reitit (16)
- # remote-jobs (1)
- # ring (1)
- # shadow-cljs (70)
- # spacemacs (10)
- # sql (42)
- # testing (1)
- # tools-deps (8)
- # vim (1)
Hello all... I’m writing something up about creating JavaScript objects/literals in ClojureScript, and explaining the latest stuff I added to js-interop. I try to cover the #js
tag and js-obj
; not sure if I have missing anything, feedback would be welcome: https://www.maria.cloud/gist/9a8bf3d923a856ba222adccc2f737fbf?eval=true
"and informal benchmarks in the Chrome console would indicate that creating a blank object and then setting properties on it costs about the same as creating a literal object with the same properties"
yeah, I would be interested in seeing if other people get different results. What I was seeing was so similar that I wondered if both forms were being handled the same way by v8.
One thing you could maybe do is introduce the reader to the general issues and confusion that surrounds name munging and advanced compile. js-interop is really helping us out in making that all easier to deal with, but novices probably don't even have a solid understanding of what the problem is and why js keys do one thing sometimes and another thing other times.
But that' may be too verbose of a tangent. The follow-along-with-code-examples is working well.
i am doing some simple tests on https://closure-compiler.appspot.com and finding that even in simple mode, closure re-writes the “create blank object +then add properties” into literals
the tests I did in Chrome / http://jsperf.com didn’t go through the closure compiler, but it wouldn’t be surprising if v8 does essentially the same
Hey… I submitted my first cljs patch: https://dev.clojure.org/jira/browse/CLJS-3075 - I think I followed procedure correctly. I took the liberty of assigning to @mfikes because he was the one who reviewed changes I made to https://clojurescript.org/community/running-tests which references the script I updated.
Thank you @mfikes! I have been watching you and your friends on Apropos Clojure on youtube. Great stuff!
I don’t mean to pester you… but I also do have a related doc change to the one I made the other day… https://github.com/clojure/clojurescript-site/pull/313