Commit Graph

763 Commits

Author SHA1 Message Date
petehunt cadd6cbb6c add ReactCSSTransitionGroup to addons and document it 2014-02-18 22:47:53 -08:00
Paul O’Shannessy c0660ea6e0 Merge pull request #1100 from plievone/mapchildren-docs
Fix docs for React.Children.map, .forEach, .only.
2014-02-18 21:43:30 -08:00
Paul O’Shannessy f81d16960c Merge pull request #1128 from spicyj/media-attrs
Add media element attributes
2014-02-18 18:04:43 -08:00
Paul O’Shannessy 8a47813baa Update copyrights for 2014.
grep -rl 'Copyright 2013 Facebook' static_upstream | xargs perl -pi -w -e s/Copyright 2013 Facebook/Copyright 2013-2014 Facebook/g;'

Not going to check in a script to do this since it will just change every year.
Closes #1006
2014-02-18 17:06:43 -08:00
Paul O’Shannessy 792d8aca86 Merge pull request #1116 from spicyj/gh-1115
Add download and hrefLang attributes
2014-02-18 13:42:24 -08:00
Ben Alpert 112a20ce73 Add media element attributes
Fixes #1124.

I didn't add `volume` because it requires more complicated logic to control properly and I didn't add `paused` because to set it we need to call play() or pause() -- perhaps a mutation method is appropriate.
2014-02-18 12:30:14 -08:00
Paul O’Shannessy c79974db3a Merge pull request #1122 from spicyj/gh-1120
Strip calls to warning() in __DEV__
2014-02-17 19:44:53 -08:00
Ben Alpert 5795376961 Strip calls to warning() in __DEV__
Fixes #1120.
2014-02-17 19:01:45 -08:00
Ben Alpert d8fd1af4a0 Pool ancestors list so event system is reentrant 2014-02-17 16:37:15 -08:00
Ben Alpert ae7e44ec84 Add download and hrefLang attributes
Fixes #1115.
2014-02-17 15:13:14 -08:00
Ben Alpert 2f0bb69708 Prevent error thrown when removing event target
Fixes #1105.
2014-02-17 10:33:34 -08:00
Paul O’Shannessy 9125f68194 0.9.0-rc1 2014-02-16 17:38:52 -08:00
Ben Alpert 1167aeb453 Expose cloneWithProps on addons
closes #1066
2014-02-16 14:08:05 -08:00
Paul O’Shannessy 6780b47526 Add CSSTransitionGroup to addons
Stealing part of #1059.
2014-02-16 14:04:29 -08:00
plievone 827c44fcd3 Fix docs for React.Children.map, .forEach, .only. 2014-02-16 22:41:30 +02:00
Ben Newman 47ae865428 Make ReactWebWorker-test.js less flaky.
Two improvements: make sure we set `done = true` when an error message is
received, so that the test output contains the error message instead of
eventually timing out and displaying nothing useful; and increase the
timeout for this particular test from 5000ms (the default) to 20000ms.
2014-02-16 12:57:14 -05:00
Ben Alpert 2013db23d3 Fix comma splice 2014-02-15 13:58:57 -08:00
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 Lou 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 Lou 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 Bonta 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 Duck 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 Lou 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 Hunt 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 Bonta 5abcce5343 add lineClamp, vendor prefixes to CSSProperty.isUnitlessNumber 2014-02-12 16:35:09 -08:00
Pete Hunt 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 Hunt 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 Hunt 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 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
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