Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work around react/createElement dynamic arity dispatch
I have an interesting problem here, I require react as an npm module. I have a macro which emits `react/createElement`. I cannot do that in my macro because compiler complains (I guess due to that “react” is not normal namespace, it is coming from npm, with normal namespaces this normally works). When I create some alias `(def my-create-element react/createElement)` and emit `my-ns/my-create-element` instead. All works, but release build suffers from generating dynamic arity dispatch. Even if I specify explicit fixed arity `(defn my-create-element [x] (react/createElement x))` it does not get inlined in advanced mode (verified with --pseudo-names). Any ideas, how could I reference react/createElement in my macro directly? `js/React.createElement` does not work. “React” is not avail at runtime due to way how shadow isolates npm modules (?)
- Loading branch information