react 15.1.0 → 15.2.1

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 (124) hide show
  1. package/dist/react-with-addons.js +2685 -1842
  2. package/dist/react-with-addons.min.js +6 -6
  3. package/dist/react.js +2400 -1691
  4. package/dist/react.min.js +6 -6
  5. package/lib/CSSPropertyOperations.js +1 -1
  6. package/lib/CallbackQueue.js +3 -2
  7. package/lib/DOMChildrenOperations.js +9 -9
  8. package/lib/DOMLazyTree.js +3 -2
  9. package/lib/DOMProperty.js +5 -12
  10. package/lib/DOMPropertyOperations.js +21 -15
  11. package/lib/Danger.js +5 -101
  12. package/lib/DisabledInputUtils.js +5 -5
  13. package/lib/EventPluginHub.js +8 -2
  14. package/lib/EventPluginRegistry.js +13 -7
  15. package/lib/EventPluginUtils.js +3 -1
  16. package/lib/HTMLDOMPropertyConfig.js +1 -2
  17. package/lib/KeyEscapeUtils.js +2 -1
  18. package/lib/LinkedValueUtils.js +5 -3
  19. package/lib/NativeMethodsMixin.js +6 -4
  20. package/lib/PooledClass.js +4 -2
  21. package/lib/React.js +1 -1
  22. package/lib/ReactCSSTransitionGroupChild.js +15 -8
  23. package/lib/ReactChildReconciler.js +17 -8
  24. package/lib/ReactClass.js +14 -13
  25. package/lib/ReactComponent.js +3 -6
  26. package/lib/ReactComponentEnvironment.js +3 -1
  27. package/lib/ReactComponentTreeDevtool.js +89 -16
  28. package/lib/ReactComponentTreeTestUtils.js +87 -0
  29. package/lib/ReactCompositeComponent.js +87 -117
  30. package/lib/ReactDOM.js +2 -2
  31. package/lib/ReactDOMButton.js +2 -2
  32. package/lib/ReactDOMComponent.js +130 -76
  33. package/lib/ReactDOMComponentTree.js +23 -21
  34. package/lib/ReactDOMDebugTool.js +17 -11
  35. package/lib/ReactDOMEmptyComponent.js +9 -9
  36. package/lib/ReactDOMFactories.js +1 -1
  37. package/lib/ReactDOMFiber.js +78 -0
  38. package/lib/ReactDOMInput.js +64 -26
  39. package/lib/ReactDOMInstrumentation.js +7 -2
  40. package/lib/ReactDOMNullInputValuePropDevtool.js +43 -0
  41. package/lib/ReactDOMOption.js +40 -26
  42. package/lib/ReactDOMSelect.js +3 -16
  43. package/lib/ReactDOMTextComponent.js +21 -20
  44. package/lib/ReactDOMTextarea.js +59 -46
  45. package/lib/ReactDOMTreeTraversal.js +18 -16
  46. package/lib/ReactDOMUnknownPropertyDevtool.js +65 -17
  47. package/lib/ReactDebugTool.js +148 -95
  48. package/lib/ReactDefaultInjection.js +2 -2
  49. package/lib/ReactElement.js +64 -25
  50. package/lib/ReactElementValidator.js +26 -81
  51. package/lib/ReactEventListener.js +2 -2
  52. package/lib/ReactFeatureFlags.js +1 -0
  53. package/lib/ReactFragment.js +3 -1
  54. package/lib/{ReactNativeComponent.js → ReactHostComponent.js} +10 -29
  55. package/lib/{ReactNativeOperationHistoryDevtool.js → ReactHostOperationHistoryDevtool.js} +5 -5
  56. package/lib/ReactInjection.js +2 -2
  57. package/lib/ReactInstanceHandles.js +8 -6
  58. package/lib/ReactInstrumentation.js +7 -2
  59. package/lib/ReactMount.js +38 -32
  60. package/lib/ReactMultiChild.js +38 -11
  61. package/lib/ReactNativeAttributePayload.js +5 -2
  62. package/lib/ReactNativeBaseComponent.js +7 -7
  63. package/lib/ReactNativeBridgeEventPlugin.js +1 -1
  64. package/lib/ReactNativeComponentTree.js +8 -6
  65. package/lib/ReactNativeDOMIDOperations.js +1 -2
  66. package/lib/ReactNativeDefaultInjection.js +9 -7
  67. package/lib/ReactNativeGlobalResponderHandler.js +1 -1
  68. package/lib/ReactNativeMount.js +3 -14
  69. package/lib/ReactNativeReconcileTransaction.js +16 -0
  70. package/lib/ReactNativeTagHandles.js +3 -1
  71. package/lib/ReactNativeTextComponent.js +10 -9
  72. package/lib/ReactNativeTreeTraversal.js +11 -11
  73. package/lib/ReactNodeTypes.js +6 -3
  74. package/lib/ReactNoop.js +173 -0
  75. package/lib/ReactNoopUpdateQueue.js +6 -5
  76. package/lib/ReactOwner.js +4 -2
  77. package/lib/ReactPerf.js +83 -7
  78. package/lib/ReactPropTypes.js +23 -0
  79. package/lib/ReactReconcileTransaction.js +17 -1
  80. package/lib/ReactReconciler.js +12 -7
  81. package/lib/ReactServerRendering.js +5 -7
  82. package/lib/ReactServerRenderingTransaction.js +17 -0
  83. package/lib/ReactServerUpdateQueue.js +141 -0
  84. package/lib/ReactSimpleEmptyComponent.js +4 -4
  85. package/lib/ReactTestMount.js +115 -0
  86. package/lib/ReactTestReconcileTransaction.js +108 -0
  87. package/lib/ReactTestRenderer.js +133 -0
  88. package/lib/ReactTestUtils.js +17 -10
  89. package/lib/ReactTransitionChildMapping.js +7 -1
  90. package/lib/ReactTransitionGroup.js +41 -6
  91. package/lib/ReactUpdateQueue.js +13 -3
  92. package/lib/ReactUpdates.js +10 -18
  93. package/lib/ReactVersion.js +1 -1
  94. package/lib/ResponderEventPlugin.js +9 -7
  95. package/lib/ResponderTouchHistoryStore.js +99 -95
  96. package/lib/SimpleEventPlugin.js +3 -1
  97. package/lib/SyntheticEvent.js +2 -3
  98. package/lib/SyntheticUIEvent.js +1 -1
  99. package/lib/Transaction.js +4 -2
  100. package/lib/accumulate.js +17 -15
  101. package/lib/accumulateInto.js +11 -12
  102. package/lib/adler32.js +1 -0
  103. package/lib/checkReactTypeSpec.js +73 -0
  104. package/lib/createReactNativeComponentClass.js +2 -2
  105. package/lib/dangerousStyleValue.js +3 -1
  106. package/lib/deprecated.js +7 -1
  107. package/lib/escapeTextContentForBrowser.js +96 -12
  108. package/lib/findDOMNode.js +6 -4
  109. package/lib/findNodeHandle.js +5 -3
  110. package/lib/flattenChildren.js +22 -10
  111. package/lib/forEachAccumulated.js +3 -2
  112. package/lib/{getNativeComponentFromComposite.js → getHostComponentFromComposite.js} +4 -4
  113. package/lib/getIteratorFn.js +1 -0
  114. package/lib/instantiateReactComponent.js +21 -19
  115. package/lib/isTextInputElement.js +11 -1
  116. package/lib/onlyChild.js +3 -1
  117. package/lib/reactComponentExpect.js +3 -3
  118. package/lib/reactProdInvariant.js +39 -0
  119. package/lib/setInnerHTML.js +17 -1
  120. package/lib/setTextContent.js +8 -0
  121. package/lib/traverseAllChildren.js +3 -1
  122. package/lib/update.js +12 -11
  123. package/package.json +2 -2
  124. package/lib/MetaMatchers.js +0 -118
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": "15.1.0",
4
+ "version": "15.2.1",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -23,7 +23,7 @@
23
23
  "node": ">=0.10.0"
24
24
  },
25
25
  "dependencies": {
26
- "fbjs": "^0.8.0",
26
+ "fbjs": "^0.8.1",
27
27
  "loose-envify": "^1.1.0",
28
28
  "object-assign": "^4.1.0"
29
29
  },
@@ -1,118 +0,0 @@
1
- /**
2
- * Copyright 2015-present, 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 authoritative 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;