Commit Graph

8304 Commits

Author SHA1 Message Date
Dan Abramov 9e3a31b2c6 Fix indentation in tutorial (#8914) 2017-02-02 13:24:26 +00:00
Eduard dc04ee87ae Update tutorial.md (#8896)
* Update tutorial.md

The status <div> used in Board can be deleted as well from render.

* Little tweaks
2017-02-01 18:12:00 -08:00
Tiago Fernandez 05f5bf6eb6 Link to CodePen editor rather than final result (#8849)
People want to see the final JS/CSS/HTML, and the final result is already displayed by CodePen.
2017-02-01 18:02:44 -08:00
Jeffrey Wan 3f5482ee20 Update tutorial.md (#8792)
* Update tutorial.md

* Fix quoting to be consistent
2017-02-01 17:42:19 -08:00
John Longanecker b8f0522cc6 Lifting State Up more legible (#8691) 2017-02-01 17:31:01 -08:00
Andrew Clark 86fbb9d583 Merge pull request #8905 from acdlite/fiberfinddomnodeunmount
[Fiber] findDOMNode during componentWillUnmount
2017-01-31 16:05:05 -08:00
Andrew Clark c158ff6179 Merge pull request #8908 from acdlite/fiberemptycomponent
[Fiber] Fix formatting of invalid element invariant
2017-01-31 16:03:54 -08:00
Andrew Clark 2afcf6e09f Fix formatting of invalid element invariant
Message is slightly different for functional and class components.
2017-01-31 15:29:53 -08:00
Andrew Clark 6545012af2 Merge pull request #8893 from gaearon/fix-dom-prod-test
Add process.cwd to the test process shim
2017-01-31 15:04:39 -08:00
Andrew Clark 10e5438422 Merge pull request #8906 from acdlite/warningnewline
Add missing newline to warning
2017-01-31 14:42:21 -08:00
Andrew Clark 6846ef9fb8 Add newline to warning 2017-01-31 14:41:14 -08:00
Andrew Clark af7ae1be91 Don't swap the trees until after the first pass of the commit phase,
where componentWillUnmount is called, but before the second pass,
where componentDidMount/Update is called.
2017-01-31 14:39:52 -08:00
Andrew Clark 35ddd05da4 Merge pull request #8890 from acdlite/fiberfragmentinvariants
[Fiber] Throw on plain object children
2017-01-31 13:14:11 -08:00
Andrew Clark 73d27d755e Merge pull request #8897 from acdlite/fiberfixfinddomnode
[Fiber] Fix findDOMNode algorithm
2017-01-31 13:13:56 -08:00
Andrew Clark 2a0fb5b4aa Remove legacy React element warning 2017-01-31 11:46:30 -08:00
Andrew Clark 17ec96b014 Run test script 2017-01-31 11:44:35 -08:00
Andrew Clark 7daa90206d Add missing portal case to updateSlot switch statement 2017-01-31 11:44:35 -08:00
Andrew Clark 7af673afc1 Allow object as textarea child
Preserves Stack behavior. There's already a warning for this.
2017-01-31 11:44:35 -08:00
Andrew Clark 802c820545 Fallback to owner of returnFiber
Won't work if the returnFiber is a fragment. Not sure it matters;
warning will just be less descriptive.
2017-01-31 11:44:35 -08:00
Andrew Clark 3089db94ce Throw on invalid object type children
Same behavior as Stack
2017-01-31 11:44:30 -08:00
Andrew Clark ba5b9c0af3 Add invariant
Defensive coding to prevent an infinite loop.
2017-01-31 11:35:10 -08:00
Dan Abramov ea9e1575b7 Suppress lint warnings
Using [] is intentional because we don't want to trigger Babel plugin.
2017-01-31 19:30:26 +00:00
Andrew Clark 97f6786cba Fix findDOMNode algorithm 2017-01-31 10:24:03 -08:00
Dan Abramov d6d129a1b2 Reassign process.env.NODE_ENV instead of shimming process 2017-01-31 16:28:20 +00:00
Marius Skaar Ludvigsen d8450845fe #6049 add support for onCancel and onClose event (#6247) 2017-01-31 08:10:48 -06:00
Richie Thomas 469e68542b Added double newline delimiters to the following functions/files: (#8777)
* 'beginLifeCycleTimer' function of ReactDebugTool.js
            * 'bindAutoBindMethod' function of ReactClass.js
            * 'warnNoop' function of ReactServerUpdateQueue.js
            * 'getInternalInstanceReadyForUpdate' function of ReactUpdateQueue.js
            * 'warnNoop' function of ReactNoopUpdateQueue.js
            * 'getDeclarationErrorAddendum' function of ReactDOMComponent.js
            * 'getSourceInfoErrorAddendum' function of ReactElementValidator.js
            * 'getDeclarationErrorAddendum' function of instantiateReactComponent.js and ReactElementValidator.js
            * 'traverseAllChildrenImpl' function of traverseAllChildren.js
            * 'attachRef' function of ReactRef.js
            * 'mountIndeterminateComponent' function of ReactFiberBeginWork.js
            * 'createFiberFromElementType' function of ReactFiber.js
            * 'getDeclarationErrorAddendum' function of ReactDOMSelect.js
            * 'unmountComponentAtNode' function of ReactMount.js
            * 'getDeclarationErrorAddendum' function of ReactControlledValuePropTypes.js
            * 'checkRenderMessage' function of CSSPropertyOperations.js
            * 'getDeclarationErrorAddendum' function of ReactDomFiberSelect.js
            * 'getCurrentComponentErrorInfo' function in 'ReactElementValidator'
            * 'getDeclarationErrorAddendum' function in ReactDOMFiberComponent.js
2017-01-31 07:41:24 -06:00
Vladimir Kovpak 8bc5a87d04 Added undefined example (#8899)
Into section `Booleans, Null, and Undefined Are Ignored` I've added example with undefined.
2017-01-31 07:24:29 -06:00
Ben Alpert 64a47e9fb4 Don't crash Fiber with old devtools (#8900)
Typo.
2017-01-31 13:06:53 +00:00
Roman Liutikov 59aac010dd refer to object by name instead of function call context (#8892) 2017-01-30 18:32:26 -06:00
Senin Roman 466bb4ffb9 Fix incorrect markup for ie10 (#8886) 2017-01-30 18:32:07 -06:00
Dan Abramov 3195bcdbcb Add process.cwd to the test process shim 2017-01-30 21:48:05 +00:00
Maksim Shastsel ec936dd848 Delete @nosideeffect annotation (#8882) 2017-01-30 21:42:17 +00:00
Dan Abramov fb4c08baee Fix lint (#8888) 2017-01-30 17:46:07 +00:00
MICHAEL JACKSON 564fa64626 Update context example for react-router v4 beta (#8889)
* Update context example for react-router@4.0.0-beta.1

* Style nits
2017-01-30 17:36:47 +00:00
Dan Abramov d8491ca73f Declare __REACT_DEVTOOLS_GLOBAL_HOOK__ for Flow (#8884) 2017-01-30 14:14:30 +00:00
Zac Braddy cae2a6f9d3 Got rid of linting errors on windows machines and a number of linting warnings. (#8846) 2017-01-28 15:36:03 -08:00
Frank Yan 751d221172 Fix typo in EventPropagators.js (#8879) 2017-01-27 18:36:21 -06:00
Dan Abramov d3e29d4e54 [Fiber] Support React DevTools (#8818)
* Initial React DevTools support for Fiber

* Record a newly failing irrelevant test

This is fine because we don't use it in Stack anyway (at least not that part), and we also rely on Set/Map in other parts of code.
The newly failing test is the one saying "it works without Map/Set".

* Explicitly check for Fiber DevTools support

This lets us ignore pre-Fiber DevTools instead of crashing them by injecting a different API.

* Track the roots in DevTools instead

* Lol Dan this is not how warnings work in our codebase

* Move injection to the renderer

* Notify DevTools about unmounts

* Make it work in production

* Fix lint and flow

* Fixups

* Address feedback
2017-01-27 22:50:35 +00:00
Paul O’Shannessy 3c75593692 [examples] Use react-standalone (#7669)
[examples] Use babel-standalone
2017-01-26 11:57:01 -06:00
Sebastian Markbåge b26265718a Merge pull request #8840 from sebmarkbage/statelesscoroutines
[Fiber] Simplify coroutines by making yields stateless
2017-01-26 07:15:36 -08:00
Mitchel Humpherys 39472f1c3e installation.md: Add missing "as" (#8871) 2017-01-25 23:33:49 -06:00
Sebastian Markbåge 3f409df468 ReactElement is private to isomorphic React (#8868)
This fixes the build since this dependency is not reachable from React DOM.
2017-01-25 17:52:45 -08:00
Sebastian Markbage 975ad92e68 Don't bail to .child of coroutines
This should bail to stateNode instead.
2017-01-25 17:50:21 -08:00
Sebastian Markbage 754f72a175 Don't visit siblings of the coroutine when looking for yields
When visiting the yields, the root is the stateNode of the coroutine. If
its return value is wrong we'll end up at the alternate of the
workInProgress which will start scanning its children which is wrong.
2017-01-25 17:36:20 -08:00
Sebastian Markbage e8500fb1c2 Add failing tests for coroutines
There are a few different issues:

* Updates result in unnecessary duplicate placements because it can't find the current fiber for continuations.
* When run together, coroutine update and unmounting tests appear to lock down in an infinite loop. They don't freeze in isolation.

I don't have a solution for this but just leaving it for future fixes.
2017-01-25 15:41:48 -08:00
Sebastian Markbage fd8d5f7a8a Simplify coroutines by making yields stateless
Coroutines was kind of broken because it tried to do reparenting and
enabling state preservation to be passed along the coroutine. However,
since we couldn't determine which Fiber was "current" on a reified yield
this was kind of broken.

This removes the "continuation" part of yields so they're basically just
return values. It is still possible to do continuations by just passing
simple functions or classes as part of the return value but they're not
stateful.

This means that we won't have reparenting, but I actually don't think we
need it. There's another way to structure this by doing all the state in
the first phase and then yielding a stateless representation of the result.
This stateless representation of the tree can then be rendered in different
(or even multiple) locations.

Because we no longer have a stateful continuation, you may have noticed
that this really no longer represent the "coroutine" concept. I will
rename it in a follow up commit.
2017-01-25 15:41:47 -08:00
Sebastian Markbage 648d6e190c Swap .child and .stateNode in coroutines
It is slightly more useful this way because when we want to find host nodes
we typically want to do so in the second phase. That's the real tree where
as the first phase is more of a virtual part of the tree.
2017-01-25 15:41:47 -08:00
Brian Vaughn 88b6175cb1 Bumping package.json versions from 16.0.0-alpha.0 to 16.0.0-alpha.1 2017-01-25 12:14:00 -08:00
Andrew Clark 63edf30f5d Merge pull request #8797 from acdlite/fix-arrays
[Fiber] disableNewFiberFeatures bugfix: host component children arrays
2017-01-25 12:06:08 -08:00
Andrew Clark ba1d3829bc Use multiple checks instead of forking the entire function
Easier to follow this way, and less chance the two paths will get
out of sync.
2017-01-25 12:05:32 -08:00