Commit Graph

7614 Commits

Author SHA1 Message Date
Ben Alpert 8334bb088a Lint (#8385) 2016-11-22 12:04:40 -08:00
Richard Maisano b59fb796ea Add a couple missing SVG tags to DOM Elements docs (#8383)
My first contribution to React!

While upgrading a React project, I found some suspect SVG that needed updating, so I dug in after checking the docs. I knew that support for some SVG properties had been added (namely `xmlns` and `xmlnsXlink`), but I noticed them missing from the reference's attribute list. This pull request updates `reference-dom-elements.md` by adding said properties.
2016-11-22 18:50:11 +00:00
Ben Alpert cb6da8e922 Fiber: renderSubtreeIntoContainer (#8368) 2016-11-22 09:57:13 -08:00
Dan Abramov f686218268 Revert "Stop relying on variable hoisting" (#8381) 2016-11-22 15:19:45 +00:00
Linus Unnebäck 93042c277e Stop relying on variable hoisting (#8380)
Only declare the variable once in this scope, instead of declaring them multiple times in the same scope.

This fixes #8318, even though it might technically be a shortcoming in Rollup.
2016-11-22 15:18:10 +00:00
Mikhail Osher e958cdbd36 Fix object spread operator (#8378)
Object spread operator performs shallow copy of object's arguments, so it should be placed before new properties are assigned.
2016-11-22 15:01:23 +00:00
Simen Bekkhus e64510ab21 Fix link to PureComponent in docs (#8375) 2016-11-22 11:09:07 +00:00
Robin Ricard 9334b771c2 Change test assertion depending on a feature flag (#8306)
Instead of a private API (see https://github.com/facebook/react/pull/8150#discussion_r88280994)
2016-11-22 00:17:13 +00:00
Ben Alpert 3438d503db Make findDOMNode generic (#8348) 2016-11-21 17:13:26 +00:00
Evan Scott 77c890dfa2 Update all Jest packages to 17.x (#8327)
* Update all Jest packages to 17.x, cache babel-jest transforms

* Remove the caching

Looking at the other builds it doesn't seem to actually be that necessary.  The bottleneck is executors, not build time.

* Remove unnecessary package, fix fiber test runner

* Regenerate yarn lockfile
2016-11-20 16:10:08 +00:00
Michael Sinov 501ac150f6 update react-without-es6.md (#8351) 2016-11-19 18:19:16 +00:00
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