mihaip/react-closure-compiler

Better solution to needing to quote property names in minified React

mihaip opened this issue · 3 comments

The workaround done by 1ac9113 (where the minified version of React is edited by hand in order to put back some object literals) is rather gross.

Ideally there would be a way of generating an alternate minified version of React where the quotes are left in (and in general most minification steps can be skipped, since the Closure Compiler will do them too -- main thing to do is to do the __DEV__ replacement so that the build runs in production mode).

Maybe we (React) can publish a version that runs in prod mode but is unminified.

cc @sebmarkbage who's been thinking about using Closure Compiler for React.

My goal is that we always minify React with Closure Compiler but also generate a result that is compatible with another pass. This requires us to change patterns in a few places. For example, avoiding to use objects as Maps and instead use a proper Map abstraction.

I think we need the infrastructure to run tests to ensure that neither of these passes break. E.g. by running our Travis tests both before and after Closure Compiler minification.

Obsolete given the dropping of Closure Compiler advanced optimizations support altogether in 15.4. Should be revisited if facebook/react#11092 is reopened.