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.
Files changed (182) hide show
  1. package/dist/JSXTransformer.js +1376 -596
  2. package/dist/react-with-addons.js +3256 -2363
  3. package/dist/react-with-addons.min.js +7 -7
  4. package/dist/react.js +3092 -2266
  5. package/dist/react.min.js +6 -7
  6. package/lib/AutoFocusMixin.js +2 -2
  7. package/lib/BeforeInputEventPlugin.js +5 -9
  8. package/lib/CSSCore.js +1 -1
  9. package/lib/CSSProperty.js +4 -2
  10. package/lib/CSSPropertyOperations.js +44 -17
  11. package/lib/CallbackQueue.js +3 -3
  12. package/lib/ChangeEventPlugin.js +2 -2
  13. package/lib/ClientReactRootIndex.js +2 -2
  14. package/lib/DOMChildrenOperations.js +10 -47
  15. package/lib/DOMProperty.js +2 -2
  16. package/lib/DOMPropertyOperations.js +11 -16
  17. package/lib/Danger.js +7 -6
  18. package/lib/DefaultEventPluginOrder.js +3 -3
  19. package/lib/EnterLeaveEventPlugin.js +2 -2
  20. package/lib/EventConstants.js +2 -2
  21. package/lib/EventListener.js +1 -1
  22. package/lib/EventPluginHub.js +10 -8
  23. package/lib/EventPluginRegistry.js +2 -2
  24. package/lib/EventPluginUtils.js +4 -4
  25. package/lib/EventPropagators.js +2 -2
  26. package/lib/ExecutionEnvironment.js +1 -1
  27. package/lib/FallbackCompositionState.js +7 -5
  28. package/lib/HTMLDOMPropertyConfig.js +22 -10
  29. package/lib/LinkedStateMixin.js +2 -2
  30. package/lib/LinkedValueUtils.js +4 -4
  31. package/lib/LocalEventTrapMixin.js +10 -3
  32. package/lib/MobileSafariClickEventPlugin.js +2 -2
  33. package/lib/Object.assign.js +2 -2
  34. package/lib/PooledClass.js +2 -2
  35. package/lib/React.js +9 -13
  36. package/lib/ReactBrowserComponentMixin.js +2 -2
  37. package/lib/ReactBrowserEventEmitter.js +4 -4
  38. package/lib/ReactCSSTransitionGroup.js +2 -2
  39. package/lib/ReactCSSTransitionGroupChild.js +12 -7
  40. package/lib/ReactChildReconciler.js +11 -7
  41. package/lib/ReactChildren.js +13 -10
  42. package/lib/ReactClass.js +161 -135
  43. package/lib/ReactComponent.js +100 -158
  44. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  45. package/lib/ReactComponentEnvironment.js +3 -3
  46. package/lib/ReactComponentWithPureRenderMixin.js +2 -2
  47. package/lib/ReactCompositeComponent.js +336 -484
  48. package/lib/ReactContext.js +14 -4
  49. package/lib/ReactCurrentOwner.js +2 -2
  50. package/lib/ReactDOM.js +2 -2
  51. package/lib/ReactDOMButton.js +2 -2
  52. package/lib/ReactDOMComponent.js +42 -52
  53. package/lib/ReactDOMForm.js +2 -2
  54. package/lib/ReactDOMIDOperations.js +4 -4
  55. package/lib/ReactDOMIframe.js +43 -0
  56. package/lib/ReactDOMImg.js +2 -2
  57. package/lib/ReactDOMInput.js +2 -2
  58. package/lib/ReactDOMOption.js +2 -2
  59. package/lib/ReactDOMSelect.js +3 -3
  60. package/lib/ReactDOMSelection.js +2 -2
  61. package/lib/ReactDOMTextComponent.js +4 -13
  62. package/lib/ReactDOMTextarea.js +2 -2
  63. package/lib/ReactDefaultBatchingStrategy.js +5 -5
  64. package/lib/ReactDefaultInjection.js +26 -2
  65. package/lib/ReactDefaultPerf.js +12 -4
  66. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  67. package/lib/ReactElement.js +7 -5
  68. package/lib/ReactElementValidator.js +185 -65
  69. package/lib/ReactEmptyComponent.js +17 -6
  70. package/lib/ReactErrorUtils.js +1 -1
  71. package/lib/ReactEventEmitterMixin.js +2 -2
  72. package/lib/ReactEventListener.js +4 -5
  73. package/lib/ReactFragment.js +180 -0
  74. package/lib/ReactInjection.js +2 -2
  75. package/lib/ReactInputSelection.js +2 -2
  76. package/lib/ReactInstanceHandles.js +4 -3
  77. package/lib/ReactInstanceMap.js +2 -2
  78. package/lib/ReactLifeCycle.js +35 -0
  79. package/lib/ReactLink.js +2 -2
  80. package/lib/ReactMarkupChecksum.js +2 -2
  81. package/lib/ReactMount.js +87 -23
  82. package/lib/ReactMultiChild.js +19 -7
  83. package/lib/ReactMultiChildUpdateTypes.js +2 -2
  84. package/lib/ReactNativeComponent.js +34 -37
  85. package/lib/ReactOwner.js +2 -2
  86. package/lib/ReactPerf.js +2 -2
  87. package/lib/ReactPropTransferer.js +3 -3
  88. package/lib/ReactPropTypeLocationNames.js +2 -2
  89. package/lib/ReactPropTypeLocations.js +2 -2
  90. package/lib/ReactPropTypes.js +16 -8
  91. package/lib/ReactPutListenerQueue.js +2 -2
  92. package/lib/ReactReconcileTransaction.js +2 -2
  93. package/lib/ReactReconciler.js +121 -0
  94. package/lib/ReactRef.js +41 -68
  95. package/lib/ReactRootIndex.js +2 -2
  96. package/lib/ReactServerRendering.js +4 -3
  97. package/lib/ReactServerRenderingTransaction.js +2 -2
  98. package/lib/ReactStateSetters.js +2 -2
  99. package/lib/ReactTestUtils.js +49 -8
  100. package/lib/ReactTransitionChildMapping.js +8 -4
  101. package/lib/ReactTransitionEvents.js +2 -2
  102. package/lib/ReactTransitionGroup.js +6 -6
  103. package/lib/ReactUpdateQueue.js +295 -0
  104. package/lib/ReactUpdates.js +13 -22
  105. package/lib/ReactWithAddons.js +4 -2
  106. package/lib/SVGDOMPropertyConfig.js +2 -2
  107. package/lib/SelectEventPlugin.js +4 -4
  108. package/lib/ServerReactRootIndex.js +2 -2
  109. package/lib/SimpleEventPlugin.js +4 -4
  110. package/lib/SyntheticClipboardEvent.js +2 -3
  111. package/lib/SyntheticCompositionEvent.js +2 -3
  112. package/lib/SyntheticDragEvent.js +2 -2
  113. package/lib/SyntheticEvent.js +12 -4
  114. package/lib/SyntheticFocusEvent.js +2 -2
  115. package/lib/SyntheticInputEvent.js +2 -3
  116. package/lib/SyntheticKeyboardEvent.js +2 -2
  117. package/lib/SyntheticMouseEvent.js +2 -2
  118. package/lib/SyntheticTouchEvent.js +2 -2
  119. package/lib/SyntheticUIEvent.js +2 -2
  120. package/lib/SyntheticWheelEvent.js +2 -2
  121. package/lib/Transaction.js +5 -5
  122. package/lib/ViewportMetrics.js +2 -2
  123. package/lib/accumulateInto.js +2 -2
  124. package/lib/adler32.js +2 -2
  125. package/lib/camelize.js +1 -1
  126. package/lib/camelizeStyleName.js +1 -1
  127. package/lib/cloneWithProps.js +4 -4
  128. package/lib/containsNode.js +1 -1
  129. package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
  130. package/lib/createFullPageComponent.js +2 -2
  131. package/lib/createNodesFromMarkup.js +4 -4
  132. package/lib/cx.js +16 -1
  133. package/lib/dangerousStyleValue.js +2 -2
  134. package/lib/emptyFunction.js +1 -1
  135. package/lib/emptyObject.js +1 -1
  136. package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +10 -11
  137. package/lib/findDOMNode.js +26 -9
  138. package/lib/flattenChildren.js +11 -9
  139. package/lib/focusNode.js +1 -1
  140. package/lib/forEachAccumulated.js +2 -2
  141. package/lib/getActiveElement.js +1 -1
  142. package/lib/getEventCharCode.js +2 -2
  143. package/lib/getEventKey.js +2 -2
  144. package/lib/getEventModifierState.js +2 -2
  145. package/lib/getEventTarget.js +2 -2
  146. package/lib/getIteratorFn.js +2 -2
  147. package/lib/getMarkupWrap.js +1 -1
  148. package/lib/getNodeForCharacterOffset.js +3 -3
  149. package/lib/getReactRootElementInContainer.js +2 -2
  150. package/lib/getTextContentAccessor.js +2 -2
  151. package/lib/getUnboundedScrollPosition.js +1 -1
  152. package/lib/hyphenate.js +1 -1
  153. package/lib/hyphenateStyleName.js +1 -1
  154. package/lib/instantiateReactComponent.js +21 -21
  155. package/lib/invariant.js +1 -1
  156. package/lib/isEventSupported.js +2 -2
  157. package/lib/isNode.js +1 -1
  158. package/lib/isTextInputElement.js +2 -2
  159. package/lib/isTextNode.js +1 -1
  160. package/lib/joinClasses.js +2 -2
  161. package/lib/keyMirror.js +2 -2
  162. package/lib/keyOf.js +1 -1
  163. package/lib/mapObject.js +1 -1
  164. package/lib/memoizeStringOnly.js +5 -6
  165. package/lib/onlyChild.js +2 -2
  166. package/lib/performance.js +1 -1
  167. package/lib/performanceNow.js +1 -1
  168. package/lib/quoteAttributeValueForBrowser.js +26 -0
  169. package/lib/setInnerHTML.js +13 -2
  170. package/lib/setTextContent.js +40 -0
  171. package/lib/shallowEqual.js +2 -2
  172. package/lib/shouldUpdateReactComponent.js +64 -8
  173. package/lib/toArray.js +2 -2
  174. package/lib/traverseAllChildren.js +19 -5
  175. package/lib/update.js +2 -2
  176. package/lib/warning.js +20 -2
  177. package/package.json +1 -1
  178. package/lib/accumulate.js +0 -47
  179. package/lib/copyProperties.js +0 -56
  180. package/lib/merge.js +0 -34
  181. package/lib/mergeInto.js +0 -24
  182. package/lib/monitorCodeUse.js +0 -30
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014, Facebook, Inc.
2
+ * Copyright 2014-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 ReactEmptyComponent
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactElement = require("./ReactElement");
15
15
  var ReactInstanceMap = require("./ReactInstanceMap");
@@ -19,7 +19,7 @@ var invariant = require("./invariant");
19
19
  var component;
20
20
  // This registry keeps track of the React IDs of the components that rendered to
21
21
  // `null` (in reality a placeholder such as `noscript`)
22
- var nullComponentIdsRegistry = {};
22
+ var nullComponentIDsRegistry = {};
23
23
 
24
24
  var ReactEmptyComponentInjection = {
25
25
  injectEmptyComponent: function(emptyComponent) {
@@ -30,10 +30,21 @@ var ReactEmptyComponentInjection = {
30
30
  var ReactEmptyComponentType = function() {};
31
31
  ReactEmptyComponentType.prototype.componentDidMount = function() {
32
32
  var internalInstance = ReactInstanceMap.get(this);
33
+ // TODO: Make sure we run these methods in the correct order, we shouldn't
34
+ // need this check. We're going to assume if we're here it means we ran
35
+ // componentWillUnmount already so there is no internal instance (it gets
36
+ // removed as part of the unmounting process).
37
+ if (!internalInstance) {
38
+ return;
39
+ }
33
40
  registerNullComponentID(internalInstance._rootNodeID);
34
41
  };
35
42
  ReactEmptyComponentType.prototype.componentWillUnmount = function() {
36
43
  var internalInstance = ReactInstanceMap.get(this);
44
+ // TODO: Get rid of this check. See TODO in componentDidMount.
45
+ if (!internalInstance) {
46
+ return;
47
+ }
37
48
  deregisterNullComponentID(internalInstance._rootNodeID);
38
49
  };
39
50
  ReactEmptyComponentType.prototype.render = function() {
@@ -52,7 +63,7 @@ var emptyElement = ReactElement.createElement(ReactEmptyComponentType);
52
63
  * @param {string} id Component's `_rootNodeID`.
53
64
  */
54
65
  function registerNullComponentID(id) {
55
- nullComponentIdsRegistry[id] = true;
66
+ nullComponentIDsRegistry[id] = true;
56
67
  }
57
68
 
58
69
  /**
@@ -60,7 +71,7 @@ function registerNullComponentID(id) {
60
71
  * @param {string} id Component's `_rootNodeID`.
61
72
  */
62
73
  function deregisterNullComponentID(id) {
63
- delete nullComponentIdsRegistry[id];
74
+ delete nullComponentIDsRegistry[id];
64
75
  }
65
76
 
66
77
  /**
@@ -68,7 +79,7 @@ function deregisterNullComponentID(id) {
68
79
  * @return {boolean} True if the component is rendered to null.
69
80
  */
70
81
  function isNullComponentID(id) {
71
- return !!nullComponentIdsRegistry[id];
82
+ return !!nullComponentIDsRegistry[id];
72
83
  }
73
84
 
74
85
  var ReactEmptyComponent = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactEventEmitterMixin
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventPluginHub = require("./EventPluginHub");
15
15
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var EventListener = require("./EventListener");
16
16
  var ExecutionEnvironment = require("./ExecutionEnvironment");
@@ -123,7 +123,7 @@ var ReactEventListener = {
123
123
  trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
124
124
  var element = handle;
125
125
  if (!element) {
126
- return;
126
+ return null;
127
127
  }
128
128
  return EventListener.listen(
129
129
  element,
@@ -145,7 +145,7 @@ var ReactEventListener = {
145
145
  trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
146
146
  var element = handle;
147
147
  if (!element) {
148
- return;
148
+ return null;
149
149
  }
150
150
  return EventListener.capture(
151
151
  element,
@@ -157,7 +157,6 @@ var ReactEventListener = {
157
157
  monitorScrollValue: function(refresh) {
158
158
  var callback = scrollValueMonitor.bind(null, refresh);
159
159
  EventListener.listen(window, 'scroll', callback);
160
- EventListener.listen(window, 'resize', callback);
161
160
  },
162
161
 
163
162
  dispatchEvent: function(topLevelType, nativeEvent) {
@@ -0,0 +1,180 @@
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 ReactFragment
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var ReactElement = require("./ReactElement");
15
+
16
+ var warning = require("./warning");
17
+
18
+ /**
19
+ * We used to allow keyed objects to serve as a collection of ReactElements,
20
+ * or nested sets. This allowed us a way to explicitly key a set a fragment of
21
+ * components. This is now being replaced with an opaque data structure.
22
+ * The upgrade path is to call React.addons.createFragment({ key: value }) to
23
+ * create a keyed fragment. The resulting data structure is opaque, for now.
24
+ */
25
+
26
+ if ("production" !== process.env.NODE_ENV) {
27
+ var fragmentKey = '_reactFragment';
28
+ var didWarnKey = '_reactDidWarn';
29
+ var canWarnForReactFragment = false;
30
+
31
+ try {
32
+ // Feature test. Don't even try to issue this warning if we can't use
33
+ // enumerable: false.
34
+
35
+ var dummy = function() {
36
+ return 1;
37
+ };
38
+
39
+ Object.defineProperty(
40
+ {},
41
+ fragmentKey,
42
+ {enumerable: false, value: true}
43
+ );
44
+
45
+ Object.defineProperty(
46
+ {},
47
+ 'key',
48
+ {enumerable: true, get: dummy}
49
+ );
50
+
51
+ canWarnForReactFragment = true;
52
+ } catch (x) { }
53
+
54
+ var proxyPropertyAccessWithWarning = function(obj, key) {
55
+ Object.defineProperty(obj, key, {
56
+ enumerable: true,
57
+ get: function() {
58
+ ("production" !== process.env.NODE_ENV ? warning(
59
+ this[didWarnKey],
60
+ 'A ReactFragment is an opaque type. Accessing any of its ' +
61
+ 'properties is deprecated. Pass it to one of the React.Children ' +
62
+ 'helpers.'
63
+ ) : null);
64
+ this[didWarnKey] = true;
65
+ return this[fragmentKey][key];
66
+ },
67
+ set: function(value) {
68
+ ("production" !== process.env.NODE_ENV ? warning(
69
+ this[didWarnKey],
70
+ 'A ReactFragment is an immutable opaque type. Mutating its ' +
71
+ 'properties is deprecated.'
72
+ ) : null);
73
+ this[didWarnKey] = true;
74
+ this[fragmentKey][key] = value;
75
+ }
76
+ });
77
+ };
78
+
79
+ var issuedWarnings = {};
80
+
81
+ var didWarnForFragment = function(fragment) {
82
+ // We use the keys and the type of the value as a heuristic to dedupe the
83
+ // warning to avoid spamming too much.
84
+ var fragmentCacheKey = '';
85
+ for (var key in fragment) {
86
+ fragmentCacheKey += key + ':' + (typeof fragment[key]) + ',';
87
+ }
88
+ var alreadyWarnedOnce = !!issuedWarnings[fragmentCacheKey];
89
+ issuedWarnings[fragmentCacheKey] = true;
90
+ return alreadyWarnedOnce;
91
+ };
92
+ }
93
+
94
+ var ReactFragment = {
95
+ // Wrap a keyed object in an opaque proxy that warns you if you access any
96
+ // of its properties.
97
+ create: function(object) {
98
+ if ("production" !== process.env.NODE_ENV) {
99
+ if (typeof object !== 'object' || !object || Array.isArray(object)) {
100
+ ("production" !== process.env.NODE_ENV ? warning(
101
+ false,
102
+ 'React.addons.createFragment only accepts a single object.',
103
+ object
104
+ ) : null);
105
+ return object;
106
+ }
107
+ if (ReactElement.isValidElement(object)) {
108
+ ("production" !== process.env.NODE_ENV ? warning(
109
+ false,
110
+ 'React.addons.createFragment does not accept a ReactElement ' +
111
+ 'without a wrapper object.'
112
+ ) : null);
113
+ return object;
114
+ }
115
+ if (canWarnForReactFragment) {
116
+ var proxy = {};
117
+ Object.defineProperty(proxy, fragmentKey, {
118
+ enumerable: false,
119
+ value: object
120
+ });
121
+ Object.defineProperty(proxy, didWarnKey, {
122
+ writable: true,
123
+ enumerable: false,
124
+ value: false
125
+ });
126
+ for (var key in object) {
127
+ proxyPropertyAccessWithWarning(proxy, key);
128
+ }
129
+ Object.preventExtensions(proxy);
130
+ return proxy;
131
+ }
132
+ }
133
+ return object;
134
+ },
135
+ // Extract the original keyed object from the fragment opaque type. Warn if
136
+ // a plain object is passed here.
137
+ extract: function(fragment) {
138
+ if ("production" !== process.env.NODE_ENV) {
139
+ if (canWarnForReactFragment) {
140
+ if (!fragment[fragmentKey]) {
141
+ ("production" !== process.env.NODE_ENV ? warning(
142
+ didWarnForFragment(fragment),
143
+ 'Any use of a keyed object should be wrapped in ' +
144
+ 'React.addons.createFragment(object) before passed as a child.'
145
+ ) : null);
146
+ return fragment;
147
+ }
148
+ return fragment[fragmentKey];
149
+ }
150
+ }
151
+ return fragment;
152
+ },
153
+ // Check if this is a fragment and if so, extract the keyed object. If it
154
+ // is a fragment-like object, warn that it should be wrapped. Ignore if we
155
+ // can't determine what kind of object this is.
156
+ extractIfFragment: function(fragment) {
157
+ if ("production" !== process.env.NODE_ENV) {
158
+ if (canWarnForReactFragment) {
159
+ // If it is the opaque type, return the keyed object.
160
+ if (fragment[fragmentKey]) {
161
+ return fragment[fragmentKey];
162
+ }
163
+ // Otherwise, check each property if it has an element, if it does
164
+ // it is probably meant as a fragment, so we can warn early. Defer,
165
+ // the warning to extract.
166
+ for (var key in fragment) {
167
+ if (fragment.hasOwnProperty(key) &&
168
+ ReactElement.isValidElement(fragment[key])) {
169
+ // This looks like a fragment object, we should provide an
170
+ // early warning.
171
+ return ReactFragment.extract(fragment);
172
+ }
173
+ }
174
+ }
175
+ }
176
+ return fragment;
177
+ }
178
+ };
179
+
180
+ module.exports = ReactFragment;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactInjection
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var DOMProperty = require("./DOMProperty");
15
15
  var EventPluginHub = require("./EventPluginHub");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactInputSelection
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactDOMSelection = require("./ReactDOMSelection");
15
15
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var ReactRootIndex = require("./ReactRootIndex");
16
16
 
@@ -115,7 +115,8 @@ function getNextDescendantID(ancestorID, destinationID) {
115
115
  // Skip over the ancestor and the immediate separator. Traverse until we hit
116
116
  // another separator or we reach the end of `destinationID`.
117
117
  var start = ancestorID.length + SEPARATOR_LENGTH;
118
- for (var i = start; i < destinationID.length; i++) {
118
+ var i;
119
+ for (i = start; i < destinationID.length; i++) {
119
120
  if (isBoundary(destinationID, i)) {
120
121
  break;
121
122
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactInstanceMap
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  /**
15
15
  * `ReactInstanceMap` maintains a mapping from a public facing stateful
@@ -0,0 +1,35 @@
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 ReactLifeCycle
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ /**
15
+ * This module manages the bookkeeping when a component is in the process
16
+ * of being mounted or being unmounted. This is used as a way to enforce
17
+ * invariants (or warnings) when it is not recommended to call
18
+ * setState/forceUpdate.
19
+ *
20
+ * currentlyMountingInstance: During the construction phase, it is not possible
21
+ * to trigger an update since the instance is not fully mounted yet. However, we
22
+ * currently allow this as a convenience for mutating the initial state.
23
+ *
24
+ * currentlyUnmountingInstance: During the unmounting phase, the instance is
25
+ * still mounted and can therefore schedule an update. However, this is not
26
+ * recommended and probably an error since it's about to be unmounted.
27
+ * Therefore we still want to trigger in an error for that case.
28
+ */
29
+
30
+ var ReactLifeCycle = {
31
+ currentlyMountingInstance: null,
32
+ currentlyUnmountingInstance: null
33
+ };
34
+
35
+ module.exports = ReactLifeCycle;
package/lib/ReactLink.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  /**
16
16
  * ReactLink encapsulates a common pattern in which a component wants to modify
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, 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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactMarkupChecksum
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var adler32 = require("./adler32");
15
15