Commit Graph

3172 Commits

Author SHA1 Message Date
Christopher Chedeau
f8aee772ce Mention that talks will be recorded 2014-11-24 11:28:42 +00:00
Christopher Chedeau
c32cf03d0b better wording thanks to @jwalke 2014-11-24 10:33:23 +00:00
Christopher Chedeau
fb2be69e9c react.js conf updates 2014-11-24 09:26:00 +00:00
Ben Alpert
582bc932e5 Merge pull request #2583 from spicyj/style-example
Add example for how to use `style` properly
2014-11-21 14:27:32 -08:00
Ben Alpert
1c5443175c Add example for how to use style properly
Test Plan: jest
2014-11-21 12:10:59 -08:00
Ben Alpert
c6ed9df7f3 Merge pull request #2582 from spicyj/rendercomponent
Finish renaming renderComponent -> render
2014-11-21 11:54:36 -08:00
Ben Alpert
23effb7034 Merge pull request #2581 from spicyj/rm-elt-docs
Update variable name and doc type to be accurate
2014-11-21 11:54:26 -08:00
Ben Alpert
d4e32a7b2c Finish renaming renderComponent -> render
Test Plan: jest
2014-11-20 23:07:58 -08:00
Ben Alpert
c4b9b938cf Update variable name and doc type to be accurate
Test Plan: Crossed fingers.
2014-11-20 23:03:03 -08:00
Sebastian Markbåge
68ba3b6d18 Merge pull request #2567 from sebmarkbage/childrenreconciler
Separate Child Reconciliation Step from Diffing
2014-11-20 11:48:54 -08:00
Sebastian Markbage
26ea341870 Separate Child Reconciliation Step from Diffing
This separates the reconciliation step of children into a separate module.
This is the first step towards prerendering.

The stateful instances are reconciled and put into a "rendered children"
set. Updates creates a new of these sets. These two sets are then diffed
to create insert/move/remove operations on the set.

The next step is to move the ReactChildReconciler step to before the
native DOM component. That way it's possible to rely on child
reconciliation without relying on diffing.
2014-11-20 11:45:02 -08:00
Jim
6ec952977e Merge pull request #2565 from jsfb/fixwhitespace
Removed context paremeter to renderToString/renderToStaticMarkup.
2014-11-19 15:49:33 -08:00
Jim
7768d91363 Removed context paremeter to renderToString/renderToStaticMarkup. 2014-11-19 15:16:23 -08:00
Timothy Yung
006bc28633 Merge pull request #2571 from yungsters/cleanup
Replace `mountDepth` with `isTopLevel`
2014-11-19 13:43:50 -08:00
yungsters
fc7cf2ff63 Replace mountDepth with isTopLevel
Summary:
After #2570, `mountDepth` is only used to enforce that `setProps` and `replaceProps` is only invoked on the top-level component. This replaces `mountDepth` with a simpler `isTopLevel` boolean set by `ReactMount` which reduces the surface area of the internal API and removes the need to thread `mountDepth` throughout React core.

Reviewers: @sebmarkbage @zpao

Test Plan:
Ran unit tests successfully:

```
npm run jest
```
2014-11-19 13:13:08 -08:00
Timothy Yung
70b1426ef0 Merge pull request #2570 from yungsters/updates
Update Dirty Components in Mount Ordering
2014-11-19 13:12:43 -08:00
yungsters
c7fd626b1f Summary:
Currently, `ReactUpdates` updates dirty components in increasing order of mount depth. However, mount depth is only relative to the component passed into `React.render`. This breaks down for components that invoke `React.render` as an implementation detail because the child components will be updated before the parent component.

This fixes the problem by using the order in which components are mounted (instead of their depth). The mount order transcends component trees (rooted at `React.render` calls).

Reviewers: @sebmarkbage @zpao

Test Plan:
Ran unit tests successfully:

```
npm run jest
```
2014-11-19 12:51:55 -08:00
Paul O’Shannessy
3a0f30480d Merge pull request #2544 from mjul/patch-1
Update 10.4-test-utils.md
2014-11-19 07:16:07 -08:00
Paul O’Shannessy
a07ab60ec0 Merge pull request #2554 from samccone/patch-1
Update tutorial language to be more explicit.
2014-11-19 06:15:35 -08:00
Cheng Lou
93bbb3ea5b Merge pull request #2555 from mfunkie/patch-1
Animation documentation for ReactTransitionGroup
2014-11-18 22:33:48 -05:00
Sebastian Markbåge
b0f6f5449c Merge pull request #2552 from sebmarkbage/cleanupinternals
Remove some unnecessary code in ReactComponents
2014-11-18 13:51:39 -08:00
Sebastian Markbage
13ed0317fa Remove some invariants and deadcode
These are not necessary if we enable type checks. Static or dynamic.

They're distracting my greppability.

Also, some dead code in shallow rendering.
2014-11-18 13:04:56 -08:00
Timothy Yung
df87ea1fa6 Merge pull request #2465 from yungsters/perf
Preserve Implicit Method Names
2014-11-18 12:51:08 -08:00
yungsters
bda199de04 Preserve Implicit Method Names
Summary:
Changes the way we instrument methods for `ReactPerf` so that developer tools can assign implicit method names to measured functions.

Reviewers: @zpao @sebmarkbage
2014-11-18 12:48:58 -08:00
Mark Funk
5b2ffde48d Animation documentation for ReactTransitionGroup
Update to the animation documentation for ReactTransitionGroup to clear the air on where one can use it.

If someone tries to use it off of React.addons.ReactTransitionGroup, which is undefined, instead of its real location, React.addons.TransitionGroup, they get a vague error about being unable to set defaultProps of undefined in the React createElement body.
2014-11-18 13:49:23 -05:00
Timothy Yung
ef35585468 Merge pull request #2464 from yungsters/immutable
Stop Mutating Merged Lifecycle Results
2014-11-18 10:02:07 -08:00
yungsters
8e15046283 Stop Mutating Merged Lifecycle Results
Summary:
Currently, `ReactClass` mutates values returned by `getDefaultProps`, `getInitialState`, and `getChildContext`. This is bad because the objects may, for example, be cached and re-used across instances of a React component.

This changes `ReactClass` to instead create a new object. In return for allocating a new object, I've replaced `mapObject` with a `for ... in` so that we are no longer allocating an unused object.

Fair trade, IMO.

Test Plan:
Ran unit tests successfully:

```
npm run jest
```

Conflicts:
	src/core/ReactCompositeComponent.js

Conflicts:
	src/class/ReactClass.js
2014-11-18 10:00:22 -08:00
Sam Saccone
8e47082fb6 Update tutorial language to be more explicit.
The word "Friends" does establish a relationship however it does not fit in the vernacular of react. 
This change makes the phrase more explicit and more familiar.
2014-11-18 12:36:20 -05:00
Sebastian Markbåge
e3e0bf5de2 Merge pull request #2550 from sebmarkbage/cleanupinternals
Move ComponentEnvironment out of ReactComponent
2014-11-17 17:41:32 -08:00
Jim
ef3b348bef Merge pull request #2508 from jsfb/monitor-with-context
Start monitoring uses of withContext, related to issue #2112
2014-11-17 17:23:39 -08:00
Sebastian Markbage
5951a131db Move ComponentEnvironment out of ReactComponent
We currently have three DOM specific hooks that get injected. I move those
out to ReactComponentEnvironment. The idea is to eventually remove this
injection as the reconciler gets refactored.

There is also a BackendIDOperation which is specific to the DOM component
itself so I move this injection to be more specific to the DOMComponent.

E.g. it makes sense for it to be injectable for cross-worker DOM operations
but it doesn't make sense for ART components.
2014-11-17 17:21:41 -08:00
Jim
46bff98a3f Fixed 'imports' to resolve merge conflict 2014-11-17 17:14:00 -08:00
Jim
89aaf73ae8 Merge pull request #2509 from jsfb/use-parent-context
Initial implementation of issue #2112
2014-11-17 17:08:18 -08:00
Jim
081feeb2dd Added warning if owner-based and parent-based contexts differ. 2014-11-17 17:02:20 -08:00
Sebastian Markbåge
fba8be3b98 Merge pull request #2546 from sebmarkbage/cleanupinternals
Move more stuff out of ReactComponent
2014-11-17 14:47:34 -08:00
Sebastian Markbage
6dddd60e33 Unused variables 2014-11-17 13:31:19 -08:00
Sebastian Markbage
fb17e8ca56 Ensure that all internal instances have consistent properties
Use preventExtensions so that we can't add expando properties to internal
instances. This ensures that the hidden class is kept more consistent.
2014-11-17 12:54:21 -08:00
Sebastian Markbage
bc4dd411b0 Move _pendingX into ReactCompositeComponent
Since setProps can no longer be called on anything but composites, we can
move this complexity into ReactCompositeComponent.
2014-11-17 12:54:21 -08:00
Sebastian Markbage
974a4c84ce Move mountComponentIntoNode and setProps out of ReactComponent
This is part of moving more logic out of the base classes.

setProps, replaceProps etc. are not accessible from anything other than
ReactClass so we can safely move it to ReactCompositeComponent.

mountComponentIntoNode is tightly coupled to ReactMount. It's part of the
outer abstraction, the mount point, not the individual component.
2014-11-17 12:54:21 -08:00
Scott Feeney
d75512f211 Merge pull request #2497 from graue/2393-v1
Basic shallow rendering support (#2393)
2014-11-17 11:07:05 -08:00
Scott Feeney
bfadafe5d0 Shallow rendering support (#2393)
Now handles updating. Haven't looked at refs yet.
2014-11-17 10:47:18 -08:00
Martin Jul
50db9feb28 Update 10.4-test-utils.md
This adds minimal valid event data to the Simulate.change example for a text input field.
2014-11-17 13:14:11 +01:00
Sebastian Markbåge
e4218cb7dc Merge pull request #2539 from sebmarkbage/cleanupinternals
Clean up a bunch of internal methods and fields that are now unnecessary
2014-11-16 21:13:07 -08:00
Sebastian Markbage
63644d5e71 Add test for warning in ReactElementValidator
I previously had a mistake here, so I'm adding a unit test to ensure that I
don't make the same mistake again.
2014-11-16 21:07:31 -08:00
Sebastian Markbage
dac59d1032 Drop the _owner and _lifeCycle field on internal instances
The _owner field is unnecessary since it's reachable from _currentElement.

The _lifeCycle field is unnecessary because an internal component should
not even need to exist at all if it's unmounted. It should be dereferenced
internally, and never exposed externally.

The only case where it's important is for batching updates where we
currently avoid calling performUpdateIfNecessary if it's mounted. However,
this function is already only executed "if necessary" so we just make sure
that it's not necessary after unmount by resetting all the pending fields.
2014-11-16 21:05:12 -08:00
Sebastian Markbage
03ae0a906b Drop ReactOwner.Mixin
This is not used anywhere else. To avoid overabstraction we should just
inline this.
2014-11-16 21:04:07 -08:00
Sebastian Markbage
519ee322ca Drop this.props 2014-11-16 21:04:04 -08:00
Sebastian Markbage
8181272fe8 Drop inaccessible methods
These are no longer accessible and the isOwnedBy check is only used in
a method that is not accessible.
2014-11-16 21:02:40 -08:00
Ben Alpert
a194e51af0 Move logic for null to instantiateReactComponent
This cleans up the code a bit and also brings us closer to allowing any ReactNode to be rendered at the top level.

Test Plan: jest
2014-11-16 17:41:54 -08:00
Ben Alpert
c96ea9abf2 Remove transferPropsTo
I'd like to outlaw prop mutation altogether, and now seems like a fine time to remove transferPropsTo.

Test Plan: jest
2014-11-16 17:41:07 -08:00