react 0.13.0-alpha.1 → 0.13.0-rc1
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 +1376 -596
- package/dist/react-with-addons.js +3256 -2363
- package/dist/react-with-addons.min.js +7 -7
- package/dist/react.js +3092 -2266
- package/dist/react.min.js +6 -7
- package/lib/AutoFocusMixin.js +2 -2
- package/lib/BeforeInputEventPlugin.js +5 -9
- package/lib/CSSCore.js +1 -1
- package/lib/CSSProperty.js +4 -2
- package/lib/CSSPropertyOperations.js +44 -17
- package/lib/CallbackQueue.js +3 -3
- package/lib/ChangeEventPlugin.js +2 -2
- 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 +7 -6
- package/lib/DefaultEventPluginOrder.js +3 -3
- 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 +1 -1
- package/lib/FallbackCompositionState.js +7 -5
- package/lib/HTMLDOMPropertyConfig.js +22 -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 +2 -2
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +9 -13
- package/lib/ReactBrowserComponentMixin.js +2 -2
- package/lib/ReactBrowserEventEmitter.js +4 -4
- package/lib/ReactCSSTransitionGroup.js +2 -2
- package/lib/ReactCSSTransitionGroupChild.js +12 -7
- package/lib/ReactChildReconciler.js +11 -7
- package/lib/ReactChildren.js +13 -10
- package/lib/ReactClass.js +161 -135
- package/lib/ReactComponent.js +100 -158
- package/lib/ReactComponentBrowserEnvironment.js +2 -2
- package/lib/ReactComponentEnvironment.js +3 -3
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +336 -484
- package/lib/ReactContext.js +14 -4
- package/lib/ReactCurrentOwner.js +2 -2
- package/lib/ReactDOM.js +2 -2
- package/lib/ReactDOMButton.js +2 -2
- package/lib/ReactDOMComponent.js +42 -52
- package/lib/ReactDOMForm.js +2 -2
- package/lib/ReactDOMIDOperations.js +4 -4
- package/lib/ReactDOMIframe.js +43 -0
- package/lib/ReactDOMImg.js +2 -2
- package/lib/ReactDOMInput.js +2 -2
- package/lib/ReactDOMOption.js +2 -2
- package/lib/ReactDOMSelect.js +3 -3
- package/lib/ReactDOMSelection.js +2 -2
- package/lib/ReactDOMTextComponent.js +4 -13
- package/lib/ReactDOMTextarea.js +2 -2
- package/lib/ReactDefaultBatchingStrategy.js +5 -5
- package/lib/ReactDefaultInjection.js +26 -2
- package/lib/ReactDefaultPerf.js +12 -4
- package/lib/ReactDefaultPerfAnalysis.js +1 -1
- package/lib/ReactElement.js +7 -5
- package/lib/ReactElementValidator.js +185 -65
- package/lib/ReactEmptyComponent.js +17 -6
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +2 -2
- package/lib/ReactEventListener.js +4 -5
- package/lib/ReactFragment.js +180 -0
- package/lib/ReactInjection.js +2 -2
- package/lib/ReactInputSelection.js +2 -2
- package/lib/ReactInstanceHandles.js +4 -3
- package/lib/ReactInstanceMap.js +2 -2
- package/lib/ReactLifeCycle.js +35 -0
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +2 -2
- package/lib/ReactMount.js +87 -23
- package/lib/ReactMultiChild.js +19 -7
- package/lib/ReactMultiChildUpdateTypes.js +2 -2
- package/lib/ReactNativeComponent.js +34 -37
- package/lib/ReactOwner.js +2 -2
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +3 -3
- package/lib/ReactPropTypeLocationNames.js +2 -2
- package/lib/ReactPropTypeLocations.js +2 -2
- package/lib/ReactPropTypes.js +16 -8
- package/lib/ReactPutListenerQueue.js +2 -2
- package/lib/ReactReconcileTransaction.js +2 -2
- package/lib/ReactReconciler.js +121 -0
- package/lib/ReactRef.js +41 -68
- package/lib/ReactRootIndex.js +2 -2
- package/lib/ReactServerRendering.js +4 -3
- package/lib/ReactServerRenderingTransaction.js +2 -2
- package/lib/ReactStateSetters.js +2 -2
- package/lib/ReactTestUtils.js +49 -8
- package/lib/ReactTransitionChildMapping.js +8 -4
- package/lib/ReactTransitionEvents.js +2 -2
- package/lib/ReactTransitionGroup.js +6 -6
- package/lib/ReactUpdateQueue.js +295 -0
- package/lib/ReactUpdates.js +13 -22
- 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 +2 -2
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +2 -2
- package/lib/Transaction.js +5 -5
- package/lib/ViewportMetrics.js +2 -2
- 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 +2 -2
- package/lib/createNodesFromMarkup.js +4 -4
- package/lib/cx.js +16 -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 +26 -9
- package/lib/flattenChildren.js +11 -9
- 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 +2 -2
- 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 +21 -21
- package/lib/invariant.js +1 -1
- package/lib/isEventSupported.js +2 -2
- package/lib/isNode.js +1 -1
- package/lib/isTextInputElement.js +2 -2
- 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 +64 -8
- package/lib/toArray.js +2 -2
- package/lib/traverseAllChildren.js +19 -5
- package/lib/update.js +2 -2
- package/lib/warning.js +20 -2
- package/package.json +1 -1
- package/lib/accumulate.js +0 -47
- package/lib/copyProperties.js +0 -56
- package/lib/merge.js +0 -34
- package/lib/mergeInto.js +0 -24
- package/lib/monitorCodeUse.js +0 -30
package/lib/getEventKey.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var getEventCharCode = require("./getEventCharCode");
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013 Facebook, Inc.
|
|
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
|
/**
|
|
16
16
|
* Translation from modifier key to the associated property in the event.
|
package/lib/getEventTarget.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Gets the target node from a native browser event by accounting for
|
package/lib/getIteratorFn.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/* global Symbol */
|
|
16
16
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
package/lib/getMarkupWrap.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 getNodeForCharacterOffset
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Given any node return the first leaf node without children.
|
|
@@ -53,7 +53,7 @@ function getNodeForCharacterOffset(root, offset) {
|
|
|
53
53
|
var nodeEnd = 0;
|
|
54
54
|
|
|
55
55
|
while (node) {
|
|
56
|
-
if (node.nodeType
|
|
56
|
+
if (node.nodeType === 3) {
|
|
57
57
|
nodeEnd = nodeStart + node.textContent.length;
|
|
58
58
|
|
|
59
59
|
if (nodeStart <= offset && nodeEnd >= offset) {
|
|
@@ -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 getReactRootElementInContainer
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var DOC_NODE_TYPE = 9;
|
|
15
15
|
|
|
@@ -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 getTextContentAccessor
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
15
|
|
package/lib/hyphenate.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var ReactCompositeComponent = require("./ReactCompositeComponent");
|
|
16
16
|
var ReactEmptyComponent = require("./ReactEmptyComponent");
|
|
@@ -21,9 +21,7 @@ var invariant = require("./invariant");
|
|
|
21
21
|
var warning = require("./warning");
|
|
22
22
|
|
|
23
23
|
// To avoid a cyclic dependency, we create the final class in this module
|
|
24
|
-
var ReactCompositeComponentWrapper = function(
|
|
25
|
-
this._instance = inst;
|
|
26
|
-
};
|
|
24
|
+
var ReactCompositeComponentWrapper = function() { };
|
|
27
25
|
assign(
|
|
28
26
|
ReactCompositeComponentWrapper.prototype,
|
|
29
27
|
ReactCompositeComponent.Mixin,
|
|
@@ -73,28 +71,19 @@ function instantiateReactComponent(node, parentCompositeType) {
|
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
// Special case string values
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// If the injected special class is not an internal class, but another
|
|
83
|
-
// composite, then we must wrap it.
|
|
84
|
-
// TODO: Move this resolution around to something cleaner.
|
|
85
|
-
if (typeof instance.mountComponent !== 'function') {
|
|
86
|
-
instance = new ReactCompositeComponentWrapper(instance);
|
|
87
|
-
}
|
|
74
|
+
if (parentCompositeType === element.type &&
|
|
75
|
+
typeof element.type === 'string') {
|
|
76
|
+
// Avoid recursion if the wrapper renders itself.
|
|
77
|
+
instance = ReactNativeComponent.createInternalComponent(element);
|
|
78
|
+
// All native components are currently wrapped in a composite so we're
|
|
79
|
+
// safe to assume that this is what we should instantiate.
|
|
88
80
|
} else if (isInternalComponentType(element.type)) {
|
|
89
81
|
// This is temporarily available for custom components that are not string
|
|
90
82
|
// represenations. I.e. ART. Once those are updated to use the string
|
|
91
83
|
// representation, we can drop this code path.
|
|
92
84
|
instance = new element.type(element);
|
|
93
85
|
} else {
|
|
94
|
-
|
|
95
|
-
// props in property initializers.
|
|
96
|
-
var inst = new element.type(element.props);
|
|
97
|
-
instance = new ReactCompositeComponentWrapper(inst);
|
|
86
|
+
instance = new ReactCompositeComponentWrapper();
|
|
98
87
|
}
|
|
99
88
|
} else if (typeof node === 'string' || typeof node === 'number') {
|
|
100
89
|
instance = ReactNativeComponent.createInstanceForText(node);
|
|
@@ -119,6 +108,17 @@ function instantiateReactComponent(node, parentCompositeType) {
|
|
|
119
108
|
// Sets up the instance. This can probably just move into the constructor now.
|
|
120
109
|
instance.construct(node);
|
|
121
110
|
|
|
111
|
+
// These two fields are used by the DOM and ART diffing algorithms
|
|
112
|
+
// respectively. Instead of using expandos on components, we should be
|
|
113
|
+
// storing the state needed by the diffing algorithms elsewhere.
|
|
114
|
+
instance._mountIndex = 0;
|
|
115
|
+
instance._mountImage = null;
|
|
116
|
+
|
|
117
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
118
|
+
instance._isOwnerNecessary = false;
|
|
119
|
+
instance._warnedAboutRefsInRender = false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
122
|
// Internal instances should fully constructed at this point, so they should
|
|
123
123
|
// not get any new fields added to them at this point.
|
|
124
124
|
if ("production" !== process.env.NODE_ENV) {
|
package/lib/invariant.js
CHANGED
package/lib/isEventSupported.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 isEventSupported
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
15
|
|
package/lib/isNode.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 isTextInputElement
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
package/lib/isTextNode.js
CHANGED
package/lib/joinClasses.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Combines multiple className strings into one.
|
package/lib/keyMirror.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var invariant = require("./invariant");
|
|
16
16
|
|
package/lib/keyOf.js
CHANGED
package/lib/mapObject.js
CHANGED
package/lib/memoizeStringOnly.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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Memoizes the return value of a function that accepts one string argument.
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
function memoizeStringOnly(callback) {
|
|
22
22
|
var cache = {};
|
|
23
23
|
return function(string) {
|
|
24
|
-
if (cache.hasOwnProperty(string)) {
|
|
25
|
-
|
|
26
|
-
} else {
|
|
27
|
-
return cache[string] = callback.call(this, string);
|
|
24
|
+
if (!cache.hasOwnProperty(string)) {
|
|
25
|
+
cache[string] = callback.call(this, string);
|
|
28
26
|
}
|
|
27
|
+
return cache[string];
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
|
package/lib/onlyChild.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
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @providesModule onlyChild
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
'use strict';
|
|
12
12
|
|
|
13
13
|
var ReactElement = require("./ReactElement");
|
|
14
14
|
|
package/lib/performance.js
CHANGED
package/lib/performanceNow.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
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 quoteAttributeValueForBrowser
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var escapeTextContentForBrowser = require("./escapeTextContentForBrowser");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Escapes attribute value to prevent scripting attacks.
|
|
18
|
+
*
|
|
19
|
+
* @param {*} value Value to escape.
|
|
20
|
+
* @return {string} An escaped string.
|
|
21
|
+
*/
|
|
22
|
+
function quoteAttributeValueForBrowser(value) {
|
|
23
|
+
return '"' + escapeTextContentForBrowser(value) + '"';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = quoteAttributeValueForBrowser;
|
package/lib/setInnerHTML.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,9 @@
|
|
|
9
9
|
* @providesModule setInnerHTML
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/* globals MSApp */
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
13
15
|
|
|
14
16
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
17
|
|
|
@@ -28,6 +30,15 @@ var setInnerHTML = function(node, html) {
|
|
|
28
30
|
node.innerHTML = html;
|
|
29
31
|
};
|
|
30
32
|
|
|
33
|
+
// Win8 apps: Allow all html to be inserted
|
|
34
|
+
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
|
35
|
+
setInnerHTML = function(node, html) {
|
|
36
|
+
MSApp.execUnsafeLocalFunction(function() {
|
|
37
|
+
node.innerHTML = html;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
if (ExecutionEnvironment.canUseDOM) {
|
|
32
43
|
// IE8: When updating a just created node with innerHTML only leading
|
|
33
44
|
// whitespace is removed. When updating an existing node with innerHTML
|