Commit Graph

6886 Commits

Author SHA1 Message Date
Greg Palmer 08dbefedc7 Avoid "Member not found" error in IE (#7411)
Explanation, discussion, and similar change as #7343

Addresses #7320
(cherry picked from commit a8741963dc)
2016-09-15 16:32:45 -07:00
Ben Alpert 4be377650e Improve validateDOMNesting message for whitespace (#7515)
For #5071.
(cherry picked from commit 6a65960641)
2016-09-15 16:32:45 -07:00
Paul O’Shannessy 8898803b4a Merge remote-tracking branch 'upstream/15-stable' into 15-dev 2016-09-15 16:31:58 -07:00
Kite 21f71d72f0 Fix the HTML for package management (#7656)
(cherry picked from commit ed8a753346)
2016-09-06 15:35:57 -07:00
却痕 d79061e0c6 docs:translate doc 11-advanced-performance to chinese (#7584)
(cherry picked from commit 4c365ea957)
2016-09-06 15:35:57 -07:00
Michael Jackson d951c560e4 s/npmcdn/unpkg/g (#7609)
npmcdn.com is moving to unpkg.com. Same backend, one less letter in the
domain name. Boom.
(cherry picked from commit 9fd42264fe)
2016-09-06 15:35:57 -07:00
Duke Pham 6cf782b75c Add line breaks to examples on 10.1-animation docs per (#7606)
comments to issue #7317.
Updated JP doc examples to match other languages
Reformat to match JSX multi-line style #7550
(cherry picked from commit 3071f31d04)
2016-09-06 15:35:57 -07:00
Robert Kielty dca0f7315c Adds minor additions clarifying questions I had reading intro tutorial (#7595)
(cherry picked from commit ee199381de)
2016-09-06 15:35:57 -07:00
Nik Nyby 0983d2dbcf docs: re-position comments to account for code sample width (#7602)
(cherry picked from commit 9511b4fe29)
2016-09-06 15:35:57 -07:00
Christophe Hurpeau d90cbec236 doc: npm ls react is a better advice (#7513)
Refs Must Have Owner Warning
`npm ls react` is a better advice than `npm ls | grep react`
(cherry picked from commit 517a0dc051)
2016-09-06 15:35:57 -07:00
NestorTejero 6e20d410bb add explicit link to http://bower.io/ (#7546)
(cherry picked from commit 32e60fecdc)
2016-09-06 15:35:56 -07:00
Dan Abramov b4f6460bff Link to Create React App (#7654)
* Link to Create React App

* Reword
2016-09-03 18:14:00 +01:00
Paul O’Shannessy 199056cf1b Update website for 15.3.1 2016-08-19 11:46:11 -07:00
Paul O’Shannessy 681c68c62a 15.3.1 v15.3.1 2016-08-19 11:42:05 -07:00
Paul O’Shannessy cc41ec258f Update readme for 15.3.1 2016-08-19 11:41:29 -07:00
Paul O’Shannessy 3c0906ca24 Update changelog for 15.3.1 2016-08-19 11:40:07 -07:00
Paul O’Shannessy 60a3655469 Merge branch '15-dev' into 15-stable 2016-08-19 11:39:36 -07:00
Paul O’Shannessy 15df676d2e Update deps and re-shrinkwrap 2016-08-19 11:24:43 -07:00
Paul O’Shannessy e5276bbbe7 regenerate error codes 2016-08-19 10:49:42 -07:00
Paul O’Shannessy 12ab5baff4 Upgrade to fbjs v0.8.4 (#7532)
(cherry picked from commit 944be18357)
2016-08-19 10:46:22 -07:00
Alexandre Kirszenberg f120c1b78e Fix ReactTestInstance::toJSON() with empty top-level components (#7523)
(cherry picked from commit 9f5b009f05)
2016-08-19 10:45:06 -07:00
ventuno 421bb8c53a Warn if using React.unmountComponentAtNode on a different React instance's tree. (#7456)
* Warn when using React.unmountComponentAtNode on a different React instance's tree

https://github.com/facebook/react/issues/3787

* Adding tests.

* Implementing recommended changes.

https://github.com/facebook/react/issues/3787

(cherry picked from commit a9e681a828)
2016-08-19 10:45:06 -07:00
Ben Alpert 9fea8ec6c8 Update onlyChild invariant message (#7514)
(cherry picked from commit 921d8c151b)
2016-08-19 10:45:06 -07:00
Dan Abramov 536f826b56 Fix slow performance of PropTypes.oneOfType() on misses (#7510)
It used to be slow whenever a type miss occurred because expensive `Error` objects were being created. For example, with `oneOfType([number, data])`, passing a date would create an `Error` object in `number` typechecker for every item.

The savings depend on how much commonly you used `oneOfType()`, and how often it had “misses”. If you used it heavily, you might see 1.5x to 2x performance improvements in `__DEV__` after this fix.
(cherry picked from commit 680685bec4)
2016-08-19 10:44:58 -07:00
Alex Zherdev 307b4ebcc9 Fix header link generation for non-English docs (#7497)
(cherry picked from commit 11c0adcc95)
2016-08-19 10:41:20 -07:00
龙海燕 e1a9eb13b1 Update 09.2-package-management.md (#7520)
(cherry picked from commit db6f36bdce)
2016-08-19 10:41:20 -07:00
Jess Telford 51fe7e466e React.Children.toArray() changes keys (#7495)
As noted by @spicyj in #5541
(cherry picked from commit aa48c82b0d)
2016-08-19 10:41:19 -07:00
Tanase Hagi 8403a28adc Add propsTypes and defaultProps example for stateless functions (#7458)
* Add propsTypes and defaultProps example for stateless functions

* Update 05-reusable-components.md

* Update 05-reusable-components.md

(cherry picked from commit 09f0a06b8a)
2016-08-19 10:41:19 -07:00
Robert Martin c4f8466d5d Capitalize AJAX (#7435)
(cherry picked from commit 43674d989d)
2016-08-19 10:41:19 -07:00
Robert Chang cc5889c543 change a word in performance docs (#7442)
(cherry picked from commit 0833d89783)
2016-08-19 10:41:19 -07:00
Paul O’Shannessy 9e88467485 15.3.1-rc.2 2016-08-15 15:53:40 -07:00
Troy DeMonbreun bfb3852942 Fix for #7170 (#7486)
* Write failing test

* Ensure .min and .max are set before .value

* Adjusting test for false negative

* Revert test adjustment (apparently it was only failing locally)

(cherry picked from commit 3013afe2d5)
2016-08-15 15:51:55 -07:00
Christopher Chedeau df4356133d Fix flow (#7499)
ReactElement requires a generic argument now and the return function of render is a ReactTestInstance and not a ReactElement.
(cherry picked from commit 9a48b5ca7b)
2016-08-15 15:51:48 -07:00
Dan Abramov 814be45aa8 Avoid indexOf() during unmounting a root in the hook (#7496)
* Avoid indexOf() during unmounting a root in the hook

* Check for (Map|Set).prototype.keys

(cherry picked from commit 48475787b4)
2016-08-15 15:20:26 -07:00
Andres Suarez bab9227e9d Remove last use of mapObject (#7494)
(cherry picked from commit 8d1e416d9a)
2016-08-15 15:20:26 -07:00
Andres Suarez 2f1ce9169d Avoid object iteration when creating DOM factories (#7493)
(cherry picked from commit e5f9ae2705)
2016-08-15 15:20:26 -07:00
Dan Abramov b19f202542 Use ES6 Map in ReactComponentTreeHook if available (#7491)
* Use ES6 Map in ReactComponentTreeHook if available

* Make getRootIDs fast again

* Only use native Map

(cherry picked from commit db452bd20b)
2016-08-15 15:20:26 -07:00
jaaberg 71f12283d9 Fix typo in changelog (#7468)
(cherry picked from commit fdc91e016f)
2016-08-15 15:20:25 -07:00
Dan Abramov 4c5882258c Don't define key or ref dummy props if none were provided (#7488)
* Don't define key or ref dummy props if none were provided

This fixes a performance regression.

* Style nit

(cherry picked from commit a56e105081)
2016-08-15 15:20:25 -07:00
Dan Abramov ce24114a01 Fix ReactComponentTreeHook.getRegisteredIDs() to work with inlined content (#7490)
I broke this in #7463: parseInt() cuts off #text at the end.
Changing to just use negative numbers instead.
(cherry picked from commit a73886456e)
2016-08-15 15:20:25 -07:00
Nathan Hunzaker 8e79c9fd30 Add some semicolons for linting. (#7390)
(cherry picked from commit 8aed0cd67e)
2016-08-15 15:19:58 -07:00
Paul O’Shannessy 5372e66c0c 15.3.1-rc.1 2016-08-12 16:34:14 -07:00
Paul O’Shannessy 94dbf619d3 Regenerate error codes 2016-08-12 16:34:13 -07:00
Dan Abramov 9d7ceac1f3 Remove ReactDOMInstrumentation (#7481)
Its events are not being used anywhere.
(cherry picked from commit cba2b19b84)
2016-08-12 16:02:29 -07:00
Dan Abramov 6a992382a4 Improve DEV performance in Chrome (#7483)
* Ensure this._domID is always a number

* Ensure this._rootNodeID is always a number

(cherry picked from commit 4b734f7a02)
2016-08-12 16:02:29 -07:00
Dan Abramov c93d0c4f30 Consolidate hook events (#7472)
* Remove onBeforeMountComponent hook event

It is unnecessary.
We now pass the element as part of onInstantiateComponent, and it can't change before mounting.

* Remove onComponentHasMounted hook event

It is unused after #7410.

* Replace on(Begin|End)ReconcilerTimer hook events

We already have onBeforeUpdateComponent.
Let's just have on(Before?)(Mount|Update|Unmount)Component and stick with them.

This removes double event dispatches in some hot spots.

* Remove onComponentHasUpdated hook

The tests still pass so presumably it was not necessary.

* Add missing __DEV__ to TestUtils code

* Replace on(InstantiateComponent|SetParent) with onBeforeMountComponent

This lets us further consolidate hooks.
The parent ID is now passed as an argument to onBeforeMountComponent() with the element.

* Remove onMountRootComponent hook event

It is unnecessary now that we pass the parent ID to onBeforeMountComponent.

* Use parentDebugID = 0 both for roots and production

This removes some awkward branching.

(cherry picked from commit 0e976e136c)
2016-08-12 16:02:29 -07:00
Dan Abramov f2010e5532 Remove unnecessary indirection and events from the hooks (#7464)
* Remove unnecessary indirection from the tree hook

* Replace onSetDisplayName, onSetOwner, onSetText with one event

Less events is better.
onSetDisplayName, onSetOwner, and onSetText only existed because we didn't initially track elements.

* Remove unused variables

(cherry picked from commit 1f31357a2e)
2016-08-12 16:02:29 -07:00
Dan Abramov 5dce7c21e3 Fix unmounting performance regression in __DEV__ (#7463)
* Comment previous occurrences of this issue

* Fix DEV performance regression in V8

* Extract try/catch into a separate function when calling hooks

(cherry picked from commit afa27bc4d5)
2016-08-12 16:02:29 -07:00
Dan Abramov 382f1519b2 Prevent performance regression in DEV due to warning arguments (#7461)
* Prevent internal performance regression

This only affects Facebook website, not open source version of React.

On the Facebook website, we don't have a transform for warnings and invariants.
Therefore, expensive arguments will be calculated even if the warning doesn't fire.
This fixes a few cases where that calculation might be more expensive than usually.

In my testing, this brings down average row click time in Power Editor from ~300ms to ~220ms in __DEV__ (vs ~40ms in prod).

* Put warning() that shows up in profile behind condition

(cherry picked from commit 178cb7d339)
2016-08-12 16:02:29 -07:00
Keyan Zhang 38914dfe6a Fix memory leak in ReactChildrenMutationWarningHook for SSR (#7410)
* corrected ReactChildrenMutationWarningHook's name

* changed `onComponentHasMounted` to `onMountComponent`

and get element from `ReactComponentTreeHook` instead of keeping an internal store

(cherry picked from commit 5514ea369d)
2016-08-12 16:02:28 -07:00