Compare commits

...

17 Commits

Author SHA1 Message Date
Paul O’Shannessy
f308c03455 v0.13.1 2015-03-16 16:50:30 -07:00
Paul O’Shannessy
d4424e87a7 Update Readme for 0.13.1 2015-03-16 16:41:33 -07:00
Paul O’Shannessy
3003dcc0b1 Changelog for 0.13.1 2015-03-16 16:40:40 -07:00
Paul O’Shannessy
8436732a23 Merge pull request #3427 from zpao/full-page-dom-components
Ensure FullPageComponents are treated as DOM components
(cherry picked from commit dacd4db1fa)
2015-03-16 16:27:28 -07:00
Ben Alpert
a82e70ed34 Merge pull request #3414 from spicyj/gh-3407
Fix up Perf a bit better for 0.13
(cherry picked from commit 0a312bba89)
2015-03-16 16:27:28 -07:00
Ben Alpert
2e72fd8e43 Merge pull request #3412 from spicyj/gh-3329
Squash getDOMNode warning from isDOMComponent
(cherry picked from commit ed257cb691)
2015-03-16 16:27:28 -07:00
Ben Alpert
6cc7567eff Merge pull request #3410 from robertknight/3409-style-null-to-nonnull
Fix incorrect update of style when props.style transitions from null to non-null
(cherry picked from commit bcd70ad500)
2015-03-16 16:27:27 -07:00
Paul O’Shannessy
cfbf1d559f Merge pull request #3402 from vkramskikh/fix-empty-selects-with-value
Fix for empty <select> elements with value
(cherry picked from commit 68a2f89cc6)
2015-03-16 16:27:27 -07:00
Paul O’Shannessy
ce9fd5f028 Merge pull request #3381 from zpao/jsx-nonstrictmodule
Fix module option parsing of jsx command
(cherry picked from commit b0a59a643a)
2015-03-16 16:27:27 -07:00
Paul O’Shannessy
9432aceb4d version bump for dev 2015-03-16 16:27:27 -07:00
Paul O’Shannessy
9f95d8793e Merge pull request #3419 from xmo-odoo/patch-1
Link to inserting raw HTML document
2015-03-16 16:24:13 -07:00
Jim
9e0954abdd Merge pull request #3422 from jviereck/doc-typo-fix
Fix small typo ("of" instead of "or")
2015-03-16 16:24:08 -07:00
Paul O’Shannessy
71f65d3da6 Merge pull request #3394 from cody/getDOMNode
Fix in docs: getDOMNode --> findDOMNode
2015-03-16 16:24:03 -07:00
Paul O’Shannessy
fe8d706c1c v0.13 starter kit 2015-03-10 14:47:44 -07:00
Paul O’Shannessy
edb8f7f4af v0.13.0 2015-03-10 14:45:29 -07:00
Paul O’Shannessy
594f816930 Update readme for 0.13 2015-03-10 14:45:29 -07:00
Paul O’Shannessy
94bf54a328 shrinkwrap 2015-03-10 14:45:29 -07:00
21 changed files with 4813 additions and 21 deletions

View File

@@ -1,3 +1,27 @@
## 0.13.1 (March 16, 2015)
### React Core
#### Bug Fixes
* Don't throw when rendering empty `<select>` elements
* Ensure updating `style` works when transitioning from `null`
### React with Add-Ons
### Bug Fixes
* TestUtils: Don't warn about `getDOMNode` for ES6 classes
* TestUtils: Ensure wrapped full page components (`<html>`, `<head>`, `<body>`) are treated as DOM components
* Perf: Stop double-counting DOM components
### React Tools
#### Bug Fixes
* Fix option parsing for `--non-strict-es6module`
## 0.13.0 (March 10, 2015)
### React Core

View File

@@ -1,4 +1,4 @@
# [React](http://facebook.github.io/react) [![Build Status](https://travis-ci.org/facebook/react.svg?branch=master)](https://travis-ci.org/facebook/react)
# [React](http://facebook.github.io/react) [![Build Status](https://travis-ci.org/facebook/react.svg?branch=0.13-stable)](https://travis-ci.org/facebook/react)
React is a JavaScript library for building user interfaces.
@@ -35,12 +35,12 @@ The fastest way to get started is to serve JavaScript from the CDN (also availab
```html
<!-- The core React library -->
<script src="http://fb.me/react-0.12.2.js"></script>
<script src="http://fb.me/react-0.13.1.js"></script>
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.1.js"></script>
```
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.12.2.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.13.1.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
If you'd like to use [bower](http://bower.io), it's as easy as:

View File

@@ -44,7 +44,7 @@ require('commoner').version(
sourceMap: this.options.sourceMapInline,
stripTypes: this.options.stripTypes,
es6module: this.options.es6module,
nonStrictEs6Module: this.options.nonStrictEs6Module,
nonStrictEs6module: this.options.nonStrictEs6module,
target: this.options.target
};
return transform(source, options);

View File

@@ -34,4 +34,4 @@ sass:
sass_dir: _css
gems:
- jekyll-redirect-from
react_version: 0.13.0-rc2
react_version: 0.13.1

View File

@@ -46,7 +46,7 @@ You can use mixed arrays with strings and JSX elements.
<div>{['First ', <span>&middot;</span>, ' Second']}</div>
```
As a last resort, you always have the ability to [insert raw HTML](/react/docs/dom-differences.html).
As a last resort, you always have the ability to [insert raw HTML](/react/tips/dangerously-set-inner-html.html).
```javascript
<div dangerouslySetInnerHTML={{'{{'}}__html: 'First &middot; Second'}} />

View File

@@ -200,7 +200,7 @@ class HelloMessage extends React.Component {
React.render(<HelloMessage name="Sebastian" />, mountNode);
```
The API is similar to `React.createClass` with the exception or `getInitialState`. Instead of providing a separate `getInitialState` method, you set up your own `state` property in the constructor.
The API is similar to `React.createClass` with the exception of `getInitialState`. Instead of providing a separate `getInitialState` method, you set up your own `state` property in the constructor.
Another difference is that `propTypes` and `defaultProps` are defined as properties on the constructor instead of in the class body.

View File

@@ -137,7 +137,7 @@ Verifies the object is a ReactElement.
```javascript
DOMElement findDOMNode(ReactComponent component)
```
If this component has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements. When `render` returns `null` or `false`, `this.getDOMNode()` returns `null`.
If this component has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements. When `render` returns `null` or `false`, `findDOMNode` returns `null`.
### React.DOM

Binary file not shown.

View File

@@ -60,8 +60,8 @@ function processOptions(opts) {
if (opts.es6module) {
options.sourceType = 'module';
}
if (opts.nonStrictEs6Module) {
options.sourceType = 'nonStrict6Module';
if (opts.nonStrictEs6module) {
options.sourceType = 'nonStrictModule';
}
// Instead of doing any fancy validation, only look for 'es3'. If we have

View File

@@ -1,7 +1,7 @@
{
"name": "react",
"description": "React is a JavaScript library for building user interfaces.",
"version": "0.13.0-rc2",
"version": "0.13.1",
"keywords": [
"react"
],

4684
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "react-tools",
"description": "A set of complementary tools to React, including the JSX transformer.",
"version": "0.13.0-rc2",
"version": "0.13.1",
"keywords": [
"react",
"jsx",

View File

@@ -143,6 +143,6 @@ if (__DEV__) {
}
}
React.version = '0.13.0-rc2';
React.version = '0.13.1';
module.exports = React;

View File

@@ -350,6 +350,7 @@ ReactDOMComponent.Mixin = {
styleUpdates[styleName] = '';
}
}
this._previousStyleCopy = null;
} else if (registrationNameModules.hasOwnProperty(propKey)) {
deleteListener(this._rootNodeID, propKey);
} else if (

View File

@@ -152,6 +152,17 @@ describe('ReactDOMComponent', function() {
expect(stubStyle.color).toEqual('');
});
it("should update styles when 'style' changes from null to object", function() {
var container = document.createElement('div');
var styles = {color: 'red'};
React.render(<div style={styles} />, container);
React.render(<div />, container);
React.render(<div style={styles} />, container);
var stubStyle = container.firstChild.style;
expect(stubStyle.color).toEqual('red');
});
it("should empty element when removing innerHTML", function() {
var container = document.createElement('div');
React.render(<div dangerouslySetInnerHTML={{__html: ':)'}} />, container);

View File

@@ -88,7 +88,9 @@ function updateOptions(component, propValue) {
return;
}
}
options[0].selected = true;
if (options.length) {
options[0].selected = true;
}
}
}

View File

@@ -43,6 +43,14 @@ describe('ReactDOMSelect', function() {
expect(node.value).toEqual('giraffe');
});
it('should not throw with `defaultValue` and without children', function() {
var stub = <select defaultValue="dummy"></select>;
expect(() => {
ReactTestUtils.renderIntoDocument(stub);
}).not.toThrow();
});
it('should not control when using `defaultValue`', function() {
var stub =
<select defaultValue="giraffe">
@@ -100,6 +108,14 @@ describe('ReactDOMSelect', function() {
expect(node.value).toEqual('gorilla');
});
it('should not throw with `value` and without children', function() {
var stub = <select value="dummy"></select>;
expect(() => {
ReactTestUtils.renderIntoDocument(stub);
}).not.toThrow();
});
it('should allow setting `value` with multiple', function() {
var stub =
<select multiple={true} value={['giraffe', 'gorilla']}>

View File

@@ -33,6 +33,7 @@ function createFullPageComponent(tag) {
var elementFactory = ReactElement.createFactory(tag);
var FullPageComponent = ReactClass.createClass({
tagName: tag.toUpperCase(),
displayName: 'ReactFullPageComponent' + tag,
componentWillUnmount: function() {

View File

@@ -163,8 +163,8 @@ var ReactDefaultPerf = {
ReactDefaultPerf._allMeasurements.length - 1
].totalTime = performanceNow() - start;
return rv;
} else if (moduleName === 'ReactDOMIDOperations' ||
moduleName === 'ReactComponentBrowserEnvironment') {
} else if (fnName === '_mountImageIntoNode' ||
moduleName === 'ReactDOMIDOperations') {
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
@@ -210,6 +210,10 @@ var ReactDefaultPerf = {
fnName === 'updateComponent' || // TODO: receiveComponent()?
fnName === '_renderValidatedComponent')) {
if (typeof this._currentElement.type === 'string') {
return func.apply(this, args);
}
var rootNodeID = fnName === 'mountComponent' ?
args[0] :
this._rootNodeID;
@@ -243,9 +247,7 @@ var ReactDefaultPerf = {
}
entry.displayNames[rootNodeID] = {
current: typeof this._currentElement.type === 'string' ?
this._currentElement.type :
this.getName(),
current: this.getName(),
owner: this._currentElement._owner ?
this._currentElement._owner.getName() :
'<root>'

View File

@@ -65,7 +65,7 @@ var ReactTestUtils = {
isDOMComponent: function(inst) {
// TODO: Fix this heuristic. It's just here because composites can currently
// pretend to be DOM components.
return !!(inst && inst.getDOMNode && inst.tagName);
return !!(inst && inst.tagName && inst.getDOMNode);
},
isDOMComponentElement: function(inst) {

View File

@@ -179,4 +179,55 @@ describe('ReactTestUtils', function() {
// Should be document order, not mount order (which would be purple, orange)
expect(log).toEqual(['orangepurple', 'orange', 'purple']);
});
it('does not warn for getDOMNode on ES6 classes', function() {
var Foo = React.createClass({
render: function() {
return <div />;
}
});
class Bar extends React.Component {
render() {
return <div />;
}
}
spyOn(console, 'warn');
var foo = ReactTestUtils.renderIntoDocument(<Foo />);
expect(ReactTestUtils.isDOMComponent(foo)).toBe(false);
var bar = ReactTestUtils.renderIntoDocument(<Bar />);
expect(ReactTestUtils.isDOMComponent(bar)).toBe(false);
var div = ReactTestUtils.renderIntoDocument(<div />);
expect(ReactTestUtils.isDOMComponent(div)).toBe(true);
expect(console.warn.calls.length).toBe(0);
});
it('should support injected wrapper components as DOM components', function() {
var injectedDOMComponents = [
'button',
'form',
'iframe',
'img',
'input',
'option',
'select',
'textarea',
'html',
'head',
'body'
];
injectedDOMComponents.forEach(function(type) {
var component = ReactTestUtils.renderIntoDocument(
React.createElement(type)
);
expect(component.tagName).toBe(type.toUpperCase());
expect(ReactTestUtils.isDOMComponent(component)).toBe(true);
});
});
});