Compare commits
17 Commits
is-rendera
...
v0.13.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f308c03455 | ||
|
|
d4424e87a7 | ||
|
|
3003dcc0b1 | ||
|
|
8436732a23 | ||
|
|
a82e70ed34 | ||
|
|
2e72fd8e43 | ||
|
|
6cc7567eff | ||
|
|
cfbf1d559f | ||
|
|
ce9fd5f028 | ||
|
|
9432aceb4d | ||
|
|
9f95d8793e | ||
|
|
9e0954abdd | ||
|
|
71f65d3da6 | ||
|
|
fe8d706c1c | ||
|
|
edb8f7f4af | ||
|
|
594f816930 | ||
|
|
94bf54a328 |
24
CHANGELOG.md
24
CHANGELOG.md
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# [React](http://facebook.github.io/react) [](https://travis-ci.org/facebook/react)
|
||||
# [React](http://facebook.github.io/react) [](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:
|
||||
|
||||
|
||||
2
bin/jsx
2
bin/jsx
@@ -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);
|
||||
|
||||
@@ -34,4 +34,4 @@ sass:
|
||||
sass_dir: _css
|
||||
gems:
|
||||
- jekyll-redirect-from
|
||||
react_version: 0.13.0-rc2
|
||||
react_version: 0.13.1
|
||||
|
||||
@@ -46,7 +46,7 @@ You can use mixed arrays with strings and JSX elements.
|
||||
<div>{['First ', <span>·</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 · Second'}} />
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
BIN
docs/downloads/react-0.13.0.zip
Normal file
BIN
docs/downloads/react-0.13.0.zip
Normal file
Binary file not shown.
4
main.js
4
main.js
@@ -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
|
||||
|
||||
@@ -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
4684
npm-shrinkwrap.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
@@ -143,6 +143,6 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
React.version = '0.13.0-rc2';
|
||||
React.version = '0.13.1';
|
||||
|
||||
module.exports = React;
|
||||
|
||||
@@ -350,6 +350,7 @@ ReactDOMComponent.Mixin = {
|
||||
styleUpdates[styleName] = '';
|
||||
}
|
||||
}
|
||||
this._previousStyleCopy = null;
|
||||
} else if (registrationNameModules.hasOwnProperty(propKey)) {
|
||||
deleteListener(this._rootNodeID, propKey);
|
||||
} else if (
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -88,7 +88,9 @@ function updateOptions(component, propValue) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
options[0].selected = true;
|
||||
if (options.length) {
|
||||
options[0].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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']}>
|
||||
|
||||
@@ -33,6 +33,7 @@ function createFullPageComponent(tag) {
|
||||
var elementFactory = ReactElement.createFactory(tag);
|
||||
|
||||
var FullPageComponent = ReactClass.createClass({
|
||||
tagName: tag.toUpperCase(),
|
||||
displayName: 'ReactFullPageComponent' + tag,
|
||||
|
||||
componentWillUnmount: function() {
|
||||
|
||||
@@ -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>'
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user