Commit Graph
7409 Commits
Author SHA1 Message Date
Lee SanghyeonandDan Abramov 20fffaefe4 Update codebase-overview.md (#8142)
* Update codebase-overview.md

Fix the broken source code URL in 'Event System' section.

* Update codebase-overview.md

Re-fix link name
2016-10-29 13:01:41 +01:00
Maksim ShastselandDan Abramov a15c80bbe6 Add support for node v7 (#8135) 2016-10-29 11:24:12 +01:00
Andrew LoandDan Abramov a878097746 In the community support doc, I noticed that the React Facebook (#8138)
page link is broken since it's missing '.com'.
2016-10-29 00:31:01 +01:00
Andrew ClarkandGitHub 0eaef6811b Merge pull request #8133 from gaearon/error-boundaries-more
[Fiber] Error boundaries should handle errors independently
2016-10-28 14:58:54 -07:00
Dan Abramov b546d245a4 The issue with tests is solved now 2016-10-28 21:48:37 +01:00
Dan Abramov f65436351c Handle multiple errors in boundaries 2016-10-28 21:22:59 +01:00
Dan Abramov dc39d456a3 Add tests verifying we don't swallow exceptions 2016-10-28 21:22:59 +01:00
Dan Abramov 43767c6a7d Add a failing test for multiple independent boundaries
Now that commits are treated as atomic, it is possible that componentDidMount, componentDidUpdate, or componentWillUnmount threw in multiple places during the commit. We need to make sure we notify all affected boundaries of the first errors in them.
2016-10-28 21:22:58 +01:00
Dan Abramov 2024985227 Add more tests for error boundaries 2016-10-28 21:22:58 +01:00
Gant LabordeandKevin Lacker 87ceaa5bcb Organize and add confs (#8129)
Upcoming proximity followed by past chronological.
2016-10-28 11:21:21 -07:00
mfijasandBen Alpert b7b3025357 Updated tutorial.md (#8054)
Fixed method name (renderStep -> renderSquare).
Removed <li>'s key to present the warning described below the code fragment.
2016-10-28 10:28:44 -07:00
Dan AbramovandGitHub 7877b60737 [Fiber] Error Boundaries (#8095) 2016-10-28 10:29:14 +01:00
Sebastian MarkbågeandGitHub a682b77dc7 Merge pull request #8128 from sebmarkbage/fiberdom
[Fiber] Some early refactoring to be able to reuse the event system
2016-10-27 23:18:43 -07:00
Sebastian Markbage ff8180ad40 Create ReactGenericBatching injection wrapper around BatchedUpdates
This moves calls that don't know if they're in a Fiber or Stack
context to use ReactGenericBatching.batchedUpdates.

The corresponding one will be injected from either the stack
reconciler and/or the fiber reconciler if they're loaded at the
same time.

This lets them share the event system when they're both used
at once.

This can also be useful for libraries that call
unstable_batchedUpdates today but don't know which renderer to
use.
2016-10-27 18:57:30 -07:00
Sebastian Markbage 2fafde19ec Refactor ResponderEventPlugin to not rely on _rootNodeID
Instead of relying on IDs, we now use instances for everything so
this should be reflected by the test.

This still has a _rootNodeID to store the listeners which I will
remove next.
2016-10-27 18:54:15 -07:00
EugeneandDan Abramov 35c2686ce0 Update reference-react-component.md (#8126)
line 320: For example, this code ensures that the `color` prop is a string
2016-10-27 19:25:43 +01:00
Rick BeerendonkandKevin Lacker 2430147dda Add React Remote Conf 2016. (#8094)
Add video links to some conferences.
2016-10-27 11:25:14 -07:00
Sebastian Markbage ccaac31354 Move more files into stack reconciler
CallbackQueue and Transaction are specific to the stack
reconciler.
2016-10-27 11:04:23 -07:00
Dan AbramovandGitHub 696ddd8fe0 Clarify how transition props work (#8124) 2016-10-27 14:21:34 +01:00
Ivan ZotovandDan Abramov 0dd6199df6 Improve devtools image size for the tutorial (#8114) 2016-10-27 13:54:18 +01:00
Andreas MöllerandDan Abramov 0d67f5d135 Fix: Remove unneeded else branches from documentation examples 2016-10-27 13:12:37 +01:00
Dan Abramov b94c927374 Consistent CodePen links in docs 2016-10-27 13:06:09 +01:00
Ivan ZotovandDan Abramov 10c6cff9ac Fix lint errors (#8113) 2016-10-27 13:03:32 +01:00
Varun BhuvanendranandDan Abramov d240ee6b07 added word break (#8120) 2016-10-27 13:01:51 +01:00
Lewis BlackwoodandDan Abramov 9843d55a92 Correct usage of formatName() function in docs (#8122)
The code section above these changes defines a `formatName` function
that expects a parameter `user`. The code section containing these
changes incorrectly called `formatName(user.name)`. For those following
along with CodePen, this section should correctly call
`formatName(user)`.
2016-10-27 13:01:04 +01:00
Josh PerezandDan Abramov bc845b3112 Shares debugID information across modules (#8097)
Prior to this, React was using a nextDebugID variable that was locally
scoped to both `instantiateReactComponent` and `ReactShallowRenderer`.
This caused problems when the debugIDs would collide, the `itemMap` in
`ReactComponentTreeHook` would be overwritten and tests would fail
with the message "Expected onBeforeMountComponent() parent and
onSetChildren() to be consistent".

This change shares the debugID with both modules thus preventing any
collisions in the future.
2016-10-27 10:31:10 +01:00
王晓勇andDan Abramov 2e36daa0c8 Update forms.md (#8121) 2016-10-27 10:26:31 +01:00
Andrew ClarkandGitHub c7ad67f438 Merge pull request #8118 from facebook/fiberpurecomponent
[Fiber] PureComponent
2016-10-26 21:13:43 -07:00
Andrew Clark 7d6eb1cc9c PureComponent in Fiber
Passes existing PureComponent tests
2016-10-26 21:02:39 -07:00
Dan Abramov beac792416 Tweak Forms 2016-10-27 02:02:29 +01:00
Eric NakagawaandDan Abramov 16226de0fe Docs update - Additional (#8115)
* Reapplied fixes to updated docs from master

* Reapplied fixes to Forms, removed ES2016 function includes()

* Missing carriage return

* Adding back some line breaks

* Making requested changes.

* Making space changes

* Fixed typo and removed unnecessary hyphen.

* Reworded select, and highlighted line

* Fixed string styles

* Refactored <label> to use htmlFor

* Another refactor of <label>

* Removed name prop from radiobutton
2016-10-27 00:14:08 +01:00
Eric NakagawaandKevin Lacker 25bdf44cd4 Forms Update (#8112)
* Reapplied fixes to updated docs from master

* Reapplied fixes to Forms, removed ES2016 function includes()

* Missing carriage return

* Adding back some line breaks

* Making requested changes.

* Making space changes
2016-10-26 13:45:25 -07:00
Toru KobayashiandSebastian Markbåge 48fcbd47f4 [Fiber] Add top level render callbacks into ReactDOMFiber and ReactNoop (#8102)
* [Fiber] Add top level render callbacks into ReactDOMFiber and ReactNoop

* [Fiber] Support multiple render callbacks

* [Fiber] `this` in render callbacks are public instances

* [Fiber] commitLifeCycles move to behind the effectTag check
2016-10-26 13:19:19 -04:00
Alex KatopodisandDan Abramov 40d8e9d874 Fix typo in reconciliation.md (#8110) 2016-10-26 17:13:55 +01:00
Lutz RosemaandDan Abramov 1dc12fc9f1 Use const instead of var (#8107)
It clarifies that `history` and `current` won't be reassigned.
2016-10-26 15:20:09 +01:00
Andrew ClarkandDan Abramov fd9183af10 [Fiber] String refs and owner tracking (#8099)
* Implement string refs using callback closures

* Merge Fiber type to avoid Flow intersection bugs

Still one remaining type error that I'm not sure how to fix

* Fix Flow issue with an unsafe cast

* Fix missing semicolon

* Add a type import I missed earlier
2016-10-26 14:37:32 +01:00
Jae Hun LeeandDan Abramov f65c1be177 Update lists-and-keys.md (#8090)
There is mismatching variable name both definition and usage.
In line 156, an argument name called item is change to match the usage in line 158.
2016-10-26 14:17:21 +01:00
Toru KobayashiandDan Abramov 5a6d6c655d Fix an argument name of TestUtils.renderIntoDocument (#8104) 2016-10-26 13:44:46 +01:00
Sebastian MarkbågeandGitHub 52a9d5fc56 Merge pull request #8083 from sebmarkbage/fiberfinddomnode
[Fiber] Implement findDOMNode and isMounted
2016-10-26 02:52:20 -04:00
Sebastian MarkbågeandGitHub b78f5b9be2 Merge pull request #8028 from sebmarkbage/nodidupdateforbailout
[Fiber] Don't call componentDidUpdate if shouldComponentUpdate returns false
2016-10-25 18:21:40 -04:00
Sebastian Markbage db7a29d254 Don't call componentDidUpdate if shouldComponentUpdate returns false
This fix relies on the props and state objects being different
to know if we can avoid a componentDidUpdate. This is not a great
solution because we actually want to use the new props/state
object even if sCU returns false. That's the current semantics
and it can actually be important because new rerenders that are
able to reuse props objects are more likely to have the new props
object so we won't be able to quickly bail out next time.
I don't have a better idea atm though.
2016-10-25 15:21:05 -07:00
Sebastian MarkbågeandGitHub 642138334a Merge pull request #8096 from sebmarkbage/fiberdom
Merge React[DOM/Native]TreeTraversal
2016-10-25 17:52:16 -04:00
Sebastian Markbage 58782894f4 Merge React[DOM/Native]TreeTraversal
These two implementations are identical. Except for some
invariants for some reason.

Since this relies on an implementation detail of the internal
component tree rather than an implementation detail of the
renderer, we might as well merge them and remove the injection.
2016-10-25 14:37:46 -07:00
Sebastian Markbage 254e258eea Add tests for findDOMNode on fragment and text
These are new features that aren't covered by existing tests.

It is now possible to use findDOMNode to find a text node.

When a component returns a fragment, it will search to find the
first host component just like element.querySelector does.
2016-10-25 13:59:34 -07:00
Sebastian Markbage 1488798fef findDOMNode when a component is not yet mounted or unmounted
First we need to check if a component subtree is mounted at all.

If it is, we need to search down the fiber for the first host
node. However, we might be searching the "work in progress"
instead of current.

One realization is that it doesn't matter if we search work in
progress or current if they're the same. They will generally be
the same unless there is an insertion pending or something in
the alternate tree was already deleted. So if we find one of
those cases, we switch to look in the alternate tree instead.
2016-10-25 13:59:34 -07:00
Sebastian Markbage 8bdae6a8b5 Handle unmounted and not-yet-inserted subtrees in isMounted
There are two cases where we have a Fiber that is not actually
mounted. Either it is part of a tree that has not yet been
inserted or it is part of a tree that was unmounted.

For the insertion case, we can check the parents to see if there
is any insertion effect pending along the parent path.

For deletions, we can now check if any of the return pointers
is null without actually being the root.
2016-10-25 13:59:34 -07:00
Sebastian Markbage ad02fee721 Clear effectTag and return pointers after side-effects
This will let us use these pointers to reason about a tree.
Whether if it is "current" or "work in progress".
2016-10-25 13:59:33 -07:00
Sebastian Markbage 4de7a775d3 Implement isMounted for Fiber
This is the naive implementation that doesn't cover the case
where it has completed but not yet committed. It also doesn't
deal with unmounts since they currently don't clean up the item
in the ReactInstanceMap.
2016-10-25 13:59:33 -07:00
Sebastian Markbage 82bef5fc75 Implement findDOMNode for Fiber
This is the naive implementation that doesn't cover the case where there are
two diverging fibers, or if this tree is unmounted.
2016-10-25 13:59:31 -07:00
Sebastian MarkbågeandGitHub e0a3bcd531 Merge pull request #8086 from sebmarkbage/fiberdom
[Fiber] Reorganize files for DOM renderer to make overlap between fiber/stack clearer
2016-10-25 15:56:30 -04:00