react 0.14.0-rc1 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +31 -0
- package/PATENTS +33 -0
- package/README.md +4 -4
- package/dist/react-with-addons.js +745 -516
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +491 -279
- package/dist/react.min.js +6 -6
- package/lib/CSSPropertyOperations.js +6 -1
- package/lib/ChangeEventPlugin.js +3 -1
- package/lib/DOMChildrenOperations.js +5 -0
- package/lib/DOMPropertyOperations.js +7 -0
- package/lib/EventPluginHub.js +15 -4
- package/lib/EventPluginUtils.js +10 -5
- package/lib/HTMLDOMPropertyConfig.js +21 -2
- package/lib/React.js +1 -0
- package/lib/ReactBrowserEventEmitter.js +6 -0
- package/lib/ReactCSSTransitionGroup.js +1 -1
- package/lib/ReactCSSTransitionGroupChild.js +5 -0
- package/lib/ReactClass.js +0 -1
- package/lib/ReactComponent.js +3 -4
- package/lib/ReactCompositeComponent.js +24 -11
- package/lib/ReactDOMComponent.js +74 -21
- package/lib/ReactDOMIDOperations.js +0 -1
- package/lib/ReactDOMInput.js +6 -1
- package/lib/ReactDOMSelection.js +16 -0
- package/lib/ReactDOMTextarea.js +3 -1
- package/lib/ReactDefaultPerf.js +10 -4
- package/lib/ReactDefaultPerfAnalysis.js +7 -1
- package/lib/ReactElement.js +4 -13
- package/lib/ReactElementValidator.js +14 -7
- package/lib/ReactErrorUtils.js +31 -20
- package/lib/ReactEventEmitterMixin.js +1 -1
- package/lib/ReactLink.js +1 -1
- package/lib/ReactMount.js +15 -3
- package/lib/ReactPropTransferer.js +1 -1
- package/lib/ReactRef.js +1 -2
- package/lib/ReactTestUtils.js +21 -9
- package/lib/ReactVersion.js +1 -1
- package/lib/SyntheticEvent.js +0 -1
- package/lib/canDefineProperty.js +24 -0
- package/lib/createHierarchyRenderer.js +1 -1
- package/lib/getTestDocument.js +4 -11
- package/lib/traverseAllChildren.js +7 -2
- package/package.json +4 -2
- package/dist/react-dom.js +0 -42
- package/dist/react-dom.min.js +0 -12
- package/lib/joinClasses.js +0 -39
- package/lib/memoizeStringOnly.js +0 -31
package/lib/ReactVersion.js
CHANGED
package/lib/SyntheticEvent.js
CHANGED
|
@@ -23,7 +23,6 @@ var warning = require('fbjs/lib/warning');
|
|
|
23
23
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
24
24
|
*/
|
|
25
25
|
var EventInterface = {
|
|
26
|
-
path: null,
|
|
27
26
|
type: null,
|
|
28
27
|
// currentTarget is set when dispatching; no use in copying it here
|
|
29
28
|
currentTarget: emptyFunction.thatReturnsNull,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
* @providesModule canDefineProperty
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var canDefineProperty = false;
|
|
15
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
+
try {
|
|
17
|
+
Object.defineProperty({}, 'x', { get: function () {} });
|
|
18
|
+
canDefineProperty = true;
|
|
19
|
+
} catch (x) {
|
|
20
|
+
// IE will fail on defineProperty
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = canDefineProperty;
|
|
@@ -33,7 +33,7 @@ var React = require('./React');
|
|
|
33
33
|
*
|
|
34
34
|
* var instances = renderHierarchy(
|
|
35
35
|
* function(ComponentA[, ComponentB, ComponentC]) {
|
|
36
|
-
*
|
|
36
|
+
* ReactDOM.render(<ComponentA />, ...);
|
|
37
37
|
* })
|
|
38
38
|
* );
|
|
39
39
|
* instances[0][0]; // First return value of first render method.
|
package/lib/getTestDocument.js
CHANGED
|
@@ -12,17 +12,10 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
function getTestDocument(markup) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
document.
|
|
18
|
-
|
|
19
|
-
var testDocument = iframe.contentDocument || iframe.contentWindow.document;
|
|
20
|
-
testDocument.open();
|
|
21
|
-
testDocument.write(markup || '<!doctype html><html><meta charset=utf-8><title>test doc</title>');
|
|
22
|
-
testDocument.close();
|
|
23
|
-
|
|
24
|
-
iframe.parentNode.removeChild(iframe);
|
|
25
|
-
return testDocument;
|
|
15
|
+
document.open();
|
|
16
|
+
document.write(markup || '<!doctype html><html><meta charset=utf-8><title>test doc</title>');
|
|
17
|
+
document.close();
|
|
18
|
+
return document;
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
module.exports = getTestDocument;
|
|
@@ -143,14 +143,19 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
143
143
|
} else if (type === 'object') {
|
|
144
144
|
var addendum = '';
|
|
145
145
|
if (process.env.NODE_ENV !== 'production') {
|
|
146
|
+
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
|
|
147
|
+
if (children._isReactElement) {
|
|
148
|
+
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
|
|
149
|
+
}
|
|
146
150
|
if (ReactCurrentOwner.current) {
|
|
147
151
|
var name = ReactCurrentOwner.current.getName();
|
|
148
152
|
if (name) {
|
|
149
|
-
addendum
|
|
153
|
+
addendum += ' Check the render method of `' + name + '`.';
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
|
-
|
|
157
|
+
var childrenString = String(children);
|
|
158
|
+
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
|
|
154
159
|
}
|
|
155
160
|
}
|
|
156
161
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react",
|
|
3
3
|
"description": "React is a JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react"
|
|
7
7
|
],
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"files": [
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"PATENTS",
|
|
12
14
|
"addons.js",
|
|
13
15
|
"react.js",
|
|
14
16
|
"addons/",
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
},
|
|
23
25
|
"dependencies": {
|
|
24
26
|
"envify": "^3.0.0",
|
|
25
|
-
"fbjs": "^0.
|
|
27
|
+
"fbjs": "^0.3.1"
|
|
26
28
|
},
|
|
27
29
|
"browserify": {
|
|
28
30
|
"transform": [
|
package/dist/react-dom.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ReactDOM v0.14.0-rc1
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the BSD-style license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
9
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
|
|
13
|
-
;(function(f) {
|
|
14
|
-
// CommonJS
|
|
15
|
-
if (typeof exports === "object" && typeof module !== "undefined") {
|
|
16
|
-
module.exports = f(require('react'));
|
|
17
|
-
|
|
18
|
-
// RequireJS
|
|
19
|
-
} else if (typeof define === "function" && define.amd) {
|
|
20
|
-
define(['react'], f);
|
|
21
|
-
|
|
22
|
-
// <script>
|
|
23
|
-
} else {
|
|
24
|
-
var g
|
|
25
|
-
if (typeof window !== "undefined") {
|
|
26
|
-
g = window;
|
|
27
|
-
} else if (typeof global !== "undefined") {
|
|
28
|
-
g = global;
|
|
29
|
-
} else if (typeof self !== "undefined") {
|
|
30
|
-
g = self;
|
|
31
|
-
} else {
|
|
32
|
-
// works providing we're not in "use strict";
|
|
33
|
-
// needed for Java 8 Nashorn
|
|
34
|
-
// see https://github.com/facebook/react/issues/3037
|
|
35
|
-
g = this;
|
|
36
|
-
}
|
|
37
|
-
g.ReactDOM = f(g.React);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
})(function(React) {
|
|
41
|
-
return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
42
|
-
});
|
package/dist/react-dom.min.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ReactDOM v0.14.0-rc1
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the BSD-style license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
9
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var f;f="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,f.ReactDOM=e(f.React)}}(function(e){return e.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED});
|
package/lib/joinClasses.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule joinClasses
|
|
10
|
-
* @typechecks static-only
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Combines multiple className strings into one.
|
|
17
|
-
* http://jsperf.com/joinclasses-args-vs-array
|
|
18
|
-
*
|
|
19
|
-
* @param {...?string} className
|
|
20
|
-
* @return {string}
|
|
21
|
-
*/
|
|
22
|
-
function joinClasses(className /*, ... */) {
|
|
23
|
-
if (!className) {
|
|
24
|
-
className = '';
|
|
25
|
-
}
|
|
26
|
-
var nextClass;
|
|
27
|
-
var argLength = arguments.length;
|
|
28
|
-
if (argLength > 1) {
|
|
29
|
-
for (var ii = 1; ii < argLength; ii++) {
|
|
30
|
-
nextClass = arguments[ii];
|
|
31
|
-
if (nextClass) {
|
|
32
|
-
className = (className ? className + ' ' : '') + nextClass;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return className;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
module.exports = joinClasses;
|
package/lib/memoizeStringOnly.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule memoizeStringOnly
|
|
10
|
-
* @typechecks static-only
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Memoizes the return value of a function that accepts one string argument.
|
|
17
|
-
*
|
|
18
|
-
* @param {function} callback
|
|
19
|
-
* @return {function}
|
|
20
|
-
*/
|
|
21
|
-
function memoizeStringOnly(callback) {
|
|
22
|
-
var cache = {};
|
|
23
|
-
return function (string) {
|
|
24
|
-
if (!cache.hasOwnProperty(string)) {
|
|
25
|
-
cache[string] = callback.call(this, string);
|
|
26
|
-
}
|
|
27
|
-
return cache[string];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
module.exports = memoizeStringOnly;
|