This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-03
Channels
- # aws (1)
- # bangalore-clj (3)
- # beginners (3)
- # boot (9)
- # business (1)
- # cljs-dev (72)
- # cljsjs (7)
- # clojure (86)
- # clojure-austin (1)
- # clojure-belgium (4)
- # clojure-brasil (14)
- # clojure-conj (3)
- # clojure-dev (10)
- # clojure-italy (4)
- # clojure-poland (14)
- # clojure-russia (36)
- # clojure-spec (144)
- # clojure-uk (50)
- # clojurebridge (1)
- # clojurescript (160)
- # clr (2)
- # core-async (8)
- # cursive (56)
- # datomic (34)
- # devcards (3)
- # emacs (2)
- # ethereum (1)
- # events (3)
- # hoplon (21)
- # jobs (2)
- # leiningen (9)
- # luminus (3)
- # off-topic (1)
- # om (26)
- # onyx (42)
- # pedestal (29)
- # protorepl (1)
- # re-frame (43)
- # reagent (26)
- # rethinkdb (4)
- # ring-swagger (4)
- # spacemacs (5)
- # specter (4)
- # untangled (102)
- # vim (43)
- # yada (10)
@anmonteiro @dnolen Did you test circle-color advanced build with older versions of Cljs? I'm seeing Closure error + empty output with 1.7.145 and 1.9.229
@juhoteperi definitely Closure error with 1.7.145
only warnings with your patch
@juhoteperi I get output with your patch applied, but it doesn’t work
Yes, Closure has changed "constant module$resources$public$js$libs$react assigned a value more than once." from error to warning
exactly
but the app doesn’t really work even with externs
Oops, I had typo on externs option
Yep, seeing quarter of circle now
@juhoteperi that and the input doesn’t work
it’s what we both had
Problem with input change is very clear, and is caused by the cljs source
(. this -handleColorChange)
this handleColorChange custom method is introduced by cljs code, and not included in externs so calls get rewriten
right that makes sense
cx
and cy
properties on circle
svg component get renamed to ak
and bk
(or something like that)
other properties work as they are included in some externs
Processed Circle.js: React$$module$resources$public$js$libs$Circle.createElement("circle", {cx:"100px", cy:"100px", r:"100px", fill:this.props.color})
Optimized: ta.createElement("circle", {ak:"100px", bk:"100px", r:"100px", fill:this.props.color})
Is there anything that can be done about this? Other than to add those properties to extern file?
@juhoteperi: oh because those are props and JSX doesn’t compile to object literals with string properties
I checked and looks like JSX transform tool doesn't have option to output string properties
Hmm, I don't see specific svg extern file at Closure repo
Works with that extern file
React probably passes those properties as is to DOM
wow, great news
hmm? #js
emits string properties
But optimizing #js
wouldn't work with anything that is outside of Closure, like browser built-in JS
@juhoteperi I’m not suggesting breaking #js
I’m just pointing out that this means for React stuff we just want to emit literals w/o strings
We use #js for struct-like things but google closure tooling really wants struct to be literals and dict to be strings
ok - @juhoteperi anyways fantastic stuff - I poked around your patch and I couldn’t really think of anything specific
Great. I'll work through FIXME notes and maybe tune the test.
@juhoteperi is there something about your patch that you feel doesn’t fall into this assessment?
actually now that I think about it, to emit a literal js record (instead of a={};a.prop1=...
) from cljs side, need a compiler primitive or at least a js*. Also need new JSValue-like wrapper on the clojure side if clojure macros want to emit the same.
that might get confusing. I run into it when I need to pass js value to other adv-compiled js from cljs