react 0.14.0-alpha2 → 0.14.0-beta3

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.
Files changed (196) hide show
  1. package/README.md +5 -2
  2. package/addons.js +6 -3
  3. package/dist/JSXTransformer.js +634 -274
  4. package/dist/react-with-addons.js +5350 -4954
  5. package/dist/react-with-addons.min.js +6 -6
  6. package/dist/react.js +4777 -4408
  7. package/dist/react.min.js +6 -5
  8. package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +15 -5
  9. package/lib/BeforeInputEventPlugin.js +13 -13
  10. package/lib/CSSProperty.js +3 -0
  11. package/lib/CSSPropertyOperations.js +13 -13
  12. package/lib/CallbackQueue.js +4 -4
  13. package/lib/ChangeEventPlugin.js +16 -14
  14. package/lib/DOMChildrenOperations.js +10 -6
  15. package/lib/DOMProperty.js +82 -117
  16. package/lib/DOMPropertyOperations.js +78 -33
  17. package/lib/Danger.js +14 -14
  18. package/lib/DefaultEventPluginOrder.js +2 -2
  19. package/lib/EnterLeaveEventPlugin.js +8 -8
  20. package/lib/EventConstants.js +23 -1
  21. package/lib/EventPluginHub.js +13 -13
  22. package/lib/EventPluginRegistry.js +8 -8
  23. package/lib/EventPluginUtils.js +17 -17
  24. package/lib/EventPropagators.js +7 -7
  25. package/lib/FallbackCompositionState.js +3 -3
  26. package/lib/HTMLDOMPropertyConfig.js +13 -3
  27. package/lib/LinkedStateMixin.js +2 -2
  28. package/lib/LinkedValueUtils.js +50 -38
  29. package/lib/MetaMatchers.js +118 -0
  30. package/lib/OrderedMap.js +453 -0
  31. package/lib/PooledClass.js +14 -2
  32. package/lib/React.js +6 -6
  33. package/lib/ReactBrowserComponentMixin.js +4 -4
  34. package/lib/ReactBrowserEventEmitter.js +30 -7
  35. package/lib/ReactCSSTransitionGroup.js +16 -5
  36. package/lib/ReactCSSTransitionGroupChild.js +20 -11
  37. package/lib/ReactChildReconciler.js +25 -18
  38. package/lib/ReactChildren.js +9 -9
  39. package/lib/ReactClass.js +65 -83
  40. package/lib/ReactComponent.js +22 -17
  41. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  42. package/lib/ReactComponentEnvironment.js +2 -2
  43. package/lib/ReactComponentWithPureRenderMixin.js +3 -3
  44. package/lib/ReactCompositeComponent.js +80 -111
  45. package/lib/ReactDOM.js +72 -158
  46. package/lib/ReactDOMButton.js +15 -26
  47. package/lib/ReactDOMComponent.js +378 -56
  48. package/lib/ReactDOMFactories.js +177 -0
  49. package/lib/ReactDOMIDOperations.js +23 -23
  50. package/lib/ReactDOMInput.js +83 -99
  51. package/lib/ReactDOMOption.js +25 -45
  52. package/lib/ReactDOMSelect.js +88 -98
  53. package/lib/ReactDOMSelection.js +3 -3
  54. package/lib/ReactDOMServer.js +2 -2
  55. package/lib/ReactDOMTextComponent.js +11 -11
  56. package/lib/ReactDOMTextarea.js +48 -61
  57. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  58. package/lib/ReactDefaultInjection.js +24 -71
  59. package/lib/ReactDefaultPerf.js +7 -7
  60. package/lib/ReactDefaultPerfAnalysis.js +6 -9
  61. package/lib/ReactElement.js +22 -83
  62. package/lib/ReactElementValidator.js +48 -117
  63. package/lib/ReactEmptyComponent.js +4 -4
  64. package/lib/ReactErrorUtils.js +1 -1
  65. package/lib/ReactEventEmitterMixin.js +3 -4
  66. package/lib/ReactEventListener.js +57 -12
  67. package/lib/ReactFragment.js +22 -17
  68. package/lib/ReactInjection.js +11 -11
  69. package/lib/ReactInputSelection.js +8 -7
  70. package/lib/ReactInstanceHandles.js +12 -12
  71. package/lib/ReactIsomorphic.js +11 -11
  72. package/lib/ReactLink.js +1 -1
  73. package/lib/ReactMarkupChecksum.js +6 -2
  74. package/lib/ReactMount.js +88 -88
  75. package/lib/ReactMultiChild.js +83 -22
  76. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  77. package/lib/ReactNativeComponent.js +3 -8
  78. package/lib/ReactNoopUpdateQueue.js +118 -0
  79. package/lib/ReactOwner.js +3 -3
  80. package/lib/ReactPerf.js +2 -2
  81. package/lib/ReactPropTransferer.js +3 -3
  82. package/lib/ReactPropTypeLocationNames.js +1 -1
  83. package/lib/ReactPropTypeLocations.js +1 -1
  84. package/lib/ReactPropTypes.js +49 -11
  85. package/lib/ReactReconcileTransaction.js +8 -8
  86. package/lib/ReactReconciler.js +18 -20
  87. package/lib/ReactRef.js +1 -1
  88. package/lib/ReactServerBatchingStrategy.js +23 -0
  89. package/lib/ReactServerRendering.js +22 -9
  90. package/lib/ReactServerRenderingTransaction.js +7 -7
  91. package/lib/ReactTestUtils.js +80 -58
  92. package/lib/ReactTransitionChildMapping.js +2 -2
  93. package/lib/ReactTransitionEvents.js +1 -1
  94. package/lib/ReactTransitionGroup.js +5 -6
  95. package/lib/ReactUpdateQueue.js +61 -36
  96. package/lib/ReactUpdates.js +14 -17
  97. package/lib/ReactWithAddons.js +14 -16
  98. package/lib/ResponderEventPlugin.js +514 -0
  99. package/lib/ResponderSyntheticEvent.js +40 -0
  100. package/lib/ResponderTouchHistoryStore.js +180 -0
  101. package/lib/SVGDOMPropertyConfig.js +1 -1
  102. package/lib/SelectEventPlugin.js +14 -15
  103. package/lib/SimpleEventPlugin.js +205 -29
  104. package/lib/SyntheticClipboardEvent.js +3 -3
  105. package/lib/SyntheticCompositionEvent.js +3 -3
  106. package/lib/SyntheticDragEvent.js +3 -3
  107. package/lib/SyntheticEvent.js +9 -8
  108. package/lib/SyntheticFocusEvent.js +3 -3
  109. package/lib/SyntheticInputEvent.js +3 -3
  110. package/lib/SyntheticKeyboardEvent.js +6 -6
  111. package/lib/SyntheticMouseEvent.js +5 -5
  112. package/lib/SyntheticTouchEvent.js +4 -4
  113. package/lib/SyntheticUIEvent.js +4 -4
  114. package/lib/SyntheticWheelEvent.js +3 -3
  115. package/lib/TapEventPlugin.js +119 -0
  116. package/lib/Transaction.js +16 -10
  117. package/lib/accumulate.js +44 -0
  118. package/lib/accumulateInto.js +2 -2
  119. package/lib/adler32.js +19 -7
  120. package/lib/cloneWithProps.js +12 -7
  121. package/lib/createHierarchyRenderer.js +85 -0
  122. package/lib/dangerousStyleValue.js +1 -1
  123. package/lib/deprecated.js +47 -0
  124. package/lib/findDOMNode.js +11 -12
  125. package/lib/flattenChildren.js +4 -4
  126. package/lib/forEachAccumulated.js +1 -1
  127. package/lib/getEventCharCode.js +1 -1
  128. package/lib/getEventKey.js +1 -1
  129. package/lib/getEventModifierState.js +0 -1
  130. package/lib/getTestDocument.js +28 -0
  131. package/lib/getTextContentAccessor.js +1 -1
  132. package/lib/instantiateReactComponent.js +24 -20
  133. package/lib/isEventSupported.js +1 -1
  134. package/lib/isTextInputElement.js +2 -1
  135. package/lib/joinClasses.js +1 -1
  136. package/lib/onlyChild.js +3 -3
  137. package/lib/quoteAttributeValueForBrowser.js +1 -1
  138. package/lib/reactComponentExpect.js +210 -0
  139. package/lib/renderSubtreeIntoContainer.js +1 -1
  140. package/lib/setInnerHTML.js +2 -2
  141. package/lib/setTextContent.js +3 -3
  142. package/lib/shallowCompare.js +1 -1
  143. package/lib/sliceChildren.js +51 -0
  144. package/lib/traverseAllChildren.js +15 -14
  145. package/lib/update.js +13 -13
  146. package/lib/validateDOMNesting.js +14 -6
  147. package/lib/webcomponents.js +6379 -0
  148. package/package.json +4 -6
  149. package/react.js +53 -1
  150. package/addons/CSSTransitionGroup.js +0 -1
  151. package/addons/LinkedStateMixin.js +0 -1
  152. package/addons/Perf.js +0 -1
  153. package/addons/PureRenderMixin.js +0 -1
  154. package/addons/TestUtils.js +0 -1
  155. package/addons/TransitionGroup.js +0 -1
  156. package/addons/batchedUpdates.js +0 -1
  157. package/addons/cloneWithProps.js +0 -1
  158. package/addons/createFragment.js +0 -1
  159. package/addons/renderSubtreeIntoContainer.js +0 -1
  160. package/addons/shallowCompare.js +0 -1
  161. package/addons/update.js +0 -1
  162. package/lib/CSSCore.js +0 -97
  163. package/lib/EventListener.js +0 -84
  164. package/lib/ExecutionEnvironment.js +0 -38
  165. package/lib/LocalEventTrapMixin.js +0 -46
  166. package/lib/ReactContext.js +0 -32
  167. package/lib/ReactDOMClient.js +0 -85
  168. package/lib/ReactDOMForm.js +0 -47
  169. package/lib/ReactDOMIframe.js +0 -43
  170. package/lib/ReactDOMImg.js +0 -44
  171. package/lib/ReactLifeCycle.js +0 -35
  172. package/lib/camelize.js +0 -32
  173. package/lib/camelizeStyleName.js +0 -40
  174. package/lib/containsNode.js +0 -55
  175. package/lib/createArrayFromMixed.js +0 -85
  176. package/lib/createFullPageComponent.js +0 -51
  177. package/lib/createNodesFromMarkup.js +0 -84
  178. package/lib/emptyFunction.js +0 -38
  179. package/lib/emptyObject.js +0 -20
  180. package/lib/focusNode.js +0 -26
  181. package/lib/getActiveElement.js +0 -29
  182. package/lib/getMarkupWrap.js +0 -115
  183. package/lib/getUnboundedScrollPosition.js +0 -38
  184. package/lib/hyphenate.js +0 -33
  185. package/lib/hyphenateStyleName.js +0 -39
  186. package/lib/invariant.js +0 -49
  187. package/lib/isNode.js +0 -23
  188. package/lib/isTextNode.js +0 -25
  189. package/lib/keyMirror.js +0 -48
  190. package/lib/keyOf.js +0 -35
  191. package/lib/mapObject.js +0 -51
  192. package/lib/performance.js +0 -23
  193. package/lib/performanceNow.js +0 -28
  194. package/lib/shallowEqual.js +0 -48
  195. package/lib/toArray.js +0 -57
  196. package/lib/warning.js +0 -61
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "0.14.0-alpha2",
4
+ "version": "0.14.0-beta3",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -16,15 +16,13 @@
16
16
  "lib/"
17
17
  ],
18
18
  "main": "react.js",
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/facebook/react"
22
- },
19
+ "repository": "facebook/react",
23
20
  "engines": {
24
21
  "node": ">=0.10.0"
25
22
  },
26
23
  "dependencies": {
27
- "envify": "^3.0.0"
24
+ "envify": "^3.0.0",
25
+ "fbjs": "0.1.0-alpha.4"
28
26
  },
29
27
  "browserify": {
30
28
  "transform": [
package/react.js CHANGED
@@ -1 +1,53 @@
1
- module.exports = require('./lib/React');
1
+ 'use strict';
2
+
3
+ var React = require('./lib/React');
4
+
5
+ var assign = require('./lib/Object.assign');
6
+ var deprecated = require('./lib/deprecated');
7
+
8
+ // We want to warn once when any of these methods are used.
9
+ if (process.env.NODE_ENV !== 'production') {
10
+ var deprecations = {
11
+ // ReactDOM
12
+ findDOMNode: deprecated(
13
+ 'findDOMNode',
14
+ 'react-dom',
15
+ React,
16
+ React.findDOMNode
17
+ ),
18
+ render: deprecated(
19
+ 'render',
20
+ 'react-dom',
21
+ React,
22
+ React.render
23
+ ),
24
+ unmountComponentAtNode: deprecated(
25
+ 'unmountComponentAtNode',
26
+ 'react-dom',
27
+ React,
28
+ React.unmountComponentAtNode
29
+ ),
30
+ // ReactDOMServer
31
+ renderToString: deprecated(
32
+ 'renderToString',
33
+ 'react-dom/server',
34
+ React,
35
+ React.renderToString
36
+ ),
37
+ renderToStaticMarkup: deprecated(
38
+ 'renderToStaticMarkup',
39
+ 'react-dom/server',
40
+ React,
41
+ React.renderToStaticMarkup
42
+ ),
43
+ };
44
+ // Export a wrapped object. We'll use assign and take advantage of the fact
45
+ // that this will override the original methods in React.
46
+ module.exports = assign(
47
+ {},
48
+ React,
49
+ deprecations
50
+ );
51
+ } else {
52
+ module.exports = React;
53
+ }
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactCSSTransitionGroup');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/LinkedStateMixin');
package/addons/Perf.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactDefaultPerf');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactComponentWithPureRenderMixin');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactTestUtils');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactTransitionGroup');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactUpdates').batchedUpdates;
@@ -1 +0,0 @@
1
- module.exports = require('../lib/cloneWithProps');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/ReactFragment').create;
@@ -1 +0,0 @@
1
- module.exports = require('../lib/renderSubtreeIntoContainer');
@@ -1 +0,0 @@
1
- module.exports = require('../lib/shallowCompare');
package/addons/update.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('../lib/update');
package/lib/CSSCore.js DELETED
@@ -1,97 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule CSSCore
10
- * @typechecks
11
- */
12
-
13
- 'use strict';
14
-
15
- var invariant = require("./invariant");
16
-
17
- /**
18
- * The CSSCore module specifies the API (and implements most of the methods)
19
- * that should be used when dealing with the display of elements (via their
20
- * CSS classes and visibility on screen. It is an API focused on mutating the
21
- * display and not reading it as no logical state should be encoded in the
22
- * display of elements.
23
- */
24
-
25
- var CSSCore = {
26
-
27
- /**
28
- * Adds the class passed in to the element if it doesn't already have it.
29
- *
30
- * @param {DOMElement} element the element to set the class on
31
- * @param {string} className the CSS className
32
- * @return {DOMElement} the element passed in
33
- */
34
- addClass: function (element, className) {
35
- 'production' !== process.env.NODE_ENV ? invariant(!/\s/.test(className), 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className));
36
-
37
- if (className) {
38
- if (element.classList) {
39
- element.classList.add(className);
40
- } else if (!CSSCore.hasClass(element, className)) {
41
- element.className = element.className + ' ' + className;
42
- }
43
- }
44
- return element;
45
- },
46
-
47
- /**
48
- * Removes the class passed in from the element
49
- *
50
- * @param {DOMElement} element the element to set the class on
51
- * @param {string} className the CSS className
52
- * @return {DOMElement} the element passed in
53
- */
54
- removeClass: function (element, className) {
55
- 'production' !== process.env.NODE_ENV ? invariant(!/\s/.test(className), 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className));
56
-
57
- if (className) {
58
- if (element.classList) {
59
- element.classList.remove(className);
60
- } else if (CSSCore.hasClass(element, className)) {
61
- element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one
62
- .replace(/^\s*|\s*$/g, ''); // trim the ends
63
- }
64
- }
65
- return element;
66
- },
67
-
68
- /**
69
- * Helper to add or remove a class from an element based on a condition.
70
- *
71
- * @param {DOMElement} element the element to set the class on
72
- * @param {string} className the CSS className
73
- * @param {*} bool condition to whether to add or remove the class
74
- * @return {DOMElement} the element passed in
75
- */
76
- conditionClass: function (element, className, bool) {
77
- return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
78
- },
79
-
80
- /**
81
- * Tests whether the element has the class specified.
82
- *
83
- * @param {DOMNode|DOMWindow} element the element to set the class on
84
- * @param {string} className the CSS className
85
- * @return {boolean} true if the element has the class, false if not
86
- */
87
- hasClass: function (element, className) {
88
- 'production' !== process.env.NODE_ENV ? invariant(!/\s/.test(className), 'CSS.hasClass takes only a single class name.') : invariant(!/\s/.test(className));
89
- if (element.classList) {
90
- return !!className && element.classList.contains(className);
91
- }
92
- return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
93
- }
94
-
95
- };
96
-
97
- module.exports = CSSCore;
@@ -1,84 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
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.
15
- *
16
- * @providesModule EventListener
17
- * @typechecks
18
- */
19
-
20
- 'use strict';
21
-
22
- var emptyFunction = require("./emptyFunction");
23
-
24
- /**
25
- * Upstream version of event listener. Does not take into account specific
26
- * nature of platform.
27
- */
28
- var EventListener = {
29
- /**
30
- * Listen to DOM events during the bubble phase.
31
- *
32
- * @param {DOMEventTarget} target DOM element to register listener on.
33
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
34
- * @param {function} callback Callback function.
35
- * @return {object} Object with a `remove` method.
36
- */
37
- listen: function (target, eventType, callback) {
38
- if (target.addEventListener) {
39
- target.addEventListener(eventType, callback, false);
40
- return {
41
- remove: function () {
42
- target.removeEventListener(eventType, callback, false);
43
- }
44
- };
45
- } else if (target.attachEvent) {
46
- target.attachEvent('on' + eventType, callback);
47
- return {
48
- remove: function () {
49
- target.detachEvent('on' + eventType, callback);
50
- }
51
- };
52
- }
53
- },
54
-
55
- /**
56
- * Listen to DOM events during the capture phase.
57
- *
58
- * @param {DOMEventTarget} target DOM element to register listener on.
59
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
60
- * @param {function} callback Callback function.
61
- * @return {object} Object with a `remove` method.
62
- */
63
- capture: function (target, eventType, callback) {
64
- if (!target.addEventListener) {
65
- if ('production' !== process.env.NODE_ENV) {
66
- console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
67
- }
68
- return {
69
- remove: emptyFunction
70
- };
71
- } else {
72
- target.addEventListener(eventType, callback, true);
73
- return {
74
- remove: function () {
75
- target.removeEventListener(eventType, callback, true);
76
- }
77
- };
78
- }
79
- },
80
-
81
- registerDefault: function () {}
82
- };
83
-
84
- module.exports = EventListener;
@@ -1,38 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule ExecutionEnvironment
10
- */
11
-
12
- /*jslint evil: true */
13
-
14
- 'use strict';
15
-
16
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
17
-
18
- /**
19
- * Simple, lightweight module assisting with the detection and context of
20
- * Worker. Helps avoid circular dependencies and allows code to reason about
21
- * whether or not they are in a Worker, even if they never include the main
22
- * `ReactWorker` dependency.
23
- */
24
- var ExecutionEnvironment = {
25
-
26
- canUseDOM: canUseDOM,
27
-
28
- canUseWorkers: typeof Worker !== 'undefined',
29
-
30
- canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
31
-
32
- canUseViewport: canUseDOM && !!window.screen,
33
-
34
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
35
-
36
- };
37
-
38
- module.exports = ExecutionEnvironment;
@@ -1,46 +0,0 @@
1
- /**
2
- * Copyright 2014-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 LocalEventTrapMixin
10
- */
11
-
12
- 'use strict';
13
-
14
- var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
15
-
16
- var accumulateInto = require("./accumulateInto");
17
- var findDOMNode = require("./findDOMNode");
18
- var forEachAccumulated = require("./forEachAccumulated");
19
- var invariant = require("./invariant");
20
-
21
- function remove(event) {
22
- event.remove();
23
- }
24
-
25
- var LocalEventTrapMixin = {
26
- trapBubbledEvent: function (topLevelType, handlerBaseName) {
27
- 'production' !== process.env.NODE_ENV ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted());
28
- // If a component renders to null or if another component fatals and causes
29
- // the state of the tree to be corrupted, `node` here can be null.
30
- var node = findDOMNode(this);
31
- 'production' !== process.env.NODE_ENV ? invariant(node, 'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.') : invariant(node);
32
- var listener = ReactBrowserEventEmitter.trapBubbledEvent(topLevelType, handlerBaseName, node);
33
- this._localEventListeners = accumulateInto(this._localEventListeners, listener);
34
- },
35
-
36
- // trapCapturedEvent would look nearly identical. We don't implement that
37
- // method because it isn't currently needed.
38
-
39
- componentWillUnmount: function () {
40
- if (this._localEventListeners) {
41
- forEachAccumulated(this._localEventListeners, remove);
42
- }
43
- }
44
- };
45
-
46
- module.exports = LocalEventTrapMixin;
@@ -1,32 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule ReactContext
10
- */
11
-
12
- 'use strict';
13
-
14
- var emptyObject = require("./emptyObject");
15
-
16
- /**
17
- * Keeps track of the current context.
18
- *
19
- * The context is automatically passed down the component ownership hierarchy
20
- * and is accessible via `this.context` on ReactCompositeComponents.
21
- */
22
- var ReactContext = {
23
-
24
- /**
25
- * @internal
26
- * @type {object}
27
- */
28
- current: emptyObject
29
-
30
- };
31
-
32
- module.exports = ReactContext;
@@ -1,85 +0,0 @@
1
- /**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule ReactDOMClient
10
- */
11
-
12
- /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
13
-
14
- 'use strict';
15
-
16
- var ReactCurrentOwner = require("./ReactCurrentOwner");
17
- var ReactDOMTextComponent = require("./ReactDOMTextComponent");
18
- var ReactDefaultInjection = require("./ReactDefaultInjection");
19
- var ReactInstanceHandles = require("./ReactInstanceHandles");
20
- var ReactMount = require("./ReactMount");
21
- var ReactPerf = require("./ReactPerf");
22
- var ReactReconciler = require("./ReactReconciler");
23
-
24
- var findDOMNode = require("./findDOMNode");
25
- var warning = require("./warning");
26
-
27
- ReactDefaultInjection.inject();
28
-
29
- var render = ReactPerf.measure('React', 'render', ReactMount.render);
30
-
31
- var React = {
32
- constructAndRenderComponent: ReactMount.constructAndRenderComponent,
33
- constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
34
- findDOMNode: findDOMNode,
35
- render: render,
36
- unmountComponentAtNode: ReactMount.unmountComponentAtNode
37
- };
38
-
39
- // Inject the runtime into a devtools global hook regardless of browser.
40
- // Allows for debugging when the hook is injected on the page.
41
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
42
- __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
43
- CurrentOwner: ReactCurrentOwner,
44
- InstanceHandles: ReactInstanceHandles,
45
- Mount: ReactMount,
46
- Reconciler: ReactReconciler,
47
- TextComponent: ReactDOMTextComponent
48
- });
49
- }
50
-
51
- if ('production' !== process.env.NODE_ENV) {
52
- var ExecutionEnvironment = require("./ExecutionEnvironment");
53
- if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
54
-
55
- // If we're in Chrome, look for the devtools marker and provide a download
56
- // link if not installed.
57
- if (navigator.userAgent.indexOf('Chrome') > -1) {
58
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
59
- console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
60
- }
61
- }
62
-
63
- // If we're in IE8, check to see if we are in combatibility mode and provide
64
- // information on preventing compatibility mode
65
- var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
66
-
67
- 'production' !== process.env.NODE_ENV ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : null;
68
-
69
- var expectedFeatures = [
70
- // shims
71
- Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
72
-
73
- // shams
74
- Object.create, Object.freeze];
75
-
76
- for (var i = 0; i < expectedFeatures.length; i++) {
77
- if (!expectedFeatures[i]) {
78
- console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
79
- break;
80
- }
81
- }
82
- }
83
- }
84
-
85
- module.exports = React;