Commit Graph
5265 Commits
Author SHA1 Message Date
Andreas Savvides e04602f8ee Use same type of markdown as everywhere else for Glossary 2015-09-14 18:55:34 +01:00
Andreas Savvides 3c5a91c3c3 Make it easier to create an issue 2015-09-14 18:45:29 +01:00
Andreas Savvides c207ab2901 Make "Component Specs and Lifecycle" more readable 2015-09-14 18:43:16 +01:00
Andreas Savvides f98112f24d Make "Component API" more readable 2015-09-14 18:23:00 +01:00
Steven Luscher 15b57b1658 Merge pull request #4845 from steveluscher/community-roundup-27-relay-edition
Community Roundup #27 – Relay Edition
2015-09-14 08:14:43 -07:00
Steven Luscher f30b0d1f1c Community Roundup #27 – Relay Edition 2015-09-13 21:26:34 -07:00
Paul O’Shannessy 0cc8af37c3 Merge pull request #4861 from zpao/symbol-test-node4
Better simulate Symbol-less environment
2015-09-13 13:55:26 -07:00
Paul O’Shannessy d54fa9e563 Better simulate Symbol-less environment
This ensures that our tests expecting Symbol not to exist pass.
2015-09-13 13:15:26 -07:00
Jim 2fcf54939b Merge pull request #4855 from iamchenxin/master
Maintain why-react-zh-CN sync to the current why-react
2015-09-12 08:57:31 -07:00
iamchenxin d92f4782ac Update translation for jsx-in-depth-zh-CN 2015-09-12 18:09:58 +08:00
iamchenxin 787b49ae78 Maintain why-react-zh-CN sync to the current why-react 2015-09-12 16:29:46 +08:00
Paul O’Shannessy ed11f83763 Merge pull request #4833 from youngminz/master
Update Korean translation
2015-09-10 16:25:58 -07:00
Paul O’Shannessy c6ecda7503 Merge pull request #4802 from 8398a7/patch-1
Update Japanese translation to 75fafe1
2015-09-10 15:35:06 -07:00
839 852753c13a Update Japanese translation to 75fafe1 2015-09-10 15:33:34 -07:00
Ben Alpert 4b3b56f36a Add Babel version to blog post 2015-09-10 13:28:46 -07:00
Ben Alpert 04e5ee70cc Merge pull request #4797 from spicyj/rc14blog
0.14 RC blog post
2015-09-10 09:50:56 -07:00
Ben Alpert 5bf56134be 0.14 RC blog post 2015-09-10 09:21:56 -07:00
Ben Alpert 4a4174b9e8 0.14.0-rc1 v0.14.0-rc1 2015-09-10 08:47:40 -07:00
Ben Alpert 21a1f7e6fd Don't copy JSXTransformer in grunt release 2015-09-10 08:47:40 -07:00
Paul O’Shannessy 31f25255b9 Stop building JSXTransformer
Pick of/closes #4148.
2015-09-10 08:45:04 -07:00
Koo Youngmin 2ae036123c Update Korean translation 2015-09-10 16:47:15 +09:00
Sebastian Markbåge 7a00239b1f Merge pull request #4832 from sebmarkbage/xssfix
Use a Symbol to tag every ReactElement
2015-09-09 23:19:33 -07:00
Sebastian Markbage 031fc24dae Use a Symbol to tag every ReactElement
Fixes #3473

I tag each React element with `$$typeof: Symbol.for('react.element')`. We need
this to be able to safely distinguish these from plain objects that might have
come from user provided JSON.

The idiomatic JavaScript way of tagging an object is for it to inherent some
prototype and then use `instanceof` to test for it.

However, this has limitations since it doesn't work with value types which
require `typeof` checks. They also don't work across realms. Which is why there
are alternative tag checks like `Array.isArray` or the `toStringTag`. Another
problem is that different instances of React that might have been created not knowing about eachother. npm tends to make this kind of problem occur a lot.

Additionally, it is our hope that ReactElement will one day be specified in
terms of a "Value Type" style record instead of a plain Object.

This Value Types proposal by @nikomatsakis is currently on hold but does satisfy all these requirements:

https://github.com/nikomatsakis/typed-objects-explainer/blob/master/valuetypes.md#the-typeof-operator

Additionally, there is already a system for coordinating tags across module
systems and even realms in ES6. Namely using `Symbol.for`.

Currently these objects are not able to transfer between Workers but there is
nothing preventing that from being possible in the future. You could imagine
even `Symbol.for` working across Worker boundaries. You could also build a
system that coordinates Symbols and Value Types from server to client or through
serialized forms. That's beyond the scope of React itself, and if it was built
it seems like it would belong with the `Symbol` system. A system could override
the `Symbol.for('react.element')` to return a plain yet
cryptographically random or unique number. That would allow ReactElements to
pass through JSON without risking the XSS issue.

The fallback solution is a plain well-known number. This makes it unsafe with
regard to the XSS issue described in #3473. We could have used a much more
convoluted solution to protect against JSON specifically but that would require
some kind of significant coordination, or change the check to do a
`typeof element.$$typeof === 'function'` check which would not make it unique to
React. It seems cleaner to just use a fixed number since the protection is just
a secondary layer anyway. I'm not sure if this is the right tradeoff.

In short, if you want the XSS protection, use a proper Symbol polyfill.

Finally, the reason for calling it `$$typeof` is to avoid confusion with `.type`
and the use case is to add a tag that the `typeof` operator would refer to.
I would use `@@typeof` but that seems to deopt in JSC. I also don't use
`__typeof` because this is more than a framework private. It should really be
part of the polyfilling layer.
2015-09-09 23:19:00 -07:00
Ben Alpert a05691f0ad Merge pull request #4747 from spicyj/gh-1939
Don't crash in event handling when mixing React copies
2015-09-09 22:10:19 -07:00
Ben Alpert dc2570e1ce Merge pull request #4825 from spicyj/gh-2770
Preserve DOM node when updating empty component
2015-09-09 22:09:34 -07:00
Ben Alpert 14ede77123 Merge pull request #4827 from spicyj/occured
occured -> occurred
2015-09-09 16:29:43 -07:00
Ben Alpert 0b857a473a occured -> occurred 2015-09-09 16:19:40 -07:00
Ben Alpert db589a7175 Preserve DOM node when updating empty component
Fixes #2770.
2015-09-09 14:00:59 -07:00
Ben Alpert 999b0f9b3e Refactor empty component handling
Now doesn't use ReactCompositeComponent and `._currentElement` is actually null/false.
2015-09-09 14:00:58 -07:00
Ben Alpert 3dbdb63a7d Merge pull request #4823 from spicyj/gh-4776
Don't try to iterate over non-objects
2015-09-09 12:55:20 -07:00
Ben Alpert 35b7fe175d Merge pull request #4821 from spicyj/dom-dist
Add react-dom to dist/ in npm package
2015-09-09 12:02:47 -07:00
Paul O’Shannessy 12b6f3d03c Merge pull request #4824 from facebook/prefill-stack-overflow-tag
Pre-fill tag when asking a Stack Overflow question
2015-09-09 11:31:00 -07:00
Steven Luscher 9ca4dd6024 Pre-fill tag when asking a Stack Overflow question 2015-09-09 11:28:14 -07:00
Ben Alpert b004bc5f22 Don't try to iterate over non-objects
Fixes #4776.
2015-09-09 09:03:05 -07:00
Ben Alpert a87c8555fa Merge pull request #4719 from djrodgerspryor/fix_css_transition_group_child_props
Fix transitionName prop-type on CSS transition group child

Closes #4719.
2015-09-09 08:35:44 -07:00
Ben Alpert 324bec17e3 Fix up style in #4719 2015-09-09 08:35:04 -07:00
Ben Alpert 0cce198c28 Merge pull request #4796 from spicyj/lazy-node
Fetch DOM node lazily for updates
2015-09-09 08:29:56 -07:00
Ben Alpert cdd8096974 Add react-dom to dist/ in npm package 2015-09-09 07:58:28 -07:00
Daniel Rodgers-Pryor 91555f6f9e Fix name prop-type on CSS transition group child
And share it with the parent. There's now a test for varying class names by transition-type.
2015-09-09 23:21:15 +10:00
Paul O’Shannessy 6eda65209a Merge pull request #4818 from gdi2290/patch-1
Fix typo combatibility => compatibility
2015-09-09 00:52:19 -07:00
PatrickJS ab0c84f53f Fix typo combatibility => compatibility 2015-09-09 00:47:01 -07:00
Paul O’Shannessy 77703dbb80 Merge pull request #4724 from AnSavvides/test-util-readability
Make definitions more readable & optional params more obvious
2015-09-09 00:02:18 -07:00
Paul O’Shannessy 011c2a2e07 Merge pull request #4793 from edvinerikson/document-svg-attributes
[docs] Updated SVG attributes
2015-09-08 23:24:54 -07:00
Paul O’Shannessy 2f1b08347c Fix lint warning in react-dom codemod 2015-09-08 23:06:25 -07:00
Paul O’Shannessy b5b74c5f22 Fix travis cURL call 2015-09-08 22:56:59 -07:00
Paul O’Shannessy 69ab7145bc Merge pull request #4814 from zpao/build-react-dom-browser-2
Build react dom browser 2
2015-09-08 22:33:08 -07:00
Paul O’Shannessy 3e672017a7 Upload new build files to build server 2015-09-08 22:18:45 -07:00
Paul O’Shannessy 353a01cf5e Add react-dom to bower when releasing 2015-09-08 22:18:44 -07:00
Paul O’Shannessy b2ca3349c2 Actually build react-dom file with the build 2015-09-08 22:18:44 -07:00
Paul O’Shannessy 135c554b23 Move headers to shared location, use grunt templates 2015-09-08 22:00:05 -07:00