Commit Graph

2039 Commits

Author SHA1 Message Date
Ben Alpert 102fafce7f Add a simple production-mode sanity check test 2015-08-19 22:26:42 -07:00
Daniel Rodgers-Pryor 6bd6ef208b ReactCSSTransitionGroup timeouts
As discussed in issue 1326
(https://github.com/facebook/react/issues/1326) transitionend events are
unreliable; they may not fire because the element is no longer painted,
the browser tab is no longer focused or for a range of other reasons.
This is particularly harmful during leave transitions since the leaving
element will be permanently stuck in the DOM (and possibly visible).

The ReactCSSTransitionGroup now requires timeouts to be passed in
explicitly for each type of animation. Omitting the timeout duration
for a transition now triggers a PropTypes warning with a link to the
updated documentation.
2015-08-20 11:38:27 +10:00
Ben Alpert b126926390 Ensure IE8 style expansion list is up to date
In conjunction with #1953, fixes #2407. This seems to be all of the shorthand style properties that IE8 supports, excluding a few nonstandard ones.
2015-08-19 17:22:37 -07:00
Andreas Svensson f4f22a0baa Apply CSS shorthand expansion to IE8 only
Closes #1953.
2015-08-19 17:17:51 -07:00
Paul O’Shannessy 17d5440751 Merge pull request #4567 from koba04/fix-set-boolean-properties
Fixed consistency of behavior boolean properties
2015-08-19 10:20:49 -07:00
Paul O’Shannessy eb056fcf5d Re-sort some constants 2015-08-18 22:33:51 -07:00
Sebastian Markbåge 4a92860b00 Merge pull request #4089 from sebmarkbage/killowner
Don't use owner to determine if the auto-bailout should be used
2015-08-18 18:09:01 -07:00
Ben Alpert 81b4f7295d Merge pull request #4611 from spicyj/create-element
Use createElement instead of HTML generation
2015-08-18 18:04:54 -07:00
Ben Alpert cfd6f7a1b8 Use createElement instead of HTML generation
Behind a feature flag. This is a relatively simple change; adopting this strategy universally would mean that we could clean up a lot of code but this doesn't attempt to restructure more than necessary.
2015-08-18 17:44:20 -07:00
Sebastian Markbage 9315517dec Don't use owner to determine if the auto-bailout should be used
I didn't realize that we actually special cased this. This is an
unfortunate heuristic but it helps minimize the harm that this optimization
does.
2015-08-18 17:33:13 -07:00
Ben Alpert 6663fb3135 Remove _isReactElement
As of this commit, we still support objects as maps so if anyone has an object with keys 'type' and 'props' this will change behavior, but otherwise this should be pretty safe.
2015-08-18 12:55:34 -07:00
Jim 87530049f8 Merge pull request #4481 from dmatteo/Simulate.change-tests
add tests for React.addons.TestUtils.Simulate.change
2015-08-17 11:23:12 -07:00
Bartosz Kaszubowski 1ca77c6ae6 tiny code tweak in ReactMultiChild 2015-08-15 01:25:09 +02:00
Paul O’Shannessy b4b028dec0 Merge pull request #4622 from jorrit/instanceofreporttype
Report the actual type when PropTypes.instanceOf fails
2015-08-14 11:05:57 -07:00
Jorrit Schippers cf6222dd71 Report the actual type when PropTypes.instanceOf fails 2015-08-14 17:46:24 +02:00
Paul O’Shannessy 6708059b51 Merge pull request #4607 from hekar/add/html-table-summary-attr
Added support for more HTML attributes: `summary`
2015-08-13 21:28:50 -07:00
Hekar Khani be1fc794f0 Added support for more HTML attributes: summary
This attribute is used on <table> to support screen readers.
It is deprecated, so take a look at <caption> instead.
2015-08-13 22:41:37 -05:00
Igor Scekic 0e834fabca swap places of mounted and pending update checks
prevents a type error if the component isn't mounted
2015-08-13 16:34:47 +02:00
Sebastian Markbåge d3f338ff27 Fix typecheck 2015-08-12 00:32:52 -07:00
Ben Alpert a54d321765 Remove accidental .only 2015-08-11 18:19:42 -07:00
Ben Alpert dc5a5adfaf Merge pull request #4477 from mridgway/autobind-opt-out
Allow classes created with React.createClass to opt out of autobinding
2015-08-11 18:03:41 -07:00
Ben Alpert 655b82fb7b Merge pull request #3332 from spicyj/warn-r2
Warn with two copies of React
2015-08-11 17:17:53 -07:00
Ben Alpert d002abf0e7 Warn with two copies of React 2015-08-11 17:15:02 -07:00
Jim 079a6b0092 Merge pull request #4470 from jimfb/ref-error-means-multiple-react
Added note about multiple Reacts, since this error commonly implies that.
2015-08-11 16:24:01 -07:00
Ben Alpert 53d8bbddc7 Add React.Children.toArray 2015-08-11 16:13:40 -07:00
Jim e984d2b7d2 Added note about multiple Reacts, since this error commonly implies that. 2015-08-11 12:59:55 -07:00
Sebastian Markbage 216026418c Simplify event dispatching
This simplifies event dispatching by removing the `return false` special
case for the SimpleEventPlugin which allow us to inline much more here
and the code becomes easier to follow.
2015-08-11 11:55:07 -07:00
Sebastian Markbage 16cc45156f Move guards from auto binding to event dispatch
This wraps a proper guard around event dispatching so that errors doesn't
interupt other event callbacks.

Instead we rethrow the first error after all callbacks have been invoked.

For DEV mode we use native event dispatching if available. This has the
benefit that caught exceptions show up in the dev tools even without caught
exceptions being turned on. Yet, all callbacks are guaranteed to fire.
2015-08-11 11:55:07 -07:00
Jim 1b67acc168 Merge pull request #4344 from jimfb/update-children-because-context
Don't skip reconcilation if context differs
2015-08-11 10:44:14 -07:00
Paul O’Shannessy 7deab28347 Merge pull request #4598 from zpao/eslint-1.1
Upgrade ESLint, fix code
2015-08-10 21:11:23 -07:00
Ben Alpert d1a2193127 Merge pull request #4587 from spicyj/stateless-fn
Minimal implementation of stateless components
2015-08-10 17:49:31 -07:00
Paul O’Shannessy ecb34de574 Upgrade ESLint, fix code 2015-08-10 17:04:29 -07:00
Sebastian Markbåge 37ee03f29c Merge pull request #4596 from jaredly/add-source-self
adding __self and __source special props
2015-08-10 16:22:12 -07:00
Ben Alpert 9adcff442a Apply codemod for React -> ReactDOM split
Ran the codemod automatically then ran

```
codemod.py -m -d src '(var React\b[^\n]*;)\n\n(var ReactDOM)' '\1\n\2'
```

to clean up spacing of requires.
2015-08-10 15:24:30 -07:00
Ben Alpert b98b6ea2ac Clean up files before automated codemod 2015-08-10 15:23:12 -07:00
Jared Forsyth 009b7c8ae1 adding __self and __source special props 2015-08-10 13:52:17 -07:00
Paul O’Shannessy 1e90de692e Merge pull request #4584 from jessebeach/jessebeach-reactComponentExpect-silent-fail
reactComponentExpect fails silently
2015-08-10 13:15:14 -07:00
Toru Kobayashi eb4e44a3c9 Fixed consistency of behavior boolean properties 2015-08-09 17:00:37 +09:00
Sebastian Markbage 754ee176d0 Add property key names + type of value to fragment warning
This provides useful context in the logs to help us filter out things like
{__html:...}.
2015-08-07 20:01:03 -07:00
Ben Alpert 5a7bd964b4 Minimal implementation of stateless components
Stateless pure-function components give us more opportunity to make performance optimizations. For now, we'll do a minimal implementation which has similar performance characteristics to other components in the interests of shipping 0.14 and allowing people to begin writing code using this pattern; in the future we can refactor to allocate less and avoid other unnecessary work.
2015-08-07 19:27:42 -07:00
Ben Alpert 3ec9f86573 Deduplicate logic in ReactElementValidator
Shouldn't be much change. Notably, this calls `.getName()` instead of trying to derive it manually, which is more consistent.
2015-08-07 18:53:42 -07:00
Ben Alpert 016a1907e1 Disable event.path handling
Looks like #4558 isn't ready yet and we'd like an interim fix.
2015-08-07 13:33:42 -07:00
J. Renée Beach 39c3fb2b09 reactComponentExpect fails silently
```reactComponentExpect``` fails silently when passed an undefined  value. It calls ```ReactTestUtils.isCompositeComponent``` with the undefined value, in which a ```render``` property is accessed, throwing a prop on undefined not found error which isn't surfaced to jest.

```
TypeError: Cannot read property 'render' of undefined
        at Object.ReactTestUtils.isCompositeComponent (./react/test/ReactTestUtils.js:127:23)
        at new reactComponentExpect (./react/test/reactComponentExpect.js:46:20)
        at reactComponentExpect (./react/test/reactComponentExpect.js:40:12)
```

Expecting the passed-in instance to not be undefined surfaces this issue in the test runner.
2015-08-07 11:21:45 -07:00
Ben Alpert 264bc2e7f2 Fix missing change event target in old IE
Events have `.srcElement` in old IE, not `.target`.

Fixes #4578.
2015-08-06 15:08:59 -07:00
Sebastian Markbåge 375734731d Merge pull request #4579 from sebmarkbage/ownersforcontext
Only set the owner during flattening
2015-08-06 13:04:56 -07:00
Sebastian Markbage 9fc2f8de26 Only set the owner during flattening
This used to do the update as well, which could have side-effects that
rely on owner being null.
2015-08-06 12:57:17 -07:00
Marjan 0d8c3f9cba Add stop-opacity to unitless style properties 2015-08-06 16:46:13 +02:00
Sebastian Markbåge 7ffff573ae Merge pull request #4569 from sebmarkbage/ownersforcontext
Set the owner during traverseAllChildren
2015-08-05 22:46:08 -07:00
Sebastian Markbage cd1ab32d2f Set the owner during traverseAllChildren
This is basically just adding some context to the warning in ReactFragment
so that we can more easily find the callers.
2015-08-05 21:04:52 -07:00
Ben Alpert bdfa948121 Fix lint 2015-08-05 20:34:48 -07:00