Skip to content

Commit

Permalink
Quote some object literal keys in minified version of React.
Browse files Browse the repository at this point in the history
The original React source has a few object literals where it expects the key
names to not get renamed. The source has the property names quoted, which
has the correct effect of indicating to the Closure Compiler to not do renaming
(see for example https://github.com/facebook/react/blob/0de20e35bc3a9a2356b047fa7fd2d2f79067b8d5/src/browser/ui/ReactDOMComponent.js#L41).
However, the minified versions of React do not have these quotes, presumably
because the minifier decided that they were unncessary.

It's perhaps a bad idea to use the minified version of React as an input to the
Closure Compiler, but since it has other desirable properties (smaller code size
since all runtime warnings and propType checking is disabled), adding the quotes
back is necessary to avoid bugs due to property name lookups failing
mysteriously.
  • Loading branch information
mihaip committed May 11, 2015
1 parent 1275cb4 commit 1ac9113
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion demo/plovr-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "demo",
"paths": ".",
"inputs": [
"react-0.13.1-build/react-with-addons.js",
"react-0.13.1-build/react.js",
"index.js"
],
"mode": "ADVANCED",
Expand Down
Loading

0 comments on commit 1ac9113

Please sign in to comment.