react 0.14.0-beta1 → 0.14.0-beta2
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/addons.js +5 -2
- package/dist/JSXTransformer.js +588 -227
- package/dist/react-with-addons.js +3118 -2707
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +3713 -3317
- package/dist/react.min.js +6 -5
- package/lib/AutoFocusUtils.js +3 -3
- package/lib/BeforeInputEventPlugin.js +13 -13
- package/lib/CSSProperty.js +3 -0
- package/lib/CSSPropertyOperations.js +13 -13
- package/lib/CallbackQueue.js +4 -4
- package/lib/ChangeEventPlugin.js +12 -12
- package/lib/DOMChildrenOperations.js +10 -6
- package/lib/DOMProperty.js +8 -8
- package/lib/DOMPropertyOperations.js +9 -9
- package/lib/Danger.js +14 -14
- package/lib/DefaultEventPluginOrder.js +2 -2
- package/lib/EnterLeaveEventPlugin.js +5 -5
- package/lib/EventConstants.js +23 -1
- package/lib/EventPluginHub.js +11 -11
- package/lib/EventPluginRegistry.js +8 -8
- package/lib/EventPluginUtils.js +11 -11
- package/lib/EventPropagators.js +7 -7
- package/lib/FallbackCompositionState.js +3 -3
- package/lib/HTMLDOMPropertyConfig.js +4 -2
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +8 -8
- package/lib/MetaMatchers.js +118 -0
- package/lib/OrderedMap.js +453 -0
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +6 -6
- package/lib/ReactBrowserComponentMixin.js +4 -4
- package/lib/ReactBrowserEventEmitter.js +30 -7
- package/lib/ReactCSSTransitionGroup.js +16 -5
- package/lib/ReactCSSTransitionGroupChild.js +12 -11
- package/lib/ReactChildReconciler.js +25 -18
- package/lib/ReactChildren.js +6 -6
- package/lib/ReactClass.js +42 -42
- package/lib/ReactComponent.js +13 -13
- package/lib/ReactComponentBrowserEnvironment.js +2 -2
- package/lib/ReactComponentEnvironment.js +2 -2
- package/lib/ReactComponentWithPureRenderMixin.js +1 -1
- package/lib/ReactCompositeComponent.js +38 -38
- package/lib/ReactDOM.js +72 -159
- package/lib/ReactDOMComponent.js +104 -60
- package/lib/ReactDOMFactories.js +177 -0
- package/lib/ReactDOMIDOperations.js +10 -24
- package/lib/ReactDOMInput.js +8 -8
- package/lib/ReactDOMOption.js +7 -7
- package/lib/ReactDOMSelect.js +8 -8
- package/lib/ReactDOMSelection.js +3 -3
- package/lib/ReactDOMServer.js +2 -2
- package/lib/ReactDOMTextComponent.js +11 -11
- package/lib/ReactDOMTextarea.js +11 -11
- package/lib/ReactDefaultBatchingStrategy.js +4 -4
- package/lib/ReactDefaultInjection.js +24 -24
- package/lib/ReactDefaultPerf.js +7 -7
- package/lib/ReactDefaultPerfAnalysis.js +6 -9
- package/lib/ReactElement.js +4 -4
- package/lib/ReactElementValidator.js +21 -21
- package/lib/ReactEmptyComponent.js +4 -4
- package/lib/ReactEventEmitterMixin.js +1 -1
- package/lib/ReactEventListener.js +19 -14
- package/lib/ReactFragment.js +11 -11
- package/lib/ReactInjection.js +11 -11
- package/lib/ReactInputSelection.js +4 -4
- package/lib/ReactInstanceHandles.js +10 -11
- package/lib/ReactIsomorphic.js +11 -11
- package/lib/ReactLink.js +1 -1
- package/lib/ReactMarkupChecksum.js +6 -2
- package/lib/ReactMount.js +68 -48
- package/lib/ReactMultiChild.js +83 -22
- package/lib/ReactMultiChildUpdateTypes.js +2 -1
- package/lib/ReactNativeComponent.js +3 -3
- package/lib/ReactNoopUpdateQueue.js +3 -3
- package/lib/ReactOwner.js +3 -3
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +3 -3
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +34 -8
- package/lib/ReactReconcileTransaction.js +6 -6
- package/lib/ReactReconciler.js +12 -12
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +5 -5
- package/lib/ReactServerRendering.js +12 -12
- package/lib/ReactServerRenderingTransaction.js +5 -5
- package/lib/ReactTestUtils.js +26 -27
- package/lib/ReactTransitionChildMapping.js +2 -2
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +5 -6
- package/lib/ReactUpdateQueue.js +17 -17
- package/lib/ReactUpdates.js +14 -14
- package/lib/ReactWithAddons.js +14 -14
- package/lib/ResponderEventPlugin.js +514 -0
- package/lib/ResponderSyntheticEvent.js +40 -0
- package/lib/ResponderTouchHistoryStore.js +180 -0
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +9 -9
- package/lib/SimpleEventPlugin.js +201 -25
- package/lib/SyntheticClipboardEvent.js +1 -1
- package/lib/SyntheticCompositionEvent.js +1 -1
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +3 -3
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +1 -1
- package/lib/SyntheticKeyboardEvent.js +4 -4
- package/lib/SyntheticMouseEvent.js +3 -3
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +1 -1
- package/lib/TapEventPlugin.js +119 -0
- package/lib/Transaction.js +6 -6
- package/lib/accumulate.js +44 -0
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +19 -7
- package/lib/cloneWithProps.js +11 -6
- package/lib/createHierarchyRenderer.js +85 -0
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/deprecated.js +4 -4
- package/lib/findDOMNode.js +9 -9
- package/lib/flattenChildren.js +4 -4
- package/lib/getEventKey.js +1 -1
- package/lib/getTestDocument.js +28 -0
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +12 -12
- package/lib/isEventSupported.js +1 -1
- package/lib/onlyChild.js +3 -3
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +210 -0
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +1 -1
- package/lib/setTextContent.js +3 -3
- package/lib/shallowCompare.js +1 -1
- package/lib/sliceChildren.js +51 -0
- package/lib/traverseAllChildren.js +14 -13
- package/lib/update.js +13 -13
- package/lib/validateDOMNesting.js +6 -6
- package/lib/webcomponents.js +6379 -0
- package/package.json +4 -6
- package/react.js +1 -1
- package/lib/CSSCore.js +0 -97
- package/lib/EventListener.js +0 -84
- package/lib/ExecutionEnvironment.js +0 -38
- package/lib/ReactDOMClient.js +0 -90
- package/lib/camelize.js +0 -32
- package/lib/camelizeStyleName.js +0 -40
- package/lib/containsNode.js +0 -55
- package/lib/createArrayFromMixed.js +0 -85
- package/lib/createNodesFromMarkup.js +0 -84
- package/lib/emptyFunction.js +0 -38
- package/lib/emptyObject.js +0 -20
- package/lib/focusNode.js +0 -26
- package/lib/getActiveElement.js +0 -29
- package/lib/getMarkupWrap.js +0 -93
- package/lib/getUnboundedScrollPosition.js +0 -38
- package/lib/hyphenate.js +0 -33
- package/lib/hyphenateStyleName.js +0 -39
- package/lib/invariant.js +0 -49
- package/lib/isNode.js +0 -23
- package/lib/isTextNode.js +0 -25
- package/lib/keyMirror.js +0 -48
- package/lib/keyOf.js +0 -35
- package/lib/mapObject.js +0 -51
- package/lib/performance.js +0 -23
- package/lib/performanceNow.js +0 -28
- package/lib/shallowEqual.js +0 -48
- package/lib/toArray.js +0 -57
- package/lib/warning.js +0 -57
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var keyOf = require(
|
|
14
|
+
var keyOf = require('fbjs/lib/keyOf');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Module that is injectable into `EventPluginHub`, that specifies a
|
|
@@ -22,6 +22,6 @@ var keyOf = require("./keyOf");
|
|
|
22
22
|
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
|
|
23
23
|
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
|
|
24
24
|
*/
|
|
25
|
-
var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })
|
|
25
|
+
var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
|
|
26
26
|
|
|
27
27
|
module.exports = DefaultEventPluginOrder;
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var EventConstants = require(
|
|
16
|
-
var EventPropagators = require(
|
|
17
|
-
var SyntheticMouseEvent = require(
|
|
15
|
+
var EventConstants = require('./EventConstants');
|
|
16
|
+
var EventPropagators = require('./EventPropagators');
|
|
17
|
+
var SyntheticMouseEvent = require('./SyntheticMouseEvent');
|
|
18
18
|
|
|
19
|
-
var ReactMount = require(
|
|
20
|
-
var keyOf = require(
|
|
19
|
+
var ReactMount = require('./ReactMount');
|
|
20
|
+
var keyOf = require('fbjs/lib/keyOf');
|
|
21
21
|
|
|
22
22
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
23
23
|
var getFirstReactDOM = ReactMount.getFirstReactDOM;
|
package/lib/EventConstants.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var keyMirror = require(
|
|
14
|
+
var keyMirror = require('fbjs/lib/keyMirror');
|
|
15
15
|
|
|
16
16
|
var PropagationPhases = keyMirror({ bubbled: null, captured: null });
|
|
17
17
|
|
|
@@ -19,7 +19,10 @@ var PropagationPhases = keyMirror({ bubbled: null, captured: null });
|
|
|
19
19
|
* Types of raw signals from the browser caught at the top level.
|
|
20
20
|
*/
|
|
21
21
|
var topLevelTypes = keyMirror({
|
|
22
|
+
topAbort: null,
|
|
22
23
|
topBlur: null,
|
|
24
|
+
topCanPlay: null,
|
|
25
|
+
topCanPlayThrough: null,
|
|
23
26
|
topChange: null,
|
|
24
27
|
topClick: null,
|
|
25
28
|
topCompositionEnd: null,
|
|
@@ -37,6 +40,9 @@ var topLevelTypes = keyMirror({
|
|
|
37
40
|
topDragOver: null,
|
|
38
41
|
topDragStart: null,
|
|
39
42
|
topDrop: null,
|
|
43
|
+
topDurationChange: null,
|
|
44
|
+
topEmptied: null,
|
|
45
|
+
topEnded: null,
|
|
40
46
|
topError: null,
|
|
41
47
|
topFocus: null,
|
|
42
48
|
topInput: null,
|
|
@@ -44,21 +50,37 @@ var topLevelTypes = keyMirror({
|
|
|
44
50
|
topKeyPress: null,
|
|
45
51
|
topKeyUp: null,
|
|
46
52
|
topLoad: null,
|
|
53
|
+
topLoadedData: null,
|
|
54
|
+
topLoadedMetadata: null,
|
|
55
|
+
topLoadStart: null,
|
|
47
56
|
topMouseDown: null,
|
|
48
57
|
topMouseMove: null,
|
|
49
58
|
topMouseOut: null,
|
|
50
59
|
topMouseOver: null,
|
|
51
60
|
topMouseUp: null,
|
|
61
|
+
topOnEncrypted: null,
|
|
52
62
|
topPaste: null,
|
|
63
|
+
topPause: null,
|
|
64
|
+
topPlay: null,
|
|
65
|
+
topPlaying: null,
|
|
66
|
+
topProgress: null,
|
|
67
|
+
topRateChange: null,
|
|
53
68
|
topReset: null,
|
|
54
69
|
topScroll: null,
|
|
70
|
+
topSeeked: null,
|
|
71
|
+
topSeeking: null,
|
|
55
72
|
topSelectionChange: null,
|
|
73
|
+
topStalled: null,
|
|
74
|
+
topSuspend: null,
|
|
56
75
|
topSubmit: null,
|
|
57
76
|
topTextInput: null,
|
|
77
|
+
topTimeUpdate: null,
|
|
58
78
|
topTouchCancel: null,
|
|
59
79
|
topTouchEnd: null,
|
|
60
80
|
topTouchMove: null,
|
|
61
81
|
topTouchStart: null,
|
|
82
|
+
topVolumeChange: null,
|
|
83
|
+
topWaiting: null,
|
|
62
84
|
topWheel: null
|
|
63
85
|
});
|
|
64
86
|
|
package/lib/EventPluginHub.js
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var EventPluginRegistry = require(
|
|
15
|
-
var EventPluginUtils = require(
|
|
14
|
+
var EventPluginRegistry = require('./EventPluginRegistry');
|
|
15
|
+
var EventPluginUtils = require('./EventPluginUtils');
|
|
16
16
|
|
|
17
|
-
var accumulateInto = require(
|
|
18
|
-
var forEachAccumulated = require(
|
|
19
|
-
var invariant = require(
|
|
20
|
-
var warning = require(
|
|
17
|
+
var accumulateInto = require('./accumulateInto');
|
|
18
|
+
var forEachAccumulated = require('./forEachAccumulated');
|
|
19
|
+
var invariant = require('fbjs/lib/invariant');
|
|
20
|
+
var warning = require('fbjs/lib/warning');
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Internal store for event listeners
|
|
@@ -60,7 +60,7 @@ var InstanceHandle = null;
|
|
|
60
60
|
|
|
61
61
|
function validateInstanceHandle() {
|
|
62
62
|
var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
|
|
63
|
-
|
|
63
|
+
process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -104,13 +104,13 @@ var EventPluginHub = {
|
|
|
104
104
|
*/
|
|
105
105
|
injectInstanceHandle: function (InjectedInstanceHandle) {
|
|
106
106
|
InstanceHandle = InjectedInstanceHandle;
|
|
107
|
-
if (
|
|
107
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
108
108
|
validateInstanceHandle();
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
|
|
112
112
|
getInstanceHandle: function () {
|
|
113
|
-
if (
|
|
113
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
114
114
|
validateInstanceHandle();
|
|
115
115
|
}
|
|
116
116
|
return InstanceHandle;
|
|
@@ -141,7 +141,7 @@ var EventPluginHub = {
|
|
|
141
141
|
* @param {?function} listener The callback to store.
|
|
142
142
|
*/
|
|
143
143
|
putListener: function (id, registrationName, listener) {
|
|
144
|
-
!(typeof listener === 'function') ?
|
|
144
|
+
!(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
|
|
145
145
|
|
|
146
146
|
var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
|
|
147
147
|
bankForRegistrationName[id] = listener;
|
|
@@ -252,7 +252,7 @@ var EventPluginHub = {
|
|
|
252
252
|
var processingEventQueue = eventQueue;
|
|
253
253
|
eventQueue = null;
|
|
254
254
|
forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
|
|
255
|
-
!!eventQueue ?
|
|
255
|
+
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
|
|
256
256
|
},
|
|
257
257
|
|
|
258
258
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var invariant = require(
|
|
15
|
+
var invariant = require('fbjs/lib/invariant');
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Injectable ordering of event plugins.
|
|
@@ -37,15 +37,15 @@ function recomputePluginOrdering() {
|
|
|
37
37
|
for (var pluginName in namesToPlugins) {
|
|
38
38
|
var PluginModule = namesToPlugins[pluginName];
|
|
39
39
|
var pluginIndex = EventPluginOrder.indexOf(pluginName);
|
|
40
|
-
!(pluginIndex > -1) ?
|
|
40
|
+
!(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
|
|
41
41
|
if (EventPluginRegistry.plugins[pluginIndex]) {
|
|
42
42
|
continue;
|
|
43
43
|
}
|
|
44
|
-
!PluginModule.extractEvents ?
|
|
44
|
+
!PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
|
|
45
45
|
EventPluginRegistry.plugins[pluginIndex] = PluginModule;
|
|
46
46
|
var publishedEvents = PluginModule.eventTypes;
|
|
47
47
|
for (var eventName in publishedEvents) {
|
|
48
|
-
!publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ?
|
|
48
|
+
!publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -59,7 +59,7 @@ function recomputePluginOrdering() {
|
|
|
59
59
|
* @private
|
|
60
60
|
*/
|
|
61
61
|
function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
|
|
62
|
-
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ?
|
|
62
|
+
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
|
|
63
63
|
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
|
|
64
64
|
|
|
65
65
|
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
|
@@ -87,7 +87,7 @@ function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
|
|
|
87
87
|
* @private
|
|
88
88
|
*/
|
|
89
89
|
function publishRegistrationName(registrationName, PluginModule, eventName) {
|
|
90
|
-
!!EventPluginRegistry.registrationNameModules[registrationName] ?
|
|
90
|
+
!!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
|
|
91
91
|
EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
|
|
92
92
|
EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
|
|
93
93
|
}
|
|
@@ -129,7 +129,7 @@ var EventPluginRegistry = {
|
|
|
129
129
|
* @see {EventPluginHub.injection.injectEventPluginOrder}
|
|
130
130
|
*/
|
|
131
131
|
injectEventPluginOrder: function (InjectedEventPluginOrder) {
|
|
132
|
-
!!EventPluginOrder ?
|
|
132
|
+
!!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
|
|
133
133
|
// Clone the ordering so it cannot be dynamically mutated.
|
|
134
134
|
EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
|
|
135
135
|
recomputePluginOrdering();
|
|
@@ -153,7 +153,7 @@ var EventPluginRegistry = {
|
|
|
153
153
|
}
|
|
154
154
|
var PluginModule = injectedNamesToPlugins[pluginName];
|
|
155
155
|
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
|
|
156
|
-
!!namesToPlugins[pluginName] ?
|
|
156
|
+
!!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
|
|
157
157
|
namesToPlugins[pluginName] = PluginModule;
|
|
158
158
|
isOrderingDirty = true;
|
|
159
159
|
}
|
package/lib/EventPluginUtils.js
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var EventConstants = require(
|
|
14
|
+
var EventConstants = require('./EventConstants');
|
|
15
15
|
|
|
16
|
-
var invariant = require(
|
|
17
|
-
var warning = require(
|
|
16
|
+
var invariant = require('fbjs/lib/invariant');
|
|
17
|
+
var warning = require('fbjs/lib/warning');
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Injected dependencies:
|
|
@@ -28,8 +28,8 @@ var injection = {
|
|
|
28
28
|
Mount: null,
|
|
29
29
|
injectMount: function (InjectedMount) {
|
|
30
30
|
injection.Mount = InjectedMount;
|
|
31
|
-
if (
|
|
32
|
-
|
|
31
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
+
process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
};
|
|
@@ -48,7 +48,7 @@ function isStartish(topLevelType) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
var validateEventDispatches;
|
|
51
|
-
if (
|
|
51
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
52
52
|
validateEventDispatches = function (event) {
|
|
53
53
|
var dispatchListeners = event._dispatchListeners;
|
|
54
54
|
var dispatchIDs = event._dispatchIDs;
|
|
@@ -58,7 +58,7 @@ if ('production' !== process.env.NODE_ENV) {
|
|
|
58
58
|
var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
|
|
59
59
|
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -70,7 +70,7 @@ if ('production' !== process.env.NODE_ENV) {
|
|
|
70
70
|
function forEachEventDispatch(event, cb) {
|
|
71
71
|
var dispatchListeners = event._dispatchListeners;
|
|
72
72
|
var dispatchIDs = event._dispatchIDs;
|
|
73
|
-
if (
|
|
73
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
74
74
|
validateEventDispatches(event);
|
|
75
75
|
}
|
|
76
76
|
if (Array.isArray(dispatchListeners)) {
|
|
@@ -118,7 +118,7 @@ function executeDispatchesInOrder(event, cb) {
|
|
|
118
118
|
function executeDispatchesInOrderStopAtTrueImpl(event) {
|
|
119
119
|
var dispatchListeners = event._dispatchListeners;
|
|
120
120
|
var dispatchIDs = event._dispatchIDs;
|
|
121
|
-
if (
|
|
121
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
122
122
|
validateEventDispatches(event);
|
|
123
123
|
}
|
|
124
124
|
if (Array.isArray(dispatchListeners)) {
|
|
@@ -159,12 +159,12 @@ function executeDispatchesInOrderStopAtTrue(event) {
|
|
|
159
159
|
* @return {*} The return value of executing the single dispatch.
|
|
160
160
|
*/
|
|
161
161
|
function executeDirectDispatch(event) {
|
|
162
|
-
if (
|
|
162
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
163
163
|
validateEventDispatches(event);
|
|
164
164
|
}
|
|
165
165
|
var dispatchListener = event._dispatchListeners;
|
|
166
166
|
var dispatchID = event._dispatchIDs;
|
|
167
|
-
!!Array.isArray(dispatchListener) ?
|
|
167
|
+
!!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
|
|
168
168
|
var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
|
|
169
169
|
event._dispatchListeners = null;
|
|
170
170
|
event._dispatchIDs = null;
|
package/lib/EventPropagators.js
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var EventConstants = require(
|
|
15
|
-
var EventPluginHub = require(
|
|
14
|
+
var EventConstants = require('./EventConstants');
|
|
15
|
+
var EventPluginHub = require('./EventPluginHub');
|
|
16
16
|
|
|
17
|
-
var warning = require(
|
|
17
|
+
var warning = require('fbjs/lib/warning');
|
|
18
18
|
|
|
19
|
-
var accumulateInto = require(
|
|
20
|
-
var forEachAccumulated = require(
|
|
19
|
+
var accumulateInto = require('./accumulateInto');
|
|
20
|
+
var forEachAccumulated = require('./forEachAccumulated');
|
|
21
21
|
|
|
22
22
|
var PropagationPhases = EventConstants.PropagationPhases;
|
|
23
23
|
var getListener = EventPluginHub.getListener;
|
|
@@ -38,8 +38,8 @@ function listenerAtPhase(id, event, propagationPhase) {
|
|
|
38
38
|
* "dispatch" object that pairs the event with the listener.
|
|
39
39
|
*/
|
|
40
40
|
function accumulateDirectionalDispatches(domID, upwards, event) {
|
|
41
|
-
if (
|
|
42
|
-
|
|
41
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
42
|
+
process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
|
|
43
43
|
}
|
|
44
44
|
var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
|
|
45
45
|
var listener = listenerAtPhase(domID, event, phase);
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var PooledClass = require(
|
|
15
|
+
var PooledClass = require('./PooledClass');
|
|
16
16
|
|
|
17
|
-
var assign = require(
|
|
18
|
-
var getTextContentAccessor = require(
|
|
17
|
+
var assign = require('./Object.assign');
|
|
18
|
+
var getTextContentAccessor = require('./getTextContentAccessor');
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* This helper class stores information about text content of a target node,
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var DOMProperty = require(
|
|
15
|
-
var ExecutionEnvironment = require(
|
|
14
|
+
var DOMProperty = require('./DOMProperty');
|
|
15
|
+
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
16
16
|
|
|
17
17
|
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
|
18
18
|
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
|
|
@@ -92,6 +92,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
92
92
|
httpEquiv: null,
|
|
93
93
|
icon: null,
|
|
94
94
|
id: MUST_USE_PROPERTY,
|
|
95
|
+
inputMode: MUST_USE_ATTRIBUTE,
|
|
95
96
|
is: MUST_USE_ATTRIBUTE,
|
|
96
97
|
keyParams: MUST_USE_ATTRIBUTE,
|
|
97
98
|
keyType: MUST_USE_ATTRIBUTE,
|
|
@@ -152,6 +153,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
152
153
|
value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
|
|
153
154
|
width: MUST_USE_ATTRIBUTE,
|
|
154
155
|
wmode: MUST_USE_ATTRIBUTE,
|
|
156
|
+
wrap: null,
|
|
155
157
|
|
|
156
158
|
/**
|
|
157
159
|
* Non-standard Properties
|
package/lib/LinkedStateMixin.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var ReactLink = require(
|
|
16
|
-
var ReactStateSetters = require(
|
|
15
|
+
var ReactLink = require('./ReactLink');
|
|
16
|
+
var ReactStateSetters = require('./ReactStateSetters');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* A simple mixin around ReactLink.forState().
|
package/lib/LinkedValueUtils.js
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var ReactPropTypes = require(
|
|
16
|
-
var ReactPropTypeLocations = require(
|
|
15
|
+
var ReactPropTypes = require('./ReactPropTypes');
|
|
16
|
+
var ReactPropTypeLocations = require('./ReactPropTypeLocations');
|
|
17
17
|
|
|
18
|
-
var invariant = require(
|
|
19
|
-
var warning = require(
|
|
18
|
+
var invariant = require('fbjs/lib/invariant');
|
|
19
|
+
var warning = require('fbjs/lib/warning');
|
|
20
20
|
|
|
21
21
|
var hasReadOnlyValue = {
|
|
22
22
|
'button': true,
|
|
@@ -29,16 +29,16 @@ var hasReadOnlyValue = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
function _assertSingleLink(inputProps) {
|
|
32
|
-
!(inputProps.checkedLink == null || inputProps.valueLink == null) ?
|
|
32
|
+
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
|
|
33
33
|
}
|
|
34
34
|
function _assertValueLink(inputProps) {
|
|
35
35
|
_assertSingleLink(inputProps);
|
|
36
|
-
!(inputProps.value == null && inputProps.onChange == null) ?
|
|
36
|
+
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function _assertCheckedLink(inputProps) {
|
|
40
40
|
_assertSingleLink(inputProps);
|
|
41
|
-
!(inputProps.checked == null && inputProps.onChange == null) ?
|
|
41
|
+
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
var propTypes = {
|
|
@@ -84,7 +84,7 @@ var LinkedValueUtils = {
|
|
|
84
84
|
loggedTypeFailures[error.message] = true;
|
|
85
85
|
|
|
86
86
|
var addendum = getDeclarationErrorAddendum(owner);
|
|
87
|
-
|
|
87
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
},
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 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 MetaMatchers
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This modules adds a jasmine matcher toEqualSpecsIn that can be used to
|
|
16
|
+
* compare the specs in two different "describe" functions and their result.
|
|
17
|
+
* It can be used to test a test.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
function getRunnerWithResults(describeFunction) {
|
|
21
|
+
if (describeFunction._cachedRunner) {
|
|
22
|
+
// Cached result of execution. This is a convenience way to test against
|
|
23
|
+
// the same authorative function multiple times.
|
|
24
|
+
return describeFunction._cachedRunner;
|
|
25
|
+
}
|
|
26
|
+
// Patch the current global environment.
|
|
27
|
+
var env = new jasmine.Env();
|
|
28
|
+
// Execute the tests synchronously.
|
|
29
|
+
env.updateInterval = 0;
|
|
30
|
+
var outerGetEnv = jasmine.getEnv;
|
|
31
|
+
jasmine.getEnv = function () {
|
|
32
|
+
return env;
|
|
33
|
+
};
|
|
34
|
+
// TODO: Bring over matchers from the existing environment.
|
|
35
|
+
var runner = env.currentRunner();
|
|
36
|
+
try {
|
|
37
|
+
env.describe('', describeFunction);
|
|
38
|
+
env.execute();
|
|
39
|
+
} finally {
|
|
40
|
+
// Restore the environment.
|
|
41
|
+
jasmine.getEnv = outerGetEnv;
|
|
42
|
+
}
|
|
43
|
+
describeFunction._cachedRunner = runner;
|
|
44
|
+
return runner;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function compareSpec(actual, expected) {
|
|
48
|
+
if (actual.results().totalCount !== expected.results().totalCount) {
|
|
49
|
+
return 'Expected ' + expected.results().totalCount + ' expects, ' + 'but got ' + actual.results().totalCount + ':' + actual.getFullName();
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function includesDescription(specs, description, startIndex) {
|
|
55
|
+
for (var i = startIndex; i < specs.length; i++) {
|
|
56
|
+
if (specs[i].description === description) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function compareSpecs(actualSpecs, expectedSpecs) {
|
|
64
|
+
for (var i = 0; i < actualSpecs.length && i < expectedSpecs.length; i++) {
|
|
65
|
+
var actual = actualSpecs[i];
|
|
66
|
+
var expected = expectedSpecs[i];
|
|
67
|
+
if (actual.description === expected.description) {
|
|
68
|
+
var errorMessage = compareSpec(actual, expected);
|
|
69
|
+
if (errorMessage) {
|
|
70
|
+
return errorMessage;
|
|
71
|
+
}
|
|
72
|
+
continue;
|
|
73
|
+
} else if (includesDescription(actualSpecs, expected.description, i)) {
|
|
74
|
+
return 'Did not expect the spec:' + actualSpecs[i].getFullName();
|
|
75
|
+
} else {
|
|
76
|
+
return 'Expected an equivalent to:' + expectedSpecs[i].getFullName();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (i < actualSpecs.length) {
|
|
80
|
+
return 'Did not expect the spec:' + actualSpecs[i].getFullName();
|
|
81
|
+
}
|
|
82
|
+
if (i < expectedSpecs.length) {
|
|
83
|
+
return 'Expected an equivalent to:' + expectedSpecs[i].getFullName();
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function compareDescription(a, b) {
|
|
89
|
+
if (a.description === b.description) {
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
return a.description < b.description ? -1 : 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function compareRunners(actual, expected) {
|
|
96
|
+
return compareSpecs(actual.specs().sort(compareDescription), expected.specs().sort(compareDescription));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var MetaMatchers = {
|
|
100
|
+
toEqualSpecsIn: function (expectedDescribeFunction) {
|
|
101
|
+
var actualDescribeFunction = this.actual;
|
|
102
|
+
if (typeof actualDescribeFunction !== 'function') {
|
|
103
|
+
throw Error('toEqualSpecsIn() should be used on a describe function');
|
|
104
|
+
}
|
|
105
|
+
if (typeof expectedDescribeFunction !== 'function') {
|
|
106
|
+
throw Error('toEqualSpecsIn() should be passed a describe function');
|
|
107
|
+
}
|
|
108
|
+
var actual = getRunnerWithResults(actualDescribeFunction);
|
|
109
|
+
var expected = getRunnerWithResults(expectedDescribeFunction);
|
|
110
|
+
var errorMessage = compareRunners(actual, expected);
|
|
111
|
+
this.message = function () {
|
|
112
|
+
return [errorMessage, 'The specs are equal. Expected them to be different.'];
|
|
113
|
+
};
|
|
114
|
+
return !errorMessage;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
module.exports = MetaMatchers;
|