Commit Graph
746 Commits
Author SHA1 Message Date
Paul O’Shannessy e872cd0a7c Update vendored modules, delete unused
Closes #1090
2014-02-15 13:50:56 -08:00
Jason Bonta 9ba014fbf1 Merge pull request #1081 from spicyj/textcontent
Avoid innerText for better newline behavior
2014-02-15 02:22:54 -06:00
Cheng LouandPaul O’Shannessy d71736b3ed include mixin keys whose values are falsy
the previous behavior is to skip mixin keys whose values are `undefined`, `null`, `''` and (this is a bug) 0. Now, every key is included.
2014-02-14 16:53:34 -08:00
Pete Hunt 529c971db3 Merge pull request #1088 from petehunt/fixtests
Fix CSSTransitionGroup tests
2014-02-14 13:10:38 -08:00
petehunt b65f5a4d30 fix tests 2014-02-14 12:55:03 -08:00
Cheng LouandPaul O’Shannessy 123ed1f442 Fix IE8 bug during unitless CSS props creation
IE8 goes into an infinite loop if we add props to the obj we're iterating through.
2014-02-14 12:41:44 -08:00
Paul O’Shannessy cebc49e5e6 Merge pull request #1022 from spicyj/multichild-throw
Refactor ReactMultiChild to not throw errors too
2014-02-13 21:51:52 -08:00
Ben Alpert b98f1adf1a Avoid innerText for better newline behavior
Fixes #1080.
2014-02-13 21:31:32 -08:00
Jason BontaandPaul O’Shannessy 47645854f9 un-revert textContent, support multi-line strings in modern browsers
reverts 23ab30ff87 because the issue it fixed doesn't seem to be a problem
anymore. textContent should be better for more things anyway, as the
original 309a88bcf6 indicates. It should be faster because innerText
requires layout.

This also allows us to use strings with newlines in our rendered output
and have confidence that they will render the same on subsequent
re-renders. This is especially useful for es6-style backtick multi-line
strings. This will be more consistent as textContent is supported almost
everwhere so we won't have differing behavior between webkit and
firefox.

see https://github.com/facebook/react/issues/1080
2014-02-13 18:21:35 -08:00
Josh DuckandPaul O’Shannessy acbba1ae67 Updates to perf
ReactDefaultPerf:

* Show times as float instead of string. This means they're sortable.
* Add count columns to all types and average to exclusive time.
* Include mountComponent where updateComponent time is measured.
* Increment count on _renderValidatedComponent instead of update.

ReactDefaultPerfAnalysis:

* Return counts with all summaries.
2014-02-13 18:21:17 -08:00
Cheng LouandPaul O’Shannessy 5c953a7bdd Remove aural CSS numerial styles from CSSProperties
Those styles are not implemented in known browsers.
2014-02-13 18:21:03 -08:00
Pete Hunt 6573a726ba Merge pull request #1075 from spicyj/defperf
Measure root component render in ReactDefaultPerf
2014-02-13 10:49:19 -08:00
Pete Hunt a5c518f69a Merge pull request #855 from syranide/onerror
Add onError to ReactDOMImg to complement onLoad
2014-02-13 10:48:57 -08:00
Pete Hunt f02c3c07d3 Merge pull request #1067 from spicyj/sandbox-seamless
Add seamless and sandbox properties for iframe
2014-02-13 10:48:37 -08:00
Pete Hunt b04df6335a Merge pull request #1069 from spicyj/gh-1028
Assert that event listeners are real functions
2014-02-13 10:48:20 -08:00
Andreas Svensson cda1d8c779 Add onError to ReactDOMImg to complement onLoad 2014-02-13 10:43:03 +01:00
Ben Alpert cd87848b7d Don't warn about onChange for button inputs 2014-02-13 01:16:37 -08:00
Ben Alpert 55be7a71c5 Measure root component render in ReactDefaultPerf
Fixes #1074.
2014-02-13 00:59:02 -08:00
Ben Alpert b0757c5182 Assert that event listeners are real functions
Fixes #1028.
2014-02-12 23:21:46 -08:00
Ben Alpert d0502cf3c1 Add seamless and sandbox properties for iframe
Fixes #1057.
2014-02-12 21:06:43 -08:00
Pete HuntandPaul O’Shannessy 3895353326 [perf] Refactor ReactDefaultPerf and add DOM operation tracing
Split the summary functions into a separate module, and add the ability to view a lot of all DOM operations. Removed DOM timing since it was incorrect. Will potentially replace with a
dropped frame counter in the future.
2014-02-12 16:35:24 -08:00
Jason BontaandPaul O’Shannessy 5abcce5343 add lineClamp, vendor prefixes to CSSProperty.isUnitlessNumber 2014-02-12 16:35:09 -08:00
Pete HuntandPaul O’Shannessy 75b58d2ad2 [perf] Wasted time metrics
This logs DOM ops for a given reconcile. Based on which components rendered and which ones *actually* caused DOM updates we can find
opportunities to add shouldComponentUpdate() methods.
2014-02-12 16:34:37 -08:00
Pete HuntandPaul O’Shannessy 94ef6c51fb [perf] Better inclusive measurements
Inclusive time is still not that helpful w/o looking at what actually resulted in DOM ops. However, this is better than what we have today and will serve as a building block.

I blacklisted everything but composite components -- hopefully that's OK.
2014-02-12 16:34:24 -08:00
Pete HuntandPaul O’Shannessy 439bca78ed [perf] New ReactDefaultPerf
Simplified version of https://github.com/facebook/react/pull/962. More goodies coming soon since the inclusive time isn't very helpful right now.
2014-02-12 12:30:02 -08:00
Pete HuntandPaul O’Shannessy 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 HuntandPaul O’Shannessy 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 HuntandPaul O’Shannessy 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 HuntandPaul O’Shannessy d547374847 [perf] Log DOM time
Log the time it takes to perform all DOM operations
2014-02-12 12:27:53 -08:00
Pete HuntandPaul O’Shannessy 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
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
Sebastian MarkbageandPaul O’Shannessy 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
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
Pete HuntandPaul O’Shannessy c544b01cad Delete useless shit in ReactMount
lol
2014-02-10 14:31:15 -08:00
Pete HuntandPaul O’Shannessy 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
Ben Alpert 40547125f8 Add HTML5 srcdoc property for iframes 2014-02-09 21:03:37 -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'ShannessyandPaul O’Shannessy 26fb009e0c fix comment 2014-02-07 13:51:39 -08:00
Cheng LouandPaul O’Shannessy 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
cpojer 71c10b9f45 Add PropTypes.ArrayOf and clean up ReactPropTypes.js 2014-02-06 11:28:51 -08:00
Pete HuntandPaul O’Shannessy 73b4f954f2 DOMIDOperations -> BackendIDOperations 2014-02-05 19:47:54 -08:00
Paul O’Shannessy e0262d50f9 Skip assignment, just call updateOptions directly 2014-02-05 16:41:57 -08:00