^js can effectively be used instead of ^js/React.Element. The extra type info is for readability, but shadow-cljs for example actually throws it away. I think Closure conservatively refuses to mangle recognized property names regardless of the object type.
Looking at both cljs and shadow-cljs codebases, here’s how the ^js tag affects externs. I’ll probably put this on cljs api site soon since there’s much confusion about what actually happens:
question came up here: https://github.com/lilactown/helix/pull/104#discussion_r955408172
discussed with @thheller here: https://clojurians.slack.com/archives/C03S1L9DN/p1664298527478269
^js
can effectively be used instead of^js/React.Element
. The extra type info is for readability, but shadow-cljs for example actually throws it away. I think Closure conservatively refuses to mangle recognized property names regardless of the object type.Looking at both cljs and shadow-cljs codebases, here’s how the
^js
tag affects externs. I’ll probably put this on cljs api site soon since there’s much confusion about what actually happens:^js
=>Object.*
ShadowJS.prototype.*
^js/React.Element
=>React.Element.prototype.*
ShadowJS.prototype.*