Commit Graph
7883 Commits
Author SHA1 Message Date
Paul O’ShannessyandDan Abramov 6eba27c4e4 [rrm] stable-prs: update milestone on PRs 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov e02f20b5f4 [rrm] Move version reading up to app level 2017-01-06 06:00:09 -08:00
Paul O’ShannessyandDan Abramov c99cbb21e5 Initial import of react-release-manager 2017-01-06 06:00:09 -08:00
Brandon DailandAndrew Clark 394b06d6a6 [Fiber] Throw when attempting to unmount at an invalid node (#8688)
* Throw when attempting to unmount at an invalid node

* Remove extra character after invariant
2017-01-05 16:55:17 -08:00
Dan AbramovandGitHub 38d5eecdb3 Fix AMD and Brunch issues (#8686)
* Add manual build fixtures

* Inject ReactDOM into ReactWithAddons from ReactWithAddons

We used to read ReactDOM as a global inside ReactAddonsDOMDependenciesUMDShim.
This didn't work in AMD environments such as RequireJS and SystemJS.

Instead, I changed it so that ReactDOM gets injected into ReactWithAddons by ReactDOM itself.
This way we don't have to try to require it (which wouldn't work because AMD doesn't handle circular dependencies well).

This means you have to load ReactDOM first before using ReactDOM-dependent addons, but this was already the case before.

This commit makes all build fixtures pass.

* Memoize ReactDOM to avoid going into require on every access

* Add Brunch fixture

* Inline requires to work around Brunch bug

See #8556 and https://github.com/brunch/brunch/issues/1591#issuecomment-270742503 for context.
This appears to be a Brunch bug but we can keep a temporary fix until the next major.
2017-01-05 13:16:08 -08:00
Piotr CzajkowskiandDan Abramov b888d1395e "Don't Mutate the Original Component" example and description mismatch (#8695) 2017-01-05 05:12:51 -08:00
Piotr CzajkowskiandDan Abramov ab26702ef2 Higher-Order Components docs withSubscription() example fix (#8694) 2017-01-05 04:56:13 -08:00
Andrew ClarkandGitHub 632edbb83f Merge pull request #8685 from acdlite/fiberrefeffect
[Fiber] Update refs even if shouldComponentUpdate returns false
2017-01-04 14:28:44 -08:00
Andrew Clark 56d69b95ba Update refs even if shouldComponentUpdate returns false
Implemented using a Ref effect type.
2017-01-04 12:05:25 -08:00
Dan AbramovandGitHub 4058b87e5c Replace Starter Kit with doc link (#8682)
* Replace Starter Kit with doc link

* https in Babel link
2017-01-04 09:39:01 -08:00
Andre GironandDan Abramov b1c93636f3 Fix typos (#8632)
* Fix typos

* Put back x in Latinx
2017-01-04 09:36:19 -08:00
Joel SequeiraandDan Abramov 2170a0e625 Fix typo in Proposing a Change section in how-to-contribute.md (#8498)
* Fix typo in Proposing a Change section in how-to-contribute.md

Not sure if it was actually intended or was a typo but changed 'If you intend to change to the public API' --> 'If you intend to make a change to the public API'

* Simplify
2017-01-04 09:30:08 -08:00
Mateusz BurzyńskiandDan Abramov e5207123f3 [Docs] Fixed anchor links in Animations section (#8453) 2017-01-04 09:24:21 -08:00
Van der Auwermeulen GrégoireandDan Abramov f56a3853c6 Update state-and-lifecycle.md (#8424)
* Update state-and-lifecycle.md

Isn't  clock state and props the same in this example?

* Clarify
2017-01-04 09:18:52 -08:00
DevinsuitandDan Abramov 74e1ebd946 Update blog post link (#8421) 2017-01-04 09:15:09 -08:00
Mojtaba DashtinejadandDan Abramov 5da0eef5fc [docs] Add a note about componentWillReceiveProps (#8234)
* Component Lifecycle In Depth documentation

* first steps to improve react component reference

* improved react component reference

- remove the component-lifecycle-in-depth

* add a note for usage of ReactDOM.findDOMNode

* one note on componentWillReceiveProps

* remove old useless images for lifecycle docs

* Tweak wording
2017-01-04 08:26:33 -08:00
Dan Abramov 3bf20965c5 Nitpick: use FB style in doc 2017-01-04 15:59:32 +00:00
Karthik ChintapalliandDan Abramov 2968c1630d Fixed stray text appearing on top of the navbar at small screen sizes (#8681) 2017-01-04 04:48:53 -08:00
Brian VaughnandGitHub e8f964b5d0 Merge pull request #8679 from bvaughn/fix-react-conf-2017-name
Renamed React.js Conf to React Conf in conferences.md
2017-01-03 15:31:15 -08:00
Brian Vaughn c50109a7cf Renamed React.js Conf to React Conf 2017-01-03 15:27:23 -08:00
Brian VaughnandGitHub 25dacf54f2 Merge pull request #8677 from bvaughn/add-callback-validation-to-dom-render
Add callback validation to fiber-based renderers
2017-01-03 14:57:42 -08:00
Brian Vaughn 37a601cc9f Add callback validation to fiber-based renderers
Moved ReactFiberClassComponent validateCallback() helper function into a standalone util used by both fiber and stack implementations. Validation now happens in ReactFiberUpdateQueue so that non-DOM renderers will also benefit from it.
2017-01-03 12:10:06 -08:00
Andrew ClarkandGitHub 66b79e16d0 Merge pull request #8658 from acdlite/nullupdatetest
Should not re-render as the result of a null state update
2017-01-03 10:27:32 -08:00
Andrew ClarkandGitHub fd867e5c96 Merge pull request #8661 from acdlite/fiberunbatchedupdates
[Fiber] Introduce API to opt-out of batching
2017-01-03 10:24:52 -08:00
Andrew Clark 0f7679f842 Use unbatchedUpdates to opt-out of batching
Reverses the effect of batchedUpdates by resetting the current
batching context.

Does not affect nested updates, which are always deferred regardless
of whether they are inside a batch.
2017-01-03 10:24:27 -08:00
Brian VaughnandGitHub f514fd8b86 Merge pull request #8671 from bonham000/update-docs
update to codebase-overview.md
2017-01-03 09:01:53 -08:00
Brian VaughnandGitHub 3e9e4a43fe Merge pull request #8673 from madeinfree/patch-1
fiber example typo
2017-01-03 08:58:41 -08:00
Brian VaughnandGitHub 056b0ad492 Merge pull request #8674 from neeldeep/patch-1
Update conferences.md
2017-01-03 08:56:30 -08:00
neeldeepandGitHub f39eb5ade7 Update conferences.md 2017-01-03 19:23:55 +05:30
Whien 3cfcb29e60 fiber example typo 2017-01-03 13:52:48 +08:00
Sean Smith 47c326627e update to codebase-overview.md 2017-01-01 15:27:57 -08:00
Andrew Clark 844864f99c No nested updates
We may decide to provide this ability as an escape hatch in the future.
2016-12-30 11:30:40 -08:00
Andrew Clark abce7f7690 Should not re-render as the result of a null state update (Stack)
Stack now passes test added in previous commit.
2016-12-30 00:19:55 -08:00
Andrew Clark 465a5c4631 Should not re-render as the result of a null state update
Fiber already happens to behave this way; this just adds a test.

TODO: Should we add this feature to Stack, too?
2016-12-29 23:31:48 -08:00
Andrew ClarkandGitHub 334d7feeb6 Merge pull request #8641 from jddxf/remove-superfluous-check
remove superfluous check in while loop
2016-12-29 13:25:22 -08:00
Andrew ClarkandGitHub d85a156e85 Merge pull request #8634 from acdlite/fibersyncmount
[Fiber] Sync mount and unmount
2016-12-29 13:11:57 -08:00
Andrew Clark 8c854cd093 prepareForCommit returns info object to be passed resetAfterCommit
The DOM renderer assumes that resetAfterCommit is called after
prepareForCommit without any nested commits in between. That may not
be the case now that syncUpdates forces a nested update.

To address, this changes the type of prepareForCommit to return a value
which is later passed to resetAfterCommit.
2016-12-29 10:39:24 -08:00
Andrew Clark 10b34fbc71 Disallow forced sync updates during begin phase
Stack allows this, but in Fiber it may cause an infinite loop. Instead
we'll print a warning and defer the update by giving it Task priority.
2016-12-29 10:39:18 -08:00
Andrew Clark 6705a184af syncUpdates prevents Synchronous priority from being downgraded to Task
Typically, a sync update is downgraded to Task priority if it's
scheduled within another batch of work, e.g. within a lifecycle like
componentDidMount. But syncUpdates should force sync updates to not
be downgraded to Task. This will cause performWork to be
called recursively.
2016-12-29 10:23:33 -08:00
Andrew Clark 27b8f304b2 Allow performWork to be called recursively
Currently we assume that performWork is never called recursively.
Ideally that is the case. We shouldn't rely on recursion anywhere
in Fiber.

However, to support the use of syncUpdates as an opt-in to forced-
synchronous updates, we need the ability to call performWork
recursively.

At the beginning of performWork, the state of the scheduler is saved;
before exiting, that state is restored, so that the scheduler can
continue where it left off. I've decided to use local variables to stash
the previous state. We could also store them in a record and push it to
a stack, but this approach has the advantage of being isolated to
performWork.
2016-12-29 10:23:33 -08:00
Andrew Clark 25b3b0e156 If an error is thrown and there's no nextUnitOfWork, it's fatal error
This can only be caused by a bug in the renderer, but we should handle
it gracefully anyway.

Added a TODO to change capturedErrors and failedBoundaries so that they
are sets of instances (stateNodes) rather than fibers, to avoid having
to check the alternate. (This outside the scope of this PR.)
2016-12-29 10:23:26 -08:00
Andrew Clark ff7b966807 Wrap top-level mount and unmount in syncUpdates
For legacy purposes. Only enabled in the DOM renderer. We can remove
this in a future release when we enable incremental-by-default.

This change is unobservable because syncUpdates actually schedules
Task updates when it is called from inside another batch. The correct
behavior is to recursively begin another batch of work. We will fix it
in a subsequent commit.
2016-12-28 20:41:40 -08:00
Brian VaughnandGitHub 03812b377c Merge pull request #8646 from bvaughn/focus-side-effect
Renderers can queue commit effects for initial mount
2016-12-28 15:16:50 -05:00
Brian Vaughn affd7760d1 Renderers can schedule commit-time effects for initial mount
The finalizeInitialChildren HostConfig method now utilizes a boolean return type. Renderers can return true to indicate that custom effects should be processed at commit-time once host components have been mounted. This type of work is marked using the existing Update flag.

A new HostConfig method, commitMount, has been added as well for performing this type of work.

This change set is in support of the autoFocus prop.
2016-12-28 15:03:08 -05:00
gitanupamandBrandon Dail 6f6fa97cbd Changed webpack's hyperlink (#8650)
..to point to 2.x documentation instead of 1.x (and to be consistent with other links on the page)
2016-12-28 11:34:00 -06:00
gitanupamandDan Abramov d574c1e02c 'npm init' needed before installing react via npm. (#8649)
* 'npm init' needed before installing react via npm.

I was trying to install react in my django project directory and was getting warnings about package.json not being present. Started this SO post (http://stackoverflow.com/questions/41340909/npm-cant-find-package-json-when-installing-react/41340975#41340975) to figure it out. I think it'll be useful to others too if we add it in the documentation itself.

* Tweak instructions
2016-12-28 04:04:21 -08:00
Dan AbramovandGitHub 285b64c9b1 Include owner in invalid element type invariant (#8637) 2016-12-27 08:41:23 -08:00
Dan AbramovandGitHub b6a5342cd9 Relax test about rendering top-level null (#8640) 2016-12-27 08:38:24 -08:00
Dan AbramovandGitHub f568e41650 Validate that update callback is a function (#8639) 2016-12-27 08:38:10 -08:00
jddxf 0bb1d69461 remove superfluous check in while loop 2016-12-25 09:41:47 +08:00