facebook/react — pull request #714 by syranide (2013-12-26 00:27:25+00:00)
Title: Escape component keys used in reactid

Fix for https://github.com/facebook/react/issues/647

Apply a simple escaping mechanism to prevent any conflicts with `reactid`, allows the user to use any string as `key`. The escaping character is chosen pretty much at random, my only idea being that it should be as uncommon as possible while still being humanly readable. I chose *not* to escape `{}[]` because they shouldn't actually cause any conflicts (the reactid will just look weird).

```
raw gz Compared to last run
= = build/JSXTransformer.js
= = build/isFeatureSupported.js
= = build/react-test.js
+377 +132 build/react-with-addons.js
+97 +52 build/react-with-addons.min.js
+377 +136 build/react.js
+97 +60 build/react.min.js
```

It's also possible to inline the escape-function to bring it down to (not provided in this PR):

```
raw gz Compared to last run
= = build/JSXTransformer.js
= = build/isFeatureSupported.js
= = build/react-test.js
+192 +80 build/react-with-addons.js
+86 +43 build/react-with-addons.min.js
+192 +81 build/react.js
+86 +47 build/react.min.js
```