Commit Graph

479 Commits

Author SHA1 Message Date
Paul O’Shannessy 5c65abfbac Merge remote-tracking branch 'syranide/textarearows' 2013-12-09 15:51:38 -08:00
Paul O’Shannessy 153b75f186 Bump version to 0.9.0-alpha
This is trunk, which will be 0.9. We'll have to cherry-pick this whole
thing into a 0.8 branch.
2013-12-06 15:11:25 -08:00
petehunt ef339c9cc4 Version bump, make tests work 2013-12-06 11:56:30 -08:00
Paul O’Shannessy 9270d3d56e Merge pull request #592 from spicyj/guard-fn
ReactErrorUtils: In prod, just return the original
2013-12-06 11:31:02 -08:00
Paul Shen 12e765dd27 Revert "Don't mutate passed-in props"
This reverts https://github.com/facebook/react/pull/576

This approach mutates the default props for the instance on each update,
which causes incorrect behavior. discussed with @balpert. can look into
cloning but this unbreaks.
2013-12-05 16:53:43 -08:00
Paul O’Shannessy 2ebbbc5145 Followup fix for lint 2013-12-05 15:55:49 -08:00
Ben Alpert d0883c8cc7 Use depth (not owner) to check for root components
Fixes #557.
2013-12-05 13:36:29 -08:00
Andreas Svensson 27b8e7a6f4 corrections 2013-12-05 19:40:48 +01:00
Andreas Svensson 4d6d4b54d6 Fix ReactDOMTextarea missing "rows" and "cols" attribute, incorrect "size" property 2013-12-05 18:36:48 +01:00
Andreas Svensson e060eabb01 Add HAS_POSITIVE_NUMERIC_VALUE to DOMProperty and normalize behavior of null values
Uniformly remove null values, rather than sometimes set/remove, could potentially assign 'null' or 'undefined'
2013-12-05 18:36:46 +01:00
Marshall Roch d17bd176a2 Remove support for putting mixins, propTypes, etc. in 'statics'
This leaves statics as a way to define static methods and properties
that will be accessible on the return value of `React.createClass`
without changing the current spec.
2013-12-04 20:27:44 -08:00
Sean Kinsey c2e48740fc [ReactTransitionGroup] Add onTransitionEnter and onTransitionLeave
It is valuable to know when the number of children in a TransitionGroup is going
to increase or decrease, since we might want to apply extra animations.
For instance, when used with overflow:auto, we might want to apply different css
based on it overflowing or not - to do this we need to calculate this after new
nodes has entered and after nodes has been removed.
2013-12-04 20:27:28 -08:00
John Watson bf24dc33f7 Separate replaceState invariant violations
It'd be nice if we knew which error we were hitting when this invariant hit.
2013-12-04 20:27:24 -08:00
Marshall Roch e3ad088ff3 Remove deprecation warning for React statics 2013-12-04 20:27:19 -08:00
Paul O'Shannessy 1b8bdbe177 Remove deprecated React.unmountAndReleaseReactRootNode 2013-12-04 20:27:15 -08:00
Marshall Roch 79b9d5af62 Introduce 'statics' for class specification
This moves the static properties off of the root object and into
a 'statics' property. Then they are made available on the constructor so
they can be used directly and in mixins.
2013-12-04 18:39:44 -08:00
Ben Newman affe7f98b5 Merge pull request #367 from benjamn/findComponentRoot-memory-usage-improvements
Space optimizations for ReactMount.findComponentRoot.
2013-12-04 13:20:29 -08:00
Ben Alpert 9d443542f9 Remove unused updatePropertiesByID 2013-12-03 19:22:36 -08:00
Ben Newman 87db648f3e Address pull request feedback. 2013-12-03 16:43:37 -05:00
Ben Newman 6b9fc81b64 Space optimizations for ReactMount.findComponentRoot. 2013-12-03 16:43:37 -05:00
Paul O’Shannessy 9d18956b09 Merge pull request #624 from spicyj/remove-registrationNamesKeys
Remove unused event plugin registrationNamesKeys
2013-12-02 16:03:36 -08:00
Pete Hunt 3851462b80 Fix lint warnings 2013-12-02 13:32:09 -08:00
Paul O’Shannessy 76e3294c8f Merge pull request #609 from subtleGradient/subtlegradient/fixes-ios-crasher
fixes iOS crasher
2013-12-02 13:25:40 -08:00
Paul O’Shannessy d64256fb65 Merge pull request #626 from spicyj/getUnboundedScrollPosition-license
Add missing license header
2013-12-02 09:07:07 -08:00
Ben Alpert 1cb402c410 Add missing license header 2013-12-02 01:12:20 -08:00
Ben Alpert 4323ab095f Remove unused event plugin registrationNamesKeys 2013-12-01 22:28:19 -08:00
Pete Hunt 92b62bf1fe Merge pull request #576 from spicyj/immutable-props
Don't mutate passed-in props
2013-12-01 18:26:41 -08:00
Pete Hunt 2a84b6c6b2 Merge pull request #537 from hojberg/dont_animate_undefined_children
ReactTransitions: Don't animate undefined children
2013-12-01 14:21:11 -08:00
Paul O’Shannessy 8fbdb50a9d Merge pull request #597 from spicyj/gh-527
Don't use .returnValue if .defaultPrevented exists
2013-11-27 14:28:26 -08:00
Paul O’Shannessy 5fbd8109f8 Merge pull request #598 from spicyj/gh-516
Be resilient to fn.name not existing in IE
2013-11-27 14:28:02 -08:00
Thomas Aylott 916ee6b394 jsx & JSDOM support 2013-11-27 17:04:40 -05:00
Marshall Roch 697a9113c0 ReactPropTypes: add oneOfType to support union types
Summary:
e.g.

  propTypes: {
    foo: React.PropTypes.oneOfType([
      React.PropTypes.string,
      React.PropTypes.number
    ]);
  }

to do this, I exposed a `.weak` chainable validator that returns instead of throws, e.g.

  React.PropTypes.string.isRequired.weak
  React.PropTypes.string.weak

which returns true or false. Technically, `React.PropTypes.string.weak.isRequired` also exists, but `oneOfType` will never call it. Might be useful to people creating custom validators though.
2013-11-27 12:10:50 -08:00
Marshall Roch 351dcfed01 Validate propTypes, contextTypes, childContextTypes
who watches the watchmen?
2013-11-27 12:10:50 -08:00
Pete Hunt fcfe516a2e Less verbose ReactPropTypeLocations logging
Since we use keyMirror() and invariant() messages are only shown in __DEV__, we don't have to do manual constant->string translation. Also fixes a few
undefined keys that just happened to work before.
2013-11-27 12:10:50 -08:00
Thomas Aylott f4753030a2 IE support 2013-11-25 16:02:01 -05:00
Thomas Aylott 3bfb687de3 remove warning comment about createHTMLDocument 2013-11-25 15:08:00 -05:00
Thomas Aylott eebad16636 Use an iframe to create a testDocument…
instead of `createHTMLDocument` since it isn't fully support by the browsers we care about.

fixes #606
fixes #454
2013-11-25 15:05:35 -05:00
Ben Alpert 685dec022a Be resilient to fn.name not existing in IE
Fixes #516.
2013-11-24 01:53:53 -05:00
Ben Alpert e6e71a4953 ReactErrorUtils: In prod, just return the original
This will save a stack frame (nice when in a debugger) and presumably be a bit faster.
2013-11-24 01:47:15 -05:00
Ben Alpert 4bd0a40037 Don't use .returnValue if .defaultPrevented exists
`.defaultPrevented` exists in IE9+. I checked in IE9, Chrome, and Firefox that it does default to `false`.

Fixes #527.
2013-11-24 01:35:49 -05:00
Ben Alpert b99fd93684 'getElementsByClassName' doesn't exist in IE8
Fixes #532.
2013-11-24 01:22:00 -05:00
Pete Hunt d51ae6b8bc Merge pull request #575 from spicyj/owner
Move __owner__ off of props
2013-11-21 17:44:48 -08:00
Ben Alpert 61abc645e5 Move __owner__ off of props 2013-11-21 17:34:52 -08:00
Ben Newman 52d3b47f48 Add back mocking removed to make ReactEventTopLevelCallback-test pass.
This is a partial reversion of commit 9937f0c8bd.
2013-11-21 10:57:24 -08:00
Ben Newman 97bbd852b2 Merge pull request #584 from spicyj/mock
Mock modules properly in test runner.
2013-11-21 10:31:59 -08:00
Ben Alpert af95b35f27 Have faith in var hoisting 2013-11-21 10:31:20 -08:00
Ben Alpert c7bb3af760 Mock modules properly in test runner
As an added bonus, the jasmine web interface now groups tests by file.

Test Plan:
grunt test passes on b2507066, the parent of 566f8b2e (which committed a workaround for buggy module mocking).
2013-11-21 00:39:37 -08:00
Ben Newman 566f8b2e85 Merge pull request #573 from spicyj/tests
Make ReactEventTopLevelCallback-test pass
2013-11-20 16:54:15 -08:00
Christopher Chedeau e73900dad4 Remove rootNode from componentDidMount and componentDidUpdate
We can already access the DOM node using `this.getDOMNode()`. Passing it as an argument was a bad decision.

Previous API:

```
componentDidMount(DOMElement rootNode)
componentDidUpdate(object prevProps, object prevState, object prevContext, DOMElement rootNode)
```

Next API:

```
componentDidMount()
componentDidUpdate(object prevProps, object prevState, object prevContext)
```
2013-11-20 14:20:35 -08:00
Christoph Pojer 2fe2cd5337 Ensure ReactPerf always uses a string as a URL 2013-11-20 14:19:13 -08:00