react 0.12.2 → 0.13.0-beta.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 +986 -511
- package/dist/react-with-addons.js +6076 -4560
- package/dist/react-with-addons.min.js +6 -7
- package/dist/react.js +5386 -4170
- package/dist/react.min.js +6 -7
- package/lib/AutoFocusMixin.js +2 -2
- package/lib/BeforeInputEventPlugin.js +388 -115
- package/lib/CSSCore.js +1 -1
- package/lib/CSSProperty.js +2 -2
- package/lib/CSSPropertyOperations.js +58 -11
- package/lib/CallbackQueue.js +3 -3
- package/lib/ChangeEventPlugin.js +4 -4
- package/lib/ClientReactRootIndex.js +2 -2
- package/lib/DOMChildrenOperations.js +10 -47
- package/lib/DOMProperty.js +2 -2
- package/lib/DOMPropertyOperations.js +11 -16
- package/lib/Danger.js +8 -7
- package/lib/DefaultEventPluginOrder.js +3 -4
- package/lib/EnterLeaveEventPlugin.js +2 -2
- package/lib/EventConstants.js +2 -2
- package/lib/EventListener.js +1 -1
- package/lib/EventPluginHub.js +10 -8
- package/lib/EventPluginRegistry.js +2 -2
- package/lib/EventPluginUtils.js +4 -4
- package/lib/EventPropagators.js +2 -2
- package/lib/ExecutionEnvironment.js +3 -4
- package/lib/FallbackCompositionState.js +89 -0
- package/lib/HTMLDOMPropertyConfig.js +23 -10
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +4 -4
- package/lib/LocalEventTrapMixin.js +10 -3
- package/lib/MobileSafariClickEventPlugin.js +2 -2
- package/lib/Object.assign.js +4 -2
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +19 -58
- package/lib/ReactBrowserComponentMixin.js +4 -14
- package/lib/ReactBrowserEventEmitter.js +6 -8
- package/lib/ReactCSSTransitionGroup.js +5 -2
- package/lib/ReactCSSTransitionGroupChild.js +20 -7
- package/lib/ReactChildReconciler.js +125 -0
- package/lib/ReactChildren.js +13 -10
- package/lib/ReactClass.js +918 -0
- package/lib/ReactComponent.js +98 -406
- package/lib/ReactComponentBrowserEnvironment.js +11 -84
- package/lib/ReactComponentEnvironment.js +57 -0
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +574 -1140
- package/lib/ReactContext.js +17 -3
- package/lib/ReactCurrentOwner.js +2 -2
- package/lib/ReactDOM.js +4 -9
- package/lib/ReactDOMButton.js +6 -7
- package/lib/ReactDOMComponent.js +123 -105
- package/lib/ReactDOMForm.js +6 -7
- package/lib/ReactDOMIDOperations.js +59 -77
- package/lib/ReactDOMIframe.js +43 -0
- package/lib/ReactDOMImg.js +5 -7
- package/lib/ReactDOMInput.js +6 -7
- package/lib/ReactDOMOption.js +6 -7
- package/lib/ReactDOMSelect.js +58 -66
- package/lib/ReactDOMSelection.js +7 -3
- package/lib/{ReactTextComponent.js → ReactDOMTextComponent.js} +48 -37
- package/lib/ReactDOMTextarea.js +6 -7
- package/lib/ReactDefaultBatchingStrategy.js +5 -5
- package/lib/ReactDefaultInjection.js +39 -9
- package/lib/ReactDefaultPerf.js +17 -8
- package/lib/ReactDefaultPerfAnalysis.js +2 -2
- package/lib/ReactElement.js +23 -15
- package/lib/ReactElementValidator.js +206 -89
- package/lib/ReactEmptyComponent.js +33 -15
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +2 -2
- package/lib/ReactEventListener.js +4 -5
- package/lib/ReactFragment.js +172 -0
- package/lib/ReactInjection.js +8 -6
- package/lib/ReactInputSelection.js +4 -5
- package/lib/ReactInstanceHandles.js +4 -3
- package/lib/ReactInstanceMap.js +47 -0
- package/lib/ReactLifeCycle.js +35 -0
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +2 -2
- package/lib/ReactMount.js +264 -71
- package/lib/ReactMultiChild.js +50 -48
- package/lib/ReactMultiChildUpdateTypes.js +2 -2
- package/lib/ReactNativeComponent.js +59 -25
- package/lib/ReactOwner.js +5 -49
- package/lib/ReactPerf.js +22 -2
- package/lib/ReactPropTransferer.js +3 -58
- package/lib/ReactPropTypeLocationNames.js +2 -2
- package/lib/ReactPropTypeLocations.js +2 -2
- package/lib/ReactPropTypes.js +17 -25
- package/lib/ReactPutListenerQueue.js +2 -2
- package/lib/ReactReconcileTransaction.js +2 -2
- package/lib/ReactReconciler.js +121 -0
- package/lib/ReactRef.js +69 -0
- package/lib/ReactRootIndex.js +2 -2
- package/lib/ReactServerRendering.js +6 -4
- package/lib/ReactServerRenderingTransaction.js +2 -2
- package/lib/ReactStateSetters.js +2 -2
- package/lib/ReactTestUtils.js +113 -27
- package/lib/ReactTransitionChildMapping.js +8 -4
- package/lib/ReactTransitionEvents.js +2 -2
- package/lib/ReactTransitionGroup.js +53 -12
- package/lib/ReactUpdateQueue.js +295 -0
- package/lib/ReactUpdates.js +54 -62
- package/lib/ReactWithAddons.js +4 -2
- package/lib/SVGDOMPropertyConfig.js +2 -2
- package/lib/SelectEventPlugin.js +4 -4
- package/lib/ServerReactRootIndex.js +2 -2
- package/lib/SimpleEventPlugin.js +4 -4
- package/lib/SyntheticClipboardEvent.js +2 -3
- package/lib/SyntheticCompositionEvent.js +2 -3
- package/lib/SyntheticDragEvent.js +2 -2
- package/lib/SyntheticEvent.js +12 -4
- package/lib/SyntheticFocusEvent.js +2 -2
- package/lib/SyntheticInputEvent.js +2 -3
- package/lib/SyntheticKeyboardEvent.js +2 -2
- package/lib/SyntheticMouseEvent.js +3 -5
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +2 -2
- package/lib/Transaction.js +4 -4
- package/lib/ViewportMetrics.js +3 -6
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +2 -2
- package/lib/camelize.js +1 -1
- package/lib/camelizeStyleName.js +1 -1
- package/lib/cloneWithProps.js +4 -4
- package/lib/containsNode.js +1 -1
- package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
- package/lib/createFullPageComponent.js +4 -4
- package/lib/createNodesFromMarkup.js +4 -4
- package/lib/cx.js +1 -1
- package/lib/dangerousStyleValue.js +2 -2
- package/lib/emptyFunction.js +1 -1
- package/lib/emptyObject.js +1 -1
- package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +10 -11
- package/lib/findDOMNode.js +51 -0
- package/lib/flattenChildren.js +12 -23
- package/lib/focusNode.js +1 -1
- package/lib/forEachAccumulated.js +2 -2
- package/lib/getActiveElement.js +1 -1
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +2 -2
- package/lib/getEventModifierState.js +2 -2
- package/lib/getEventTarget.js +2 -2
- package/lib/getIteratorFn.js +42 -0
- package/lib/getMarkupWrap.js +1 -1
- package/lib/getNodeForCharacterOffset.js +3 -3
- package/lib/getReactRootElementInContainer.js +2 -2
- package/lib/getTextContentAccessor.js +2 -2
- package/lib/getUnboundedScrollPosition.js +1 -1
- package/lib/hyphenate.js +1 -1
- package/lib/hyphenateStyleName.js +1 -1
- package/lib/instantiateReactComponent.js +90 -68
- package/lib/invariant.js +1 -1
- package/lib/isEventSupported.js +2 -2
- package/lib/isNode.js +4 -5
- package/lib/isTextInputElement.js +3 -4
- package/lib/isTextNode.js +1 -1
- package/lib/joinClasses.js +2 -2
- package/lib/keyMirror.js +2 -2
- package/lib/keyOf.js +1 -1
- package/lib/mapObject.js +1 -1
- package/lib/memoizeStringOnly.js +5 -6
- package/lib/onlyChild.js +2 -2
- package/lib/performance.js +1 -1
- package/lib/performanceNow.js +1 -1
- package/lib/quoteAttributeValueForBrowser.js +26 -0
- package/lib/setInnerHTML.js +13 -2
- package/lib/setTextContent.js +40 -0
- package/lib/shallowEqual.js +2 -2
- package/lib/shouldUpdateReactComponent.js +71 -7
- package/lib/toArray.js +2 -2
- package/lib/traverseAllChildren.js +114 -56
- package/lib/update.js +2 -2
- package/lib/warning.js +20 -2
- package/package.json +1 -1
- package/lib/CompositionEventPlugin.js +0 -257
- package/lib/ReactLegacyElement.js +0 -243
- package/lib/copyProperties.js +0 -54
- package/lib/deprecated.js +0 -47
- package/lib/merge.js +0 -34
- package/lib/mergeInto.js +0 -24
- package/lib/monitorCodeUse.js +0 -30
package/lib/CSSCore.js
CHANGED
package/lib/CSSProperty.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule CSSProperty
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* CSS properties which accept numbers but are not in units of "px".
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var CSSProperty = require("./CSSProperty");
|
|
16
16
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
@@ -34,7 +34,14 @@ if (ExecutionEnvironment.canUseDOM) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if ("production" !== process.env.NODE_ENV) {
|
|
37
|
+
// 'msTransform' is correct, but the other prefixes should be capitalized
|
|
38
|
+
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
|
39
|
+
|
|
40
|
+
// style values shouldn't contain a semicolon
|
|
41
|
+
var badStyleValueWithSemicolonPattern = /;\s*$/;
|
|
42
|
+
|
|
37
43
|
var warnedStyleNames = {};
|
|
44
|
+
var warnedStyleValues = {};
|
|
38
45
|
|
|
39
46
|
var warnHyphenatedStyleName = function(name) {
|
|
40
47
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
@@ -44,10 +51,54 @@ if ("production" !== process.env.NODE_ENV) {
|
|
|
44
51
|
warnedStyleNames[name] = true;
|
|
45
52
|
("production" !== process.env.NODE_ENV ? warning(
|
|
46
53
|
false,
|
|
47
|
-
'Unsupported style property
|
|
48
|
-
|
|
54
|
+
'Unsupported style property %s. Did you mean %s?',
|
|
55
|
+
name,
|
|
56
|
+
camelizeStyleName(name)
|
|
49
57
|
) : null);
|
|
50
58
|
};
|
|
59
|
+
|
|
60
|
+
var warnBadVendoredStyleName = function(name) {
|
|
61
|
+
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
warnedStyleNames[name] = true;
|
|
66
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
67
|
+
false,
|
|
68
|
+
'Unsupported vendor-prefixed style property %s. Did you mean %s?',
|
|
69
|
+
name,
|
|
70
|
+
name.charAt(0).toUpperCase() + name.slice(1)
|
|
71
|
+
) : null);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var warnStyleValueWithSemicolon = function(name, value) {
|
|
75
|
+
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
warnedStyleValues[value] = true;
|
|
80
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
81
|
+
false,
|
|
82
|
+
'Style property values shouldn\'t contain a semicolon. ' +
|
|
83
|
+
'Try "%s: %s" instead.',
|
|
84
|
+
name,
|
|
85
|
+
value.replace(badStyleValueWithSemicolonPattern, '')
|
|
86
|
+
) : null);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @param {string} name
|
|
91
|
+
* @param {*} value
|
|
92
|
+
*/
|
|
93
|
+
var warnValidStyle = function(name, value) {
|
|
94
|
+
if (name.indexOf('-') > -1) {
|
|
95
|
+
warnHyphenatedStyleName(name);
|
|
96
|
+
} else if (badVendoredStyleNamePattern.test(name)) {
|
|
97
|
+
warnBadVendoredStyleName(name);
|
|
98
|
+
} else if (badStyleValueWithSemicolonPattern.test(value)) {
|
|
99
|
+
warnStyleValueWithSemicolon(name, value);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
51
102
|
}
|
|
52
103
|
|
|
53
104
|
/**
|
|
@@ -73,12 +124,10 @@ var CSSPropertyOperations = {
|
|
|
73
124
|
if (!styles.hasOwnProperty(styleName)) {
|
|
74
125
|
continue;
|
|
75
126
|
}
|
|
127
|
+
var styleValue = styles[styleName];
|
|
76
128
|
if ("production" !== process.env.NODE_ENV) {
|
|
77
|
-
|
|
78
|
-
warnHyphenatedStyleName(styleName);
|
|
79
|
-
}
|
|
129
|
+
warnValidStyle(styleName, styleValue);
|
|
80
130
|
}
|
|
81
|
-
var styleValue = styles[styleName];
|
|
82
131
|
if (styleValue != null) {
|
|
83
132
|
serialized += processStyleName(styleName) + ':';
|
|
84
133
|
serialized += dangerousStyleValue(styleName, styleValue) + ';';
|
|
@@ -101,9 +150,7 @@ var CSSPropertyOperations = {
|
|
|
101
150
|
continue;
|
|
102
151
|
}
|
|
103
152
|
if ("production" !== process.env.NODE_ENV) {
|
|
104
|
-
|
|
105
|
-
warnHyphenatedStyleName(styleName);
|
|
106
|
-
}
|
|
153
|
+
warnValidStyle(styleName, styles[styleName]);
|
|
107
154
|
}
|
|
108
155
|
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
|
|
109
156
|
if (styleName === 'float') {
|
package/lib/CallbackQueue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule CallbackQueue
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var PooledClass = require("./PooledClass");
|
|
15
15
|
|
|
@@ -60,7 +60,7 @@ assign(CallbackQueue.prototype, {
|
|
|
60
60
|
if (callbacks) {
|
|
61
61
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
62
62
|
callbacks.length === contexts.length,
|
|
63
|
-
|
|
63
|
+
'Mismatched list of contexts in callback queue'
|
|
64
64
|
) : invariant(callbacks.length === contexts.length));
|
|
65
65
|
this._callbacks = null;
|
|
66
66
|
this._contexts = null;
|
package/lib/ChangeEventPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule ChangeEventPlugin
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var EventConstants = require("./EventConstants");
|
|
15
15
|
var EventPluginHub = require("./EventPluginHub");
|
|
@@ -65,7 +65,7 @@ var doesChangeEventBubble = false;
|
|
|
65
65
|
if (ExecutionEnvironment.canUseDOM) {
|
|
66
66
|
// See `handleChange` comment below
|
|
67
67
|
doesChangeEventBubble = isEventSupported('change') && (
|
|
68
|
-
!('documentMode' in document) || document.documentMode > 8
|
|
68
|
+
(!('documentMode' in document) || document.documentMode > 8)
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -142,7 +142,7 @@ if (ExecutionEnvironment.canUseDOM) {
|
|
|
142
142
|
// IE9 claims to support the input event but fails to trigger it when
|
|
143
143
|
// deleting text, so we ignore its input events
|
|
144
144
|
isInputEventSupported = isEventSupported('input') && (
|
|
145
|
-
!('documentMode' in document) || document.documentMode > 9
|
|
145
|
+
(!('documentMode' in document) || document.documentMode > 9)
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var nextReactRootIndex = 0;
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,22 +10,14 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var Danger = require("./Danger");
|
|
16
16
|
var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var setTextContent = require("./setTextContent");
|
|
19
19
|
var invariant = require("./invariant");
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* The DOM property to use when setting text content.
|
|
23
|
-
*
|
|
24
|
-
* @type {string}
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
var textContentAccessor = getTextContentAccessor();
|
|
28
|
-
|
|
29
21
|
/**
|
|
30
22
|
* Inserts `childNode` as a child of `parentNode` at the `index`.
|
|
31
23
|
*
|
|
@@ -45,37 +37,6 @@ function insertChildAt(parentNode, childNode, index) {
|
|
|
45
37
|
);
|
|
46
38
|
}
|
|
47
39
|
|
|
48
|
-
var updateTextContent;
|
|
49
|
-
if (textContentAccessor === 'textContent') {
|
|
50
|
-
/**
|
|
51
|
-
* Sets the text content of `node` to `text`.
|
|
52
|
-
*
|
|
53
|
-
* @param {DOMElement} node Node to change
|
|
54
|
-
* @param {string} text New text content
|
|
55
|
-
*/
|
|
56
|
-
updateTextContent = function(node, text) {
|
|
57
|
-
node.textContent = text;
|
|
58
|
-
};
|
|
59
|
-
} else {
|
|
60
|
-
/**
|
|
61
|
-
* Sets the text content of `node` to `text`.
|
|
62
|
-
*
|
|
63
|
-
* @param {DOMElement} node Node to change
|
|
64
|
-
* @param {string} text New text content
|
|
65
|
-
*/
|
|
66
|
-
updateTextContent = function(node, text) {
|
|
67
|
-
// In order to preserve newlines correctly, we can't use .innerText to set
|
|
68
|
-
// the contents (see #1080), so we empty the element then append a text node
|
|
69
|
-
while (node.firstChild) {
|
|
70
|
-
node.removeChild(node.firstChild);
|
|
71
|
-
}
|
|
72
|
-
if (text) {
|
|
73
|
-
var doc = node.ownerDocument || document;
|
|
74
|
-
node.appendChild(doc.createTextNode(text));
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
40
|
/**
|
|
80
41
|
* Operations for updating with DOM children.
|
|
81
42
|
*/
|
|
@@ -83,7 +44,7 @@ var DOMChildrenOperations = {
|
|
|
83
44
|
|
|
84
45
|
dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
|
|
85
46
|
|
|
86
|
-
updateTextContent:
|
|
47
|
+
updateTextContent: setTextContent,
|
|
87
48
|
|
|
88
49
|
/**
|
|
89
50
|
* Updates a component's children by processing a series of updates. The
|
|
@@ -100,7 +61,8 @@ var DOMChildrenOperations = {
|
|
|
100
61
|
// List of children that will be moved or removed.
|
|
101
62
|
var updatedChildren = null;
|
|
102
63
|
|
|
103
|
-
for (var i = 0;
|
|
64
|
+
for (var i = 0; i < updates.length; i++) {
|
|
65
|
+
update = updates[i];
|
|
104
66
|
if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING ||
|
|
105
67
|
update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
|
|
106
68
|
var updatedIndex = update.fromIndex;
|
|
@@ -112,7 +74,7 @@ var DOMChildrenOperations = {
|
|
|
112
74
|
'processUpdates(): Unable to find child %s of element. This ' +
|
|
113
75
|
'probably means the DOM was unexpectedly mutated (e.g., by the ' +
|
|
114
76
|
'browser), usually due to forgetting a <tbody> when using tables, ' +
|
|
115
|
-
'nesting tags like <form>, <p>, or <a>, or using non-SVG elements '+
|
|
77
|
+
'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' +
|
|
116
78
|
'in an <svg> parent. Try inspecting the child nodes of the element ' +
|
|
117
79
|
'with React ID `%s`.',
|
|
118
80
|
updatedIndex,
|
|
@@ -137,7 +99,8 @@ var DOMChildrenOperations = {
|
|
|
137
99
|
}
|
|
138
100
|
}
|
|
139
101
|
|
|
140
|
-
for (var k = 0;
|
|
102
|
+
for (var k = 0; k < updates.length; k++) {
|
|
103
|
+
update = updates[k];
|
|
141
104
|
switch (update.type) {
|
|
142
105
|
case ReactMultiChildUpdateTypes.INSERT_MARKUP:
|
|
143
106
|
insertChildAt(
|
|
@@ -154,7 +117,7 @@ var DOMChildrenOperations = {
|
|
|
154
117
|
);
|
|
155
118
|
break;
|
|
156
119
|
case ReactMultiChildUpdateTypes.TEXT_CONTENT:
|
|
157
|
-
|
|
120
|
+
setTextContent(
|
|
158
121
|
update.parentNode,
|
|
159
122
|
update.textContent
|
|
160
123
|
);
|
package/lib/DOMProperty.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
/*jslint bitwise: true */
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
'use strict';
|
|
16
16
|
|
|
17
17
|
var invariant = require("./invariant");
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var DOMProperty = require("./DOMProperty");
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
var memoizeStringOnly = require("./memoizeStringOnly");
|
|
17
|
+
var quoteAttributeValueForBrowser = require("./quoteAttributeValueForBrowser");
|
|
19
18
|
var warning = require("./warning");
|
|
20
19
|
|
|
21
20
|
function shouldIgnoreValue(name, value) {
|
|
@@ -26,10 +25,6 @@ function shouldIgnoreValue(name, value) {
|
|
|
26
25
|
(DOMProperty.hasOverloadedBooleanValue[name] && value === false);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
|
|
30
|
-
return escapeTextForBrowser(name) + '="';
|
|
31
|
-
});
|
|
32
|
-
|
|
33
28
|
if ("production" !== process.env.NODE_ENV) {
|
|
34
29
|
var reactProps = {
|
|
35
30
|
children: true,
|
|
@@ -61,7 +56,9 @@ if ("production" !== process.env.NODE_ENV) {
|
|
|
61
56
|
// logging too much when using transferPropsTo.
|
|
62
57
|
("production" !== process.env.NODE_ENV ? warning(
|
|
63
58
|
standardName == null,
|
|
64
|
-
'Unknown DOM property
|
|
59
|
+
'Unknown DOM property %s. Did you mean %s?',
|
|
60
|
+
name,
|
|
61
|
+
standardName
|
|
65
62
|
) : null);
|
|
66
63
|
|
|
67
64
|
};
|
|
@@ -79,8 +76,8 @@ var DOMPropertyOperations = {
|
|
|
79
76
|
* @return {string} Markup string.
|
|
80
77
|
*/
|
|
81
78
|
createMarkupForID: function(id) {
|
|
82
|
-
return
|
|
83
|
-
|
|
79
|
+
return DOMProperty.ID_ATTRIBUTE_NAME + '=' +
|
|
80
|
+
quoteAttributeValueForBrowser(id);
|
|
84
81
|
},
|
|
85
82
|
|
|
86
83
|
/**
|
|
@@ -99,16 +96,14 @@ var DOMPropertyOperations = {
|
|
|
99
96
|
var attributeName = DOMProperty.getAttributeName[name];
|
|
100
97
|
if (DOMProperty.hasBooleanValue[name] ||
|
|
101
98
|
(DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
|
|
102
|
-
return
|
|
99
|
+
return attributeName;
|
|
103
100
|
}
|
|
104
|
-
return
|
|
105
|
-
escapeTextForBrowser(value) + '"';
|
|
101
|
+
return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
|
106
102
|
} else if (DOMProperty.isCustomAttribute(name)) {
|
|
107
103
|
if (value == null) {
|
|
108
104
|
return '';
|
|
109
105
|
}
|
|
110
|
-
return
|
|
111
|
-
escapeTextForBrowser(value) + '"';
|
|
106
|
+
return name + '=' + quoteAttributeValueForBrowser(value);
|
|
112
107
|
} else if ("production" !== process.env.NODE_ENV) {
|
|
113
108
|
warnUnknownProperty(name);
|
|
114
109
|
}
|
package/lib/Danger.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
/*jslint evil: true, sub: true */
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
'use strict';
|
|
16
16
|
|
|
17
17
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
18
18
|
|
|
@@ -82,7 +82,8 @@ var Danger = {
|
|
|
82
82
|
// This for-in loop skips the holes of the sparse array. The order of
|
|
83
83
|
// iteration should follow the order of assignment, which happens to match
|
|
84
84
|
// numerical index order, but we don't rely on that.
|
|
85
|
-
|
|
85
|
+
var resultIndex;
|
|
86
|
+
for (resultIndex in markupListByNodeName) {
|
|
86
87
|
if (markupListByNodeName.hasOwnProperty(resultIndex)) {
|
|
87
88
|
var markup = markupListByNodeName[resultIndex];
|
|
88
89
|
|
|
@@ -103,8 +104,8 @@ var Danger = {
|
|
|
103
104
|
emptyFunction // Do nothing special with <script> tags.
|
|
104
105
|
);
|
|
105
106
|
|
|
106
|
-
for (
|
|
107
|
-
var renderNode = renderNodes[
|
|
107
|
+
for (var j = 0; j < renderNodes.length; ++j) {
|
|
108
|
+
var renderNode = renderNodes[j];
|
|
108
109
|
if (renderNode.hasAttribute &&
|
|
109
110
|
renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
|
|
110
111
|
|
|
@@ -124,7 +125,7 @@ var Danger = {
|
|
|
124
125
|
|
|
125
126
|
} else if ("production" !== process.env.NODE_ENV) {
|
|
126
127
|
console.error(
|
|
127
|
-
|
|
128
|
+
'Danger: Discarding unexpected node:',
|
|
128
129
|
renderNode
|
|
129
130
|
);
|
|
130
131
|
}
|
|
@@ -170,7 +171,7 @@ var Danger = {
|
|
|
170
171
|
'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' +
|
|
171
172
|
'<html> node. This is because browser quirks make this unreliable ' +
|
|
172
173
|
'and/or slow. If you want to render to the root you must use ' +
|
|
173
|
-
'server rendering. See
|
|
174
|
+
'server rendering. See React.renderToString().'
|
|
174
175
|
) : invariant(oldChild.tagName.toLowerCase() !== 'html'));
|
|
175
176
|
|
|
176
177
|
var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
|