react 0.11.2 → 0.12.2
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/dist/JSXTransformer.js +2714 -7859
- package/dist/react-with-addons.js +3139 -3593
- package/dist/react-with-addons.min.js +11 -17
- package/dist/react.js +2940 -3308
- package/dist/react.min.js +11 -16
- package/lib/AutoFocusMixin.js +5 -12
- package/lib/BeforeInputEventPlugin.js +12 -14
- package/lib/CSSCore.js +6 -13
- package/lib/CSSProperty.js +10 -14
- package/lib/CSSPropertyOperations.js +46 -12
- package/lib/CallbackQueue.js +7 -14
- package/lib/ChangeEventPlugin.js +5 -12
- package/lib/ClientReactRootIndex.js +5 -12
- package/lib/CompositionEventPlugin.js +5 -12
- package/lib/DOMChildrenOperations.js +8 -15
- package/lib/DOMProperty.js +16 -19
- package/lib/DOMPropertyOperations.js +14 -14
- package/lib/Danger.js +12 -17
- package/lib/DefaultEventPluginOrder.js +5 -12
- package/lib/EnterLeaveEventPlugin.js +5 -12
- package/lib/EventConstants.js +5 -12
- package/lib/EventListener.js +14 -0
- package/lib/EventPluginHub.js +8 -26
- package/lib/EventPluginRegistry.js +5 -12
- package/lib/EventPluginUtils.js +5 -12
- package/lib/EventPropagators.js +12 -17
- package/lib/ExecutionEnvironment.js +5 -12
- package/lib/HTMLDOMPropertyConfig.js +16 -15
- package/lib/LinkedStateMixin.js +5 -12
- package/lib/LinkedValueUtils.js +5 -12
- package/lib/LocalEventTrapMixin.js +8 -14
- package/lib/MobileSafariClickEventPlugin.js +5 -12
- package/lib/Object.assign.js +45 -0
- package/lib/PooledClass.js +5 -12
- package/lib/React.js +87 -54
- package/lib/ReactBrowserComponentMixin.js +5 -12
- package/lib/ReactBrowserEventEmitter.js +7 -14
- package/lib/ReactCSSTransitionGroup.js +15 -17
- package/lib/ReactCSSTransitionGroupChild.js +9 -13
- package/lib/ReactChildren.js +5 -12
- package/lib/ReactComponent.js +61 -68
- package/lib/ReactComponentBrowserEnvironment.js +5 -12
- package/lib/ReactComponentWithPureRenderMixin.js +5 -12
- package/lib/ReactCompositeComponent.js +191 -180
- package/lib/ReactContext.js +8 -15
- package/lib/ReactCurrentOwner.js +5 -12
- package/lib/ReactDOM.js +145 -177
- package/lib/ReactDOMButton.js +8 -14
- package/lib/ReactDOMComponent.js +103 -38
- package/lib/ReactDOMForm.js +9 -15
- package/lib/ReactDOMIDOperations.js +5 -12
- package/lib/ReactDOMImg.js +8 -14
- package/lib/ReactDOMInput.js +30 -38
- package/lib/ReactDOMOption.js +8 -14
- package/lib/ReactDOMSelect.js +25 -24
- package/lib/ReactDOMSelection.js +11 -18
- package/lib/ReactDOMTextarea.js +19 -24
- package/lib/ReactDefaultBatchingStrategy.js +14 -18
- package/lib/ReactDefaultInjection.js +23 -26
- package/lib/ReactDefaultPerf.js +14 -17
- package/lib/ReactDefaultPerfAnalysis.js +18 -17
- package/lib/ReactElement.js +242 -0
- package/lib/{ReactDescriptorValidator.js → ReactElementValidator.js} +51 -56
- package/lib/ReactEmptyComponent.js +8 -13
- package/lib/ReactErrorUtils.js +5 -12
- package/lib/ReactEventEmitterMixin.js +5 -12
- package/lib/ReactEventListener.js +7 -14
- package/lib/ReactInjection.js +7 -14
- package/lib/ReactInputSelection.js +5 -12
- package/lib/ReactInstanceHandles.js +5 -12
- package/lib/ReactLegacyElement.js +243 -0
- package/lib/ReactLink.js +5 -12
- package/lib/ReactMarkupChecksum.js +5 -12
- package/lib/ReactMount.js +45 -32
- package/lib/ReactMultiChild.js +14 -18
- package/lib/ReactMultiChildUpdateTypes.js +5 -12
- package/lib/ReactNativeComponent.js +69 -0
- package/lib/ReactOwner.js +5 -12
- package/lib/ReactPerf.js +8 -13
- package/lib/ReactPropTransferer.js +34 -33
- package/lib/ReactPropTypeLocationNames.js +5 -12
- package/lib/ReactPropTypeLocations.js +5 -12
- package/lib/ReactPropTypes.js +38 -29
- package/lib/ReactPutListenerQueue.js +7 -14
- package/lib/ReactReconcileTransaction.js +7 -15
- package/lib/ReactRootIndex.js +5 -12
- package/lib/ReactServerRendering.js +21 -34
- package/lib/ReactServerRenderingTransaction.js +11 -15
- package/lib/ReactStateSetters.js +5 -12
- package/lib/ReactTestUtils.js +31 -33
- package/lib/ReactTextComponent.js +18 -21
- package/lib/ReactTransitionChildMapping.js +6 -13
- package/lib/ReactTransitionEvents.js +5 -12
- package/lib/ReactTransitionGroup.js +14 -17
- package/lib/ReactUpdates.js +43 -22
- package/lib/ReactWithAddons.js +7 -13
- package/lib/SVGDOMPropertyConfig.js +5 -12
- package/lib/SelectEventPlugin.js +13 -20
- package/lib/ServerReactRootIndex.js +5 -12
- package/lib/SimpleEventPlugin.js +20 -15
- package/lib/SyntheticClipboardEvent.js +5 -12
- package/lib/SyntheticCompositionEvent.js +5 -12
- package/lib/SyntheticDragEvent.js +5 -12
- package/lib/SyntheticEvent.js +9 -17
- package/lib/SyntheticFocusEvent.js +5 -12
- package/lib/SyntheticInputEvent.js +4 -11
- package/lib/SyntheticKeyboardEvent.js +17 -19
- package/lib/SyntheticMouseEvent.js +5 -12
- package/lib/SyntheticTouchEvent.js +5 -12
- package/lib/SyntheticUIEvent.js +5 -12
- package/lib/SyntheticWheelEvent.js +5 -12
- package/lib/Transaction.js +5 -12
- package/lib/ViewportMetrics.js +5 -12
- package/lib/accumulateInto.js +62 -0
- package/lib/adler32.js +6 -13
- package/lib/camelize.js +30 -0
- package/lib/camelizeStyleName.js +40 -0
- package/lib/cloneWithProps.js +9 -15
- package/lib/containsNode.js +5 -12
- package/lib/copyProperties.js +12 -12
- package/lib/createArrayFrom.js +5 -12
- package/lib/createFullPageComponent.js +12 -18
- package/lib/createNodesFromMarkup.js +5 -12
- package/lib/cx.js +5 -12
- package/lib/dangerousStyleValue.js +5 -12
- package/lib/deprecated.js +47 -0
- package/lib/emptyFunction.js +11 -22
- package/lib/emptyObject.js +5 -12
- package/lib/escapeTextForBrowser.js +5 -12
- package/lib/flattenChildren.js +19 -13
- package/lib/focusNode.js +10 -16
- package/lib/forEachAccumulated.js +5 -12
- package/lib/getActiveElement.js +5 -12
- package/lib/getEventCharCode.js +50 -0
- package/lib/getEventKey.js +9 -21
- package/lib/getEventModifierState.js +4 -11
- package/lib/getEventTarget.js +5 -12
- package/lib/getMarkupWrap.js +5 -12
- package/lib/getNodeForCharacterOffset.js +5 -12
- package/lib/getReactRootElementInContainer.js +5 -12
- package/lib/getTextContentAccessor.js +5 -12
- package/lib/getUnboundedScrollPosition.js +5 -12
- package/lib/hyphenate.js +5 -12
- package/lib/hyphenateStyleName.js +8 -15
- package/lib/instantiateReactComponent.js +90 -42
- package/lib/invariant.js +5 -12
- package/lib/isEventSupported.js +5 -12
- package/lib/isNode.js +5 -12
- package/lib/isTextInputElement.js +5 -12
- package/lib/isTextNode.js +5 -12
- package/lib/joinClasses.js +8 -13
- package/lib/keyMirror.js +5 -12
- package/lib/keyOf.js +5 -12
- package/lib/mapObject.js +35 -36
- package/lib/memoizeStringOnly.js +5 -12
- package/lib/merge.js +14 -17
- package/lib/mergeInto.js +13 -35
- package/lib/monitorCodeUse.js +5 -12
- package/lib/onlyChild.js +8 -15
- package/lib/performance.js +5 -12
- package/lib/performanceNow.js +5 -12
- package/lib/setInnerHTML.js +10 -19
- package/lib/shallowEqual.js +6 -13
- package/lib/shouldUpdateReactComponent.js +14 -22
- package/lib/toArray.js +5 -12
- package/lib/traverseAllChildren.js +34 -48
- package/lib/update.js +8 -15
- package/lib/warning.js +6 -13
- package/package.json +3 -8
- package/lib/ReactDescriptor.js +0 -251
- package/lib/accumulate.js +0 -54
- package/lib/mergeHelpers.js +0 -147
- package/lib/mixInto.js +0 -34
package/lib/ReactDOMOption.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDOMOption
|
|
17
10
|
*/
|
|
@@ -20,12 +13,13 @@
|
|
|
20
13
|
|
|
21
14
|
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
22
15
|
var ReactCompositeComponent = require("./ReactCompositeComponent");
|
|
16
|
+
var ReactElement = require("./ReactElement");
|
|
23
17
|
var ReactDOM = require("./ReactDOM");
|
|
24
18
|
|
|
25
19
|
var warning = require("./warning");
|
|
26
20
|
|
|
27
|
-
// Store a reference to the <option> `ReactDOMComponent`.
|
|
28
|
-
var option = ReactDOM.option;
|
|
21
|
+
// Store a reference to the <option> `ReactDOMComponent`. TODO: use string
|
|
22
|
+
var option = ReactElement.createFactory(ReactDOM.option.type);
|
|
29
23
|
|
|
30
24
|
/**
|
|
31
25
|
* Implements an <option> native component that warns when `selected` is set.
|
package/lib/ReactDOMSelect.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDOMSelect
|
|
17
10
|
*/
|
|
@@ -22,12 +15,22 @@ var AutoFocusMixin = require("./AutoFocusMixin");
|
|
|
22
15
|
var LinkedValueUtils = require("./LinkedValueUtils");
|
|
23
16
|
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
24
17
|
var ReactCompositeComponent = require("./ReactCompositeComponent");
|
|
18
|
+
var ReactElement = require("./ReactElement");
|
|
25
19
|
var ReactDOM = require("./ReactDOM");
|
|
20
|
+
var ReactUpdates = require("./ReactUpdates");
|
|
21
|
+
|
|
22
|
+
var assign = require("./Object.assign");
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
// Store a reference to the <select> `ReactDOMComponent`. TODO: use string
|
|
25
|
+
var select = ReactElement.createFactory(ReactDOM.select.type);
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
function updateWithPendingValueIfMounted() {
|
|
28
|
+
/*jshint validthis:true */
|
|
29
|
+
if (this.isMounted()) {
|
|
30
|
+
this.setState({value: this._pendingValue});
|
|
31
|
+
this._pendingValue = 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* Validation function for `value` and `defaultValue`.
|
|
@@ -114,6 +117,10 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
|
|
|
114
117
|
return {value: this.props.defaultValue || (this.props.multiple ? [] : '')};
|
|
115
118
|
},
|
|
116
119
|
|
|
120
|
+
componentWillMount: function() {
|
|
121
|
+
this._pendingValue = null;
|
|
122
|
+
},
|
|
123
|
+
|
|
117
124
|
componentWillReceiveProps: function(nextProps) {
|
|
118
125
|
if (!this.props.multiple && nextProps.multiple) {
|
|
119
126
|
this.setState({value: [this.state.value]});
|
|
@@ -122,14 +129,9 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
|
|
|
122
129
|
}
|
|
123
130
|
},
|
|
124
131
|
|
|
125
|
-
shouldComponentUpdate: function() {
|
|
126
|
-
// Defer any updates to this component during the `onChange` handler.
|
|
127
|
-
return !this._isChanging;
|
|
128
|
-
},
|
|
129
|
-
|
|
130
132
|
render: function() {
|
|
131
133
|
// Clone `this.props` so we don't mutate the input.
|
|
132
|
-
var props =
|
|
134
|
+
var props = assign({}, this.props);
|
|
133
135
|
|
|
134
136
|
props.onChange = this._handleChange;
|
|
135
137
|
props.value = null;
|
|
@@ -154,9 +156,7 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
|
|
|
154
156
|
var returnValue;
|
|
155
157
|
var onChange = LinkedValueUtils.getOnChange(this);
|
|
156
158
|
if (onChange) {
|
|
157
|
-
this._isChanging = true;
|
|
158
159
|
returnValue = onChange.call(this, event);
|
|
159
|
-
this._isChanging = false;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
var selectedValue;
|
|
@@ -172,7 +172,8 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
|
|
|
172
172
|
selectedValue = event.target.value;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
this.
|
|
175
|
+
this._pendingValue = selectedValue;
|
|
176
|
+
ReactUpdates.asap(updateWithPendingValueIfMounted, this);
|
|
176
177
|
return returnValue;
|
|
177
178
|
}
|
|
178
179
|
|
package/lib/ReactDOMSelection.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDOMSelection
|
|
17
10
|
*/
|
|
@@ -70,9 +63,9 @@ function getIEOffsets(node) {
|
|
|
70
63
|
* @return {?object}
|
|
71
64
|
*/
|
|
72
65
|
function getModernOffsets(node) {
|
|
73
|
-
var selection = window.getSelection();
|
|
66
|
+
var selection = window.getSelection && window.getSelection();
|
|
74
67
|
|
|
75
|
-
if (selection.rangeCount === 0) {
|
|
68
|
+
if (!selection || selection.rangeCount === 0) {
|
|
76
69
|
return null;
|
|
77
70
|
}
|
|
78
71
|
|
|
@@ -114,7 +107,6 @@ function getModernOffsets(node) {
|
|
|
114
107
|
detectionRange.setStart(anchorNode, anchorOffset);
|
|
115
108
|
detectionRange.setEnd(focusNode, focusOffset);
|
|
116
109
|
var isBackward = detectionRange.collapsed;
|
|
117
|
-
detectionRange.detach();
|
|
118
110
|
|
|
119
111
|
return {
|
|
120
112
|
start: isBackward ? end : start,
|
|
@@ -161,8 +153,11 @@ function setIEOffsets(node, offsets) {
|
|
|
161
153
|
* @param {object} offsets
|
|
162
154
|
*/
|
|
163
155
|
function setModernOffsets(node, offsets) {
|
|
164
|
-
|
|
156
|
+
if (!window.getSelection) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
165
159
|
|
|
160
|
+
var selection = window.getSelection();
|
|
166
161
|
var length = node[getTextContentAccessor()].length;
|
|
167
162
|
var start = Math.min(offsets.start, length);
|
|
168
163
|
var end = typeof offsets.end === 'undefined' ?
|
|
@@ -191,8 +186,6 @@ function setModernOffsets(node, offsets) {
|
|
|
191
186
|
range.setEnd(endMarker.node, endMarker.offset);
|
|
192
187
|
selection.addRange(range);
|
|
193
188
|
}
|
|
194
|
-
|
|
195
|
-
range.detach();
|
|
196
189
|
}
|
|
197
190
|
}
|
|
198
191
|
|
package/lib/ReactDOMTextarea.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDOMTextarea
|
|
17
10
|
*/
|
|
@@ -23,15 +16,24 @@ var DOMPropertyOperations = require("./DOMPropertyOperations");
|
|
|
23
16
|
var LinkedValueUtils = require("./LinkedValueUtils");
|
|
24
17
|
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
25
18
|
var ReactCompositeComponent = require("./ReactCompositeComponent");
|
|
19
|
+
var ReactElement = require("./ReactElement");
|
|
26
20
|
var ReactDOM = require("./ReactDOM");
|
|
21
|
+
var ReactUpdates = require("./ReactUpdates");
|
|
27
22
|
|
|
23
|
+
var assign = require("./Object.assign");
|
|
28
24
|
var invariant = require("./invariant");
|
|
29
|
-
var merge = require("./merge");
|
|
30
25
|
|
|
31
26
|
var warning = require("./warning");
|
|
32
27
|
|
|
33
|
-
// Store a reference to the <textarea> `ReactDOMComponent`.
|
|
34
|
-
var textarea = ReactDOM.textarea;
|
|
28
|
+
// Store a reference to the <textarea> `ReactDOMComponent`. TODO: use string
|
|
29
|
+
var textarea = ReactElement.createFactory(ReactDOM.textarea.type);
|
|
30
|
+
|
|
31
|
+
function forceUpdateIfMounted() {
|
|
32
|
+
/*jshint validthis:true */
|
|
33
|
+
if (this.isMounted()) {
|
|
34
|
+
this.forceUpdate();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
39
|
* Implements a <textarea> native component that allows setting `value`, and
|
|
@@ -92,14 +94,9 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
|
|
|
92
94
|
};
|
|
93
95
|
},
|
|
94
96
|
|
|
95
|
-
shouldComponentUpdate: function() {
|
|
96
|
-
// Defer any updates to this component during the `onChange` handler.
|
|
97
|
-
return !this._isChanging;
|
|
98
|
-
},
|
|
99
|
-
|
|
100
97
|
render: function() {
|
|
101
98
|
// Clone `this.props` so we don't mutate the input.
|
|
102
|
-
var props =
|
|
99
|
+
var props = assign({}, this.props);
|
|
103
100
|
|
|
104
101
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
105
102
|
props.dangerouslySetInnerHTML == null,
|
|
@@ -129,11 +126,9 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
|
|
|
129
126
|
var returnValue;
|
|
130
127
|
var onChange = LinkedValueUtils.getOnChange(this);
|
|
131
128
|
if (onChange) {
|
|
132
|
-
this._isChanging = true;
|
|
133
129
|
returnValue = onChange.call(this, event);
|
|
134
|
-
this._isChanging = false;
|
|
135
130
|
}
|
|
136
|
-
|
|
131
|
+
ReactUpdates.asap(forceUpdateIfMounted, this);
|
|
137
132
|
return returnValue;
|
|
138
133
|
}
|
|
139
134
|
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDefaultBatchingStrategy
|
|
17
10
|
*/
|
|
@@ -21,8 +14,8 @@
|
|
|
21
14
|
var ReactUpdates = require("./ReactUpdates");
|
|
22
15
|
var Transaction = require("./Transaction");
|
|
23
16
|
|
|
17
|
+
var assign = require("./Object.assign");
|
|
24
18
|
var emptyFunction = require("./emptyFunction");
|
|
25
|
-
var mixInto = require("./mixInto");
|
|
26
19
|
|
|
27
20
|
var RESET_BATCHED_UPDATES = {
|
|
28
21
|
initialize: emptyFunction,
|
|
@@ -42,12 +35,15 @@ function ReactDefaultBatchingStrategyTransaction() {
|
|
|
42
35
|
this.reinitializeTransaction();
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
assign(
|
|
39
|
+
ReactDefaultBatchingStrategyTransaction.prototype,
|
|
40
|
+
Transaction.Mixin,
|
|
41
|
+
{
|
|
42
|
+
getTransactionWrappers: function() {
|
|
43
|
+
return TRANSACTION_WRAPPERS;
|
|
44
|
+
}
|
|
49
45
|
}
|
|
50
|
-
|
|
46
|
+
);
|
|
51
47
|
|
|
52
48
|
var transaction = new ReactDefaultBatchingStrategyTransaction();
|
|
53
49
|
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDefaultInjection
|
|
17
10
|
*/
|
|
@@ -31,7 +24,7 @@ var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
|
31
24
|
var ReactComponentBrowserEnvironment =
|
|
32
25
|
require("./ReactComponentBrowserEnvironment");
|
|
33
26
|
var ReactDefaultBatchingStrategy = require("./ReactDefaultBatchingStrategy");
|
|
34
|
-
var
|
|
27
|
+
var ReactDOMComponent = require("./ReactDOMComponent");
|
|
35
28
|
var ReactDOMButton = require("./ReactDOMButton");
|
|
36
29
|
var ReactDOMForm = require("./ReactDOMForm");
|
|
37
30
|
var ReactDOMImg = require("./ReactDOMImg");
|
|
@@ -76,18 +69,22 @@ function inject() {
|
|
|
76
69
|
BeforeInputEventPlugin: BeforeInputEventPlugin
|
|
77
70
|
});
|
|
78
71
|
|
|
79
|
-
ReactInjection.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
ReactInjection.NativeComponent.injectGenericComponentClass(
|
|
73
|
+
ReactDOMComponent
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
ReactInjection.NativeComponent.injectComponentClasses({
|
|
77
|
+
'button': ReactDOMButton,
|
|
78
|
+
'form': ReactDOMForm,
|
|
79
|
+
'img': ReactDOMImg,
|
|
80
|
+
'input': ReactDOMInput,
|
|
81
|
+
'option': ReactDOMOption,
|
|
82
|
+
'select': ReactDOMSelect,
|
|
83
|
+
'textarea': ReactDOMTextarea,
|
|
84
|
+
|
|
85
|
+
'html': createFullPageComponent('html'),
|
|
86
|
+
'head': createFullPageComponent('head'),
|
|
87
|
+
'body': createFullPageComponent('body')
|
|
91
88
|
});
|
|
92
89
|
|
|
93
90
|
// This needs to happen after createFullPageComponent() otherwise the mixin
|
|
@@ -97,7 +94,7 @@ function inject() {
|
|
|
97
94
|
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
|
|
98
95
|
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
|
|
99
96
|
|
|
100
|
-
ReactInjection.EmptyComponent.injectEmptyComponent(
|
|
97
|
+
ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
|
|
101
98
|
|
|
102
99
|
ReactInjection.Updates.injectReconcileTransaction(
|
|
103
100
|
ReactComponentBrowserEnvironment.ReactReconcileTransaction
|
package/lib/ReactDefaultPerf.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ReactDefaultPerf
|
|
17
10
|
* @typechecks static-only
|
|
@@ -90,19 +83,23 @@ var ReactDefaultPerf = {
|
|
|
90
83
|
);
|
|
91
84
|
},
|
|
92
85
|
|
|
93
|
-
|
|
94
|
-
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
86
|
+
getMeasurementsSummaryMap: function(measurements) {
|
|
95
87
|
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(
|
|
96
88
|
measurements,
|
|
97
89
|
true
|
|
98
90
|
);
|
|
99
|
-
|
|
91
|
+
return summary.map(function(item) {
|
|
100
92
|
return {
|
|
101
93
|
'Owner > component': item.componentName,
|
|
102
94
|
'Wasted time (ms)': item.time,
|
|
103
95
|
'Instances': item.count
|
|
104
96
|
};
|
|
105
|
-
})
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
printWasted: function(measurements) {
|
|
101
|
+
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
102
|
+
console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
|
|
106
103
|
console.log(
|
|
107
104
|
'Total time:',
|
|
108
105
|
ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
|
|
@@ -140,7 +137,7 @@ var ReactDefaultPerf = {
|
|
|
140
137
|
},
|
|
141
138
|
|
|
142
139
|
measure: function(moduleName, fnName, func) {
|
|
143
|
-
return function() {var args=
|
|
140
|
+
return function() {for (var args=[],$__0=0,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
|
|
144
141
|
var totalTime;
|
|
145
142
|
var rv;
|
|
146
143
|
var start;
|