Commit Graph

7603 Commits

Author SHA1 Message Date
Tom Occhino
dfdff2b61a Move all dev *Hook tests and ComponentTreeTestUtils to expectDev (#8350) 2016-11-18 18:53:48 +00:00
Sebastian Markbåge
0deb71223d Fix ReactDOMFiberSelect to set the initial values (#8349)
I forgot that the normal properties route doesn't do this. We also have
to make sure that the order is 1) insert children (options), 2) set
multiple 3) update the options.
2016-11-18 18:52:15 +00:00
Sebastian Markbåge
6741703fbf Merge pull request #8347 from sebmarkbage/fiberdom
[Fiber] Handle controlled components
2016-11-18 18:35:26 +00:00
Dan Abramov
12ef47ba8f Merge pull request #8346 from shubheksha/docs/improve-state-and-lifecycle
Improved sections of state and lifecycle docs
2016-11-18 18:24:27 +00:00
Dan Abramov
a0044be99d Minor changes, make it more verbose 2016-11-18 18:24:15 +00:00
Sebastian Markbage
c1daa6f2c1 Record tests and fix BrowserEventEmitter test to not crash jest 2016-11-18 18:08:40 +00:00
Sebastian Markbage
e06b335588 Add some Flow types to inputValueTracking
Not perfect but better.
2016-11-18 17:59:37 +00:00
Sebastian Markbage
9b6738805a Exclude data-reactroot from tests when using Fiber 2016-11-18 17:59:36 +00:00
Sebastian Markbage
6e04bd758e Apply @spicyj's SelectEventPlugin fix
This fixes some tests with Fiber since we no longer rely on Stack
internals for this.
2016-11-18 17:59:36 +00:00
Sebastian Markbage
632ae806e8 Give wrappers the raw props object
Wrappers operate on the raw props object instead of the processed one.

We should probably clean this up a bit since it is very confusing and
unnecessary allocations to have two separate objects for props.
2016-11-18 17:59:36 +00:00
Sebastian Markbage
a2ca759dfd Handle controlled components in Fiber
We need to adjust inputValueTracking a bit to handle the fact that
Fiber attaches wrapper state on nodes.
2016-11-18 17:59:36 +00:00
Sebastian Markbage
cd0f963fa3 Fix up Flow annotations to be a bit more explicit where the unsoundness is 2016-11-18 17:59:36 +00:00
Shubheksha Jalan
730dae1df6 Improved sections of state and lifecycle docs 2016-11-18 22:14:27 +05:30
Dan Abramov
57f0cf376f Merge pull request #8345 from shubheksha/docs/improve-introducing-jsx
Improved some sections of the introducing JSX docs
2016-11-18 16:20:48 +00:00
Dan Abramov
c47340acfb Small nit: add a sentence about readability back 2016-11-18 16:20:17 +00:00
Shubheksha Jalan
e4432c7f76 Improved some sections of the introducing JSX docs 2016-11-18 21:09:34 +05:30
Sebastian Markbåge
751b76e351 Merge pull request #8319 from sebmarkbage/fiberdom
[Fiber] Fork ReactDOMComponent
2016-11-18 13:39:50 +00:00
Dan Abramov
919aa36d69 Merge pull request #8339 from nolanlawson/patch-1
Update 2016-11-16-react-v15.4.0.md
2016-11-18 12:27:16 +00:00
Dan Abramov
1c861a0d48 Merge pull request #8332 from gaearon/prod-dev
[Docs] Expand Installation and clarify why use bundlers
2016-11-18 12:26:22 +00:00
Dan Abramov
0b1d56399b Nits 2016-11-18 12:26:06 +00:00
Dan Abramov
c91cc4d11a Nit 2016-11-18 12:25:23 +00:00
Sebastian Markbage
7246659f4d Consistent method vs function 2016-11-18 12:20:25 +00:00
Sebastian Markbage
836331ba5f Wire up ReactDOMFiberComponent in ReactDOMFiber
We'll need to do the DOM injection now.
2016-11-18 12:01:22 +00:00
Sebastian Markbage
61a1a50955 Split mountComponent into create and set initial properties
This lets us insert children in between these two steps.
2016-11-18 00:26:26 +00:00
Sebastian Markbage
4b017507e2 Don't pass the Fiber around instead use the DOM node
To avoid exposing the implementation details of fibers we'll just pass the
DOM node around instead. We'll attach any additional wrapper state on it.
We don't have to do it that way. We can also just invert the relationship
and put the node in the wrapper state.

I'll probably just get rid of the wrapper object and just put them as
expandos on the DOM.
2016-11-18 00:26:26 +00:00
Sebastian Markbage
e962e97f75 Satisfy Flow by assuming value is an array for multi-select 2016-11-18 00:26:26 +00:00
Sebastian Markbage
6dc04b73a7 Assert that this is a script tag
Also, use a fixed string for the HTML since this is always a script tag.
2016-11-18 00:26:26 +00:00
Sebastian Markbage
e58b050773 Pass the tag explicitly instead of reading it from the internal instance 2016-11-18 00:26:26 +00:00
Sebastian Markbage
2defc83f34 Stop using host parent/container internal objects
Instead we extract the namespace from the root element.
2016-11-18 00:26:26 +00:00
Sebastian Markbage
d2888a7dea Get rid of server side support for <option />
We read the wrapper state during initial mount for server rendering support
but Fiber doesn't use it and we don't need it. We also can't because we
haven't yet completed the parent that has the selected.

I will need to remember to always insert children before setting the
selected value on the parent <select />. That way the DOM will deal with
the `selected` property of option properly.
2016-11-18 00:26:26 +00:00
Sebastian Markbage
2ef2a8e6f5 Pass props explicitly instead of getting them off currentElement
We don't store currentElement and I'm trying to get rid of accessing the
Fiber directly inside the host config.
2016-11-18 00:26:25 +00:00
Sebastian Markbage
e42842f2cd getCurrentOwnerName
Instead of passing around the owner and the internal fiber everywhere we
can set current owner during each commit. That way we have it available
globally where ever we need it.

That way we don't have to pass it as a DEV only argument nor expose the
internal representation to the host config.

This doesn't actually get the current owner yet. Will do that in a follow
up.
2016-11-18 00:26:25 +00:00
Sebastian Markbage
43f07779c4 We only need the root attribute for warnings and server-side rendering
We don't need this for Fiber yet. We can possibly add an expando to check
if this is rendered with React or not.
2016-11-18 00:26:25 +00:00
Sebastian Markbage
a1645322a7 Lint issues
Most dead code
2016-11-18 00:26:25 +00:00
Sebastian Markbage
3a856091be Add some Flow and get rid of the typecheck annotations 2016-11-18 00:26:25 +00:00
Sebastian Markbage
aea55609bf No need for unmounting DOM components
We'll stop tracking the input value tracking. We'll also stop uncaching the
node because we can just let the garbage collector take care of that. This
makes it easier to release components in trees that never mounted.

This also removes an invariant error which is covered by unit tests.
This is necessary to separate regardless because we don't want this to
fire for a component that was started but was thrown away because it never
mounted. We can come back to that later.
2016-11-18 00:26:25 +00:00
Sebastian Markbage
77de47e378 Stop tracking event listeners on DOM nodes
Basically, we don't need to remove the event listeners because we can just
check if something is still mounted when they fire instead. We'll rely on
garbage collection to clean them up.
2016-11-18 00:26:25 +00:00
Sebastian Markbage
e1ed610740 Remove the notion of transactions
We don't need to wait for the commit phase to start listening to events
since we have the node.

Next we'll stop unlistening to events too and instead just check isMounted.
2016-11-18 00:26:24 +00:00
Sebastian Markbage
7cd26b9c71 Manage children inside DOM properties
Fiber manages children separately so we don't need to do it here.
However, we special case the text content children and
dangerouslySetInnerHTML.

This reveals a bug that we currently don't handle the case where we switch
from dangerouslySetInnerHTML or text children to element children, because
child insertions are handled before the parent updates. We could possibly
handle this case by removing all nodes before the first host child but
that is a bit unfortunate.
2016-11-18 00:26:24 +00:00
Sebastian Markbage
7c5ec42350 Remove _domID
Not used by Fiber
2016-11-18 00:26:24 +00:00
Sebastian Markbage
4073dc79d7 Remove instrumentation and nesting warning
The nesting warning isn't as important now that we use createElement and
I don't want to deal with this just yet.
2016-11-18 00:26:24 +00:00
Sebastian Markbage
447e0a12b5 Get rid of the previousStyleCopy
We have warned about not mutating styles already. At this point we can just
freeze the style object in DEV.

That way we can read it from the previous props object without storing
another copy of it.

Also delete the associated warning.
2016-11-18 00:26:24 +00:00
Sebastian Markbage
151094ce03 Rely on lazy listeners 2016-11-18 00:26:24 +00:00
Sebastian Markbage
82e1d7dac3 Remove child nodes flag
We're always eager in Fiber.
2016-11-18 00:26:24 +00:00
Sebastian Markbage
c8d877a4c4 Remove rootNodeID
We only use this to determine if something is mounted or not but I don't
think we really need to.
2016-11-18 00:26:24 +00:00
Sebastian Markbage
e34e8974db Remove markup related paths 2016-11-18 00:26:24 +00:00
Sebastian Markbage
ec178acf15 Turn ReactDOMFiberComponent into a singleton
And turn on Flow.
2016-11-18 00:26:23 +00:00
Sebastian Markbage
9c3e9fbb05 Fork ReactDOMComponent and the wrappers to Fiber
From now on any change to these have to be replicated to these files.

I will next start changing the implementation to work with Fiber.
2016-11-18 00:26:23 +00:00
Nolan Lawson
1ff4158fa0 Update 2016-11-16-react-v15.4.0.md
Edge and IE11 both show user marks and measures in the Dev Tools, so it's technically not accurate to say that only Chrome has this feature.
2016-11-17 15:53:41 -08:00
Tom Occhino
32f5b034ed Upgrade ESLint and dependencies, fix new lint errors, switch Travis to Yarn (#8309)
* Update ESLint to 3.10.2

Also pull in fbjs for extending properly, per @zpao. This also disables consistent-return, which has about 80 failing cases in React currently. If we'd like to turn this back on, we should do it separately and fix all the call sites properly (rather than just adding 'return undefined;' everywhere, which adds no value.

Fixes to all existing lint errors plus an update for yarn.lock to follow.

* Update yarn.lock after the eslint update.

* Fix all new eslint failures

Unfortunately I had to add three eslint-disable-next-line instances. All have explanations inline.

* Switch Travis to use yarn instead of npm
2016-11-17 22:16:44 +00:00