Commit Graph
7355 Commits
Author SHA1 Message Date
Sebastian Markbåge ea8cf7fbff Delete child when the key lines up but the type doesn't (#8085)
When keys line up in the beginning but the type doesn't
we don't currently delete the child. We need to track that this
fiber is a not a reuse and if so mark the old one for deletion.
2016-10-25 12:51:53 +01:00
Dan Abramov 225325eada Add Fiber Debugger (#8033)
* Build react-noop as a package

This lets us consume it from the debugger.

* Add instrumentation to Fiber

* Check in Fiber Debugger
2016-10-25 08:36:37 +01:00
Dan Abramov 265ab83667 Respect state set in componentWillMount() on resuming (#8079)
When resuming creating new instance after resuming work, we should set the `state` on the newly creating instance rather than the old one.
2016-10-25 00:21:56 +01:00
Sergey Rubanov 9626c838cb Add npm v4.0.0 support (#8082) 2016-10-24 23:57:12 +01:00
Constantin Gavrilete 82d592a0fa removed duplicated 'the' (#8081) 2016-10-24 17:34:58 -05:00
Sebastian Markbåge 06e3b03132 Merge pull request #8078 from sebmarkbage/rmcomment
Remove copypasta comment
2016-10-24 13:49:51 -04:00
Sebastian Markbage 7991a00dcc Remove copypasta comment
Caught by @gaearon
2016-10-24 10:49:10 -07:00
Antti Ahti 954a70e591 Remove deprecated function from tests (#6536)
This has been deprecated since 2013 so it's about time to remove it.
2016-10-24 18:46:38 +01:00
Dan Abramov 14156e56b9 Strip PropTypes checkers in production build (#8066)
* Strip PropTypes in production build

* Revert "Warn if PropType function is called manually (#7132)"

This reverts commit e75e8dcbeb.
2016-10-24 18:43:31 +01:00
Dan Abramov e1ee94ca17 Add more highlighting to docs (#8076)
* Tweak JSX in Depth

* Add highlighting to Refs and the DOM

* More tweaks
2016-10-24 15:48:46 +01:00
Toru Kobayashi 6cdc610bcc [Fiber] Add types for ReactFiber and ReactChildFiber (#8072)
* Add Types for ReactFiber

* Add Types for ReactChildFiber
2016-10-24 14:20:44 +01:00
Marcio Puga 6fa1ddbdb4 Fix typos (#8067) 2016-10-24 13:50:04 +01:00
Ashish 8333b891e4 Docs : Fix createClass reference (#8073)
Currently react.createClass is wrongly referenced to #react.createclass. Changed it to #createclass!
2016-10-24 13:34:17 +01:00
Sebastian Markbåge 69d725f764 Merge pull request #8055 from sebmarkbage/fiberclassname
Accept className in ReactDOMFiber
2016-10-23 17:04:03 -04:00
Dan Abramov 156639241e Remove references to createClass in createElement docs (#8064) 2016-10-23 15:48:58 +01:00
Dan Abramov 46eca10046 Link to lifecycle methods from Context doc (#8062) 2016-10-23 14:35:23 +01:00
Andrew Poliakov 4e98dba6d3 Update tutorial.md, Taking Turns (#8058) 2016-10-23 13:49:55 +01:00
Alireza Mostafizi e527b3a464 Update handling-events.md (#8057) 2016-10-23 13:44:29 +01:00
William Hoffmann 29f5da8de4 Fix typo (#8056) 2016-10-23 13:44:08 +01:00
Giuseppe 74026fd9ea Docs replace reference to 'getInitialState' with 'state' instance property in "Thinking in React" (#8059) 2016-10-23 13:41:37 +01:00
Sebastian Markbage 51f1205fb4 Accept className in ReactDOMFiber
This isn't a complete solution to all attributes. It's just that
we run a lot of unrelated unit tests by testing className so
we need it for the tests.
2016-10-22 17:57:33 -07:00
Jason Grlicky 952bdca020 Fix for typos (#8046) 2016-10-22 16:50:24 -07:00
Jun Kim 284a96b9a6 Fix illogical code in tutorial.md (#8048)
The tutorial wants to throw a 'warning' and explains about 'key' of React's list, but it throws nothing since there is sensible key.
"key={move}" should be removed, and added after explaining about key.
2016-10-22 16:49:07 -07:00
Diego Muracciole 461a74115c Injected Host Component classes are not being considered by the reconciler (#8050)
* Consider Host Component classes when creating a new internal instance

* Remove unused tagToComponentClass & injectComponentClasses from ReactHostComponent
2016-10-22 17:28:37 -05:00
Phil Quinn cf37402338 correct order of params in documentation (#7989) 2016-10-22 21:59:54 +01:00
Brad Vogel 01753cde85 "take part in" is the correct saying (#8013) 2016-10-22 21:57:57 +01:00
Sebastian Markbåge 57f07777ef Fix relative link in Hello World (#8041)
* Fix relative link in Hello World

This links https://facebook.github.io/docs/installation.html which redirects to https://code.facebook.com/

* Update hello-world.md

* Fix link
2016-10-22 21:56:53 +01:00
Oskari Mantere 38c22252f4 Replace vars with let and const (#8051) 2016-10-22 21:55:29 +01:00
Avinash Kondeti 6810627a91 Fix: updated with new docs links (#8049) 2016-10-22 21:53:52 +01:00
Jun Kim 37f94bd3bb Fix typo in tutorial.md (#8047)
changges -> changes
2016-10-22 21:52:29 +01:00
Taeho Kim a5ff2f1e9c Fix typo in new tutorial code (#8045) 2016-10-22 21:46:51 +01:00
Nathan Hardy f7cb6cbe15 Fix erroneous '}' in JSX examples (#8043) 2016-10-22 21:45:29 +01:00
Cody Reichert 4d3c5ea23c Fix anchor link for displayName (#8040) 2016-10-22 21:44:51 +01:00
Ragnar Þór Valgeirsson 7340fa9d93 Convert the Number component to ListItem (#8039)
* Convert the Number component to ListItem

* Add updated example CodePen

Also fixes typos.
2016-10-22 21:44:28 +01:00
BEAUDRU Manuel 54dfe0b43c Wrong library name reference in tutorial.MD (#8038)
* Update tutorial.md

Seems like you are talking about immutable.js and not immutability.js which doesn't exist :)

* Capitalize Immutable.js
2016-10-22 21:43:15 +01:00
Ben Alpert fa82e3e9d6 Update website on Travis when only new files are added (#8037)
This build didn't commit the new files because no existing files were changed:

https://travis-ci.org/facebook/react/jobs/169622664

This should work better.
2016-10-22 21:41:29 +01:00
Christopher Chedeau 4812f26915 Update components-and-props.md
fb indent style
2016-10-21 18:30:25 -07:00
Christopher Chedeau eb118b7037 Update react-without-jsx.md
Facebook codestyle
2016-10-21 14:30:35 -07:00
Dan Abramov d1a61ee7f4 Fix redirects 2016-10-21 22:02:30 +01:00
Dan Abramov 1f818f2740 Minor doc tweaks 2016-10-21 21:47:43 +01:00
Kevin Lacker 455d2d1b48 New Documentation 2016-10-21 20:59:08 +01:00
Sebastian Markbåge 8cac523bea Merge pull request #8029 from sebmarkbage/fiberreturnfromtoprender
Quick fix to the return top level problem
2016-10-21 14:59:01 -04:00
Sebastian Markbage 6e7c89ed8a Quick fix to the return top level problem
This doesn't deal with the fact that work is usually deferred
so this will return null for first render (except in sync tests).
It also doesn't deal with top levels being fragments etc.
It doesn't deal with the host instance type being a wrapper
around the public instance. This needs to be unified with refs
and findDOMNode better.

However, this does expose that we reactComponentExpect and
ReactTestUtils doesn't work very well with Fiber.
2016-10-21 11:58:40 -07:00
Sebastian Markbåge 9b1b40ca93 Merge pull request #8015 from sebmarkbage/fiberclassinit
[Fiber] Add more life-cycles
2016-10-21 14:57:51 -04:00
Sebastian Markbage 37ca3874af Add unit tests for aborted life-cycles
This tests the life-cycles when work gets aborted.
2016-10-21 11:57:24 -07:00
Sebastian Markbage c862ba719e Fallback to current props if memoizedProps is null
If work has progressed on a state update that gets resumed
because of another state up, then we won't have an new
pendingProps, and we also won't have any memoizedProps because
it got aborted before completing. In that case, we can just
fallback to the current props.

I think that they can't have diverged because the only way they
diverge is if there is new props.

This lets us bail out on state only updates in more cases which
the unit tests reflect.
2016-10-21 11:57:24 -07:00
Sebastian Markbage b72c27ce5d Don't schedule NoWork as the next work
We currently only filter out "NoWork" in the beginning of this
function. If the NoWork root is after the one with work it will
show up in the second loop. There's probably a more efficient
way of doing this but this works for now.

This showed up in this PR because a new unit test gets unblocked
which ends up with this case.
2016-10-21 11:57:24 -07:00
Sebastian Markbage a87ec42f2a Add more life-cycles to Fiber
This refactors the initialization process so that we can share
it with the "module pattern" initialization.

There are a few new interesting scenarios unlocked by this.
E.g. constructor -> componentWillMount -> shouldComponentUpdate
-> componentDidMount when a render is aborted and resumed.
If shouldComponentUpdate returns true then we create a new
instance instead of trying componentWillMount again or
componentWillReceiveProps without being mounted.

Another strange thing is that the "previous props and state"
during componentWillReceiveProps, shouldComponentUpdate and
componentWillUpdate are all the previous render attempt. However,
componentDidMount's previous is the props/state at the previous
commit. That is because the first three can execute multiple
times before a didMount.
2016-10-21 11:57:24 -07:00
Toru Kobayashi a6728f961c [Fiber] Add unit tests for ReactDOMFiber (#8016) 2016-10-21 00:44:23 -04:00
Sebastian Markbåge 4132cc4d3e Fix lint with yarn (#7997)
I couldn't figure out how to do this yarn alone so I ended up
just manually hacking the yarn to force a downgrade of babylon
to 6.8.0 since otherwise it gets resolved to 6.12.0 which is
broken.
2016-10-20 17:49:40 -04:00