Commit Graph
19463 Commits
Author SHA1 Message Date
Pete Hunt 9ac27cb551 Rewrite ReactTransitionGroup
The key idea here is that you're always rendering `this.state.children`, not
`this.props.children`. When combined with `cloneWithProps()` this means we can
keep them in the DOM as long as we want. We add new children and reactively
update existing ones using `setState()` inside of `componentWillReceiveProps()`
so `this.state.children` always has the latest versions of components. Since we
may be keeping old components around that are no longer in
`this.props.children` we need a way to figure out where they should be inside
of the combined `this.state.children` list.  `ReactTransitionChildMapping` does
this for us.

Based on that infrastructure we can build the interface we always wanted: enter
and leave lifecycle hooks.

When a component is added to the DOM, `componentWillEnter(callback)` gets
called. Call the callback when you're done animating and `componentDidEnter()`
will be called.

When a component is about to be removed from the DOM,
`componentWillLeave(callback)` gets called. Call the callback when you're done
animating and `componentDidLeave()` will be called and the component will
*actually* be removed from the DOM. It won't be removed until you call the
callback.

These also handle "concurrent" changes. If you "stack" enter/leaves of a single
component before the animation has completed, it will block out all of those
animations until the current animation completes, and then finally it will
animate 0 or 1 times to get itself into the desired current state. This is what
differentiates `componentWillEnter()` from `componentDidMount()`.

The next step would be to build `componentDidReorder()`.

I've built `ReactCSSTransitionGroup` which is identical to the old
`ReactTransitionGroup` and codemodded the callsites.
2014-02-12 12:29:58 -08:00
Pete Hunt a6749a686f [perf] Change how ReactDefaultPerf is injected
ReactDefaultPerf should inject itself when require()'d. This continues to support the ?react_perf use case for logging on initial page load.
2014-02-12 12:29:00 -08:00
Pete Hunt 12ebf33f89 [perf] Measure flush time
This is so we can look at a given flush to determine total time spent in React vs DOM, and which components ended up generating DOM ops.
2014-02-12 12:28:20 -08:00
Pete Hunt d547374847 [perf] Log DOM time
Log the time it takes to perform all DOM operations
2014-02-12 12:27:53 -08:00
Pete Hunt 756bd975b1 [perf] Measure exclusive render time
Piece of https://github.com/facebook/react/pull/962
2014-02-12 12:27:18 -08:00
Paul O’Shannessy da587b15d5 Merge pull request #1046 from spicyj/errutils
Disable guarding in ReactErrorUtils
2014-02-12 09:48:10 -08:00
Pete Hunt db6ff14e7d Update videos.md
There is a better video clip for the Meteor devshop
2014-02-11 22:57:56 -08:00
Ben Alpert 8f298fbd69 Disable guarding in ReactErrorUtils
With #1021 and #1022, I believe this makes it so React never wraps user code in a try/catch. I left in the calls to ReactErrorUtils.guard because it sounds like FB code finds them useful.
2014-02-11 17:10:57 -08:00
Paul O’Shannessy 49747347fb Merge pull request #1048 from spicyj/form-onreset
Add onReset event for forms
2014-02-11 14:42:15 -08:00
Ben Alpert 35d9286781 Refactor ReactMultiChild to not throw errors too
Missed these when I fixed up Transaction; with the exception of ReactErrorUtils, this should be everything.
2014-02-11 10:14:20 -08:00
Paul O’Shannessy 8cf5882447 Merge pull request #1021 from spicyj/close-finally
Set isInTransaction to false even if close throws
2014-02-11 09:27:09 -08:00
Paul O’Shannessy 3f243bc4f9 Merge pull request #1055 from spicyj/jsx-transformer-ie8
Disable source maps when defineProperty is missing
2014-02-11 09:20:29 -08:00
Sebastian Markbage fc2805fe03 Add warnings when accessing properties/methods on unmounted components
This creates a membrane around the React component prototype. It warns if you
try to access properties on the component before it's unmounted. Before it's
mounted, it should be considered a descriptor and not an actual instance.

The workaround, for unknown types, is to access the constructor using
component.type which has static methods on it.
2014-02-11 09:13:03 -08:00
Ben Alpert 89bcecc76f Disable source maps when defineProperty is missing
Fixes #1053.
2014-02-11 00:10:06 -08:00
Cheng Lou 0f4cc6ee84 [Docs] Hide compiled js tab in jsx-compiler.html
Fixes #1049
2014-02-10 23:22:59 -08:00
Pete Hunt 25e56a4540 Update complementary-tools.md 2014-02-10 21:16:13 -08:00
Paul O’Shannessy 66b290c32f Merge pull request #1042 from adelevie/master
Small grammar fix in ReactComponent.js
2014-02-10 16:18:55 -08:00
Paul O’Shannessy 6e5956195d Remove references to autoflow, error wrapper
Fixes #1023
2014-02-10 14:39:57 -08:00
Pete Hunt c544b01cad Delete useless shit in ReactMount
lol
2014-02-10 14:31:15 -08:00
Pete Hunt 5f1d4d7c14 ReactInjection
Consolidate everything we can inject in core into one place. Does not expose publicly -- this is an internal moving of shit around.
2014-02-10 14:30:59 -08:00
Paul O’Shannessy c1c2dd9a89 Add noValidate and corresponding formNoValidate
Fixes #988
2014-02-10 12:01:28 -08:00
Paul O’Shannessy acfef143ae Merge pull request #1045 from spicyj/srcdoc
Add HTML5 srcdoc property for iframes
2014-02-10 12:00:43 -08:00
Ben Alpert 30fd3a30b0 Add onReset event for forms
Test Plan:
Tested in Chrome and IE8.
2014-02-10 11:12:26 -08:00
Pete Hunt 2e17144ac0 Update complementary-tools.md 2014-02-10 10:37:59 -08:00
Ben Alpert 40547125f8 Add HTML5 srcdoc property for iframes 2014-02-09 21:03:37 -08:00
Pete Hunt eb3d516f40 Update complementary-tools.md 2014-02-09 19:18:11 -08:00
Alan deLevie 1194a040f9 remove comma in comment 2014-02-08 19:26:36 -05:00
Alan deLevie 42e65ddb3e Small comment grammar fix in ReactComponent.js 2014-02-08 19:25:49 -05:00
Paul O’Shannessy 141f3a8ac8 Merge pull request #1040 from zpao/react-tools-revamp
react-tools revamp
2014-02-07 13:59:56 -08:00
Paul O’Shannessy d00b11ef03 Remove React from react-tools package
All of this is provided by the react package now, so there's no point in having
it available in multiple places. We *may* go back on that in the future for
shipping test utils, but for the time being, this is better for all.
2014-02-07 13:59:19 -08:00
Paul O’Shannessy 463f940c7f Build react-tools package on build, upload to builds site 2014-02-07 13:59:18 -08:00
Paul O'Shannessy 26fb009e0c fix comment 2014-02-07 13:51:39 -08:00
Cheng Lou 9ae002503c Ensure a pooled class releases back into the pool an instance of that class
Also added tests for PooledClass.

Noticed that some places use `ReactReconcileTransaction.release(transaction)`, when `transaction` might be of another class, say `ReactServerRenderingTransaction` (still a Github PR). This catches that.
2014-02-07 13:51:14 -08:00
Paul O’Shannessy b199de29a0 Cleanup jsx tasks
debug and release are now identical, so there's no need to have both.
2014-02-07 10:21:19 -08:00
Ben Alpert bc27325d31 Merge pull request #1003 from rdworth/patch-1
Update tutorial.md to still have jQuery script tag in later code sample
2014-02-07 00:08:22 -08:00
Paul O’Shannessy d8700f04da Actually upload react.tgz to builds server 2014-02-06 23:59:58 -08:00
Ben Alpert 721ac85bf8 Merge pull request #1039 from imagentleman/patch-2
Update broken link in "Why React" post
2014-02-06 21:18:56 -08:00
imagentleman 3141bc5084 Update broken link in "Why React" post
The AngularJS docs have been updated since the post was originally published.

It should point to the docs from that date (June 5th).
2014-02-06 23:41:48 -05:00
Ben Alpert bc1e950a41 Merge pull request #1038 from imagentleman/patch-1
Docs: Fixed reference to unreachable url.
2014-02-06 20:40:47 -08:00
imagentleman e9e44773ee Docs: Fixed reference to unreachable url. 2014-02-06 21:32:30 -05:00
Paul O’Shannessy 94d11ecf05 build npm-react module, upload to builds page 2014-02-06 15:06:10 -08:00
cpojer 71c10b9f45 Add PropTypes.ArrayOf and clean up ReactPropTypes.js 2014-02-06 11:28:51 -08:00
Nadeesha Cabral 5f941628e0 Fixed missing lighted line
The line number added had been changed from the previous representation of the code fence, but was not highlighted. Therefore, fixed.
2014-02-06 19:11:19 +05:30
Ben Alpert 497dab2ad9 Merge pull request #1033 from bripkens/tostring-docs
docs(ServerRendering): Reflect renderComponentToString changes
2014-02-05 22:59:13 -08:00
Ben Ripkens 4c1a737343 docs(ServerRendering): Reflect renderComponentToString changes 2014-02-06 07:56:37 +01:00
Pete Hunt 73b4f954f2 DOMIDOperations -> BackendIDOperations 2014-02-05 19:47:54 -08:00
Paul O’Shannessy 4ebdb2c0ac Merge branch 'spicyj-uncontrolled-select'
Closed #907
2014-02-05 16:42:32 -08:00
Paul O’Shannessy e0262d50f9 Skip assignment, just call updateOptions directly 2014-02-05 16:41:57 -08:00
Paul O’Shannessy 647e65525c Center twitter embeds differently. again.
This time, just target the iframe. display: table was weird in webkit.
2014-02-05 16:25:13 -08:00
Paul O’Shannessy 8360da2937 Don't use <center> for twitter embeds 2014-02-05 15:51:06 -08:00