Fix references to the old ReactID syntax
Andreas Svensson committed
Jan 26, 2014 at 21:23 UTC
989eb2e7d9d0f58030e1514959113649c6e1a38b
7 files changed
+23
-23
src/core/ReactInstanceHandles.js
+2
-2
@@ -303,8 +303,8 @@ var ReactInstanceHandles = {
303
304
/**
305
* Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
306
- * example, passing `.r[0].{row-0}.[1]` would result in `cb` getting called
307
- * with `.r[0]`, `.r[0].{row-0}`, and `.r[0].{row-0}.[1]`.
306
+ * example, passing `.0.$row-0.1` would result in `cb` getting called
307
+ * with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
308
*
309
* NOTE: This traversal happens on IDs without touching the DOM.
310
*
src/core/ReactMount.js
+1
-1
@@ -200,7 +200,7 @@ function findDeepestCachedAncestor(targetID) {
200
* );
201
*
202
* <div id="container"> <-- Supplied `container`.
203
- * <div data-reactid=".r[3]"> <-- Rendered reactRoot of React
203
+ * <div data-reactid=".3"> <-- Rendered reactRoot of React
204
* // ... component.
205
* </div>
206
* </div>
src/core/__tests__/ReactEventEmitter-test.js
+3
-3
@@ -78,9 +78,9 @@ var ON_CHANGE_KEY = keyOf({onChange: null});
78
var CHILD = document.createElement('div');
79
var PARENT = document.createElement('div');
80
var GRANDPARENT = document.createElement('div');
81
-setID(CHILD, '.reactRoot.[0].[0].[0]');
82
-setID(PARENT, '.reactRoot.[0].[0]');
83
-setID(GRANDPARENT, '.reactRoot.[0]');
81
+setID(CHILD, '.0.0.0.0');
82
+setID(PARENT, '.0.0.0');
83
+setID(GRANDPARENT, '.0.0');
84
85
function registerSimpleTestHandler() {
86
ReactEventEmitter.putListener(getID(CHILD), ON_CLICK_KEY, LISTENER);
src/core/__tests__/ReactInstanceHandles-test.js
+9
-9
@@ -91,9 +91,9 @@ describe('ReactInstanceHandles', function() {
91
parentNode.appendChild(childNodeA);
92
parentNode.appendChild(childNodeB);
93
94
- ReactMount.setID(parentNode, '.react[0]');
95
- ReactMount.setID(childNodeA, '.react[0].0');
96
- ReactMount.setID(childNodeB, '.react[0].0:1');
94
+ ReactMount.setID(parentNode, '.0');
95
+ ReactMount.setID(childNodeA, '.0.0');
96
+ ReactMount.setID(childNodeB, '.0.0:1');
97
98
expect(
99
ReactMount.findComponentRoot(
@@ -110,9 +110,9 @@ describe('ReactInstanceHandles', function() {
110
parentNode.appendChild(childNodeA);
111
parentNode.appendChild(childNodeB);
112
113
- ReactMount.setID(parentNode, '.react[0]');
113
+ ReactMount.setID(parentNode, '.0');
114
// No ID on `childNodeA`.
115
- ReactMount.setID(childNodeB, '.react[0].0:1');
115
+ ReactMount.setID(childNodeB, '.0.0:1');
116
117
expect(
118
ReactMount.findComponentRoot(
@@ -129,9 +129,9 @@ describe('ReactInstanceHandles', function() {
129
parentNode.appendChild(childNodeA);
130
childNodeA.appendChild(childNodeB);
131
132
- ReactMount.setID(parentNode, '.react[0]');
132
+ ReactMount.setID(parentNode, '.0');
133
// No ID on `childNodeA`, it was "rendered by the browser".
134
- ReactMount.setID(childNodeB, '.react[0].1:0');
134
+ ReactMount.setID(childNodeB, '.0.1:0');
135
136
expect(ReactMount.findComponentRoot(
137
parentNode,
@@ -144,10 +144,10 @@ describe('ReactInstanceHandles', function() {
144
ReactMount.getID(childNodeB) + ":junk"
145
);
146
}).toThrow(
147
- 'Invariant Violation: findComponentRoot(..., .react[0].1:0:junk): ' +
147
+ 'Invariant Violation: findComponentRoot(..., .0.1:0:junk): ' +
148
'Unable to find element. This probably means the DOM was ' +
149
'unexpectedly mutated (e.g., by the browser). Try inspecting the ' +
150
- 'child nodes of the element with React ID `.react[0]`.'
150
+ 'child nodes of the element with React ID `.0`.'
151
);
152
});
153
});
src/core/__tests__/ReactMultiChildReconcile-test.js
+1
-1
@@ -42,7 +42,7 @@ var stripEmptyValues = function(obj) {
42
};
43
44
/**
45
- * Child key names are wrapped like '{key}[0]'. We strip the extra chars out
45
+ * Child key names are wrapped like '.$key:0'. We strip the extra chars out
46
* here. This relies on an implementation detail of the rendering system.
47
*/
48
var getOriginalKey = function(childName) {
src/eventPlugins/__tests__/ResponderEventPlugin-test.js
+3
-3
@@ -25,9 +25,9 @@ var ReactInstanceHandles;
25
var ResponderEventPlugin;
26
var SyntheticEvent;
27
28
-var GRANDPARENT_ID = '.r[0]';
29
-var PARENT_ID = '.r[0].0';
30
-var CHILD_ID = '.r[0].0.0';
28
+var GRANDPARENT_ID = '.0';
29
+var PARENT_ID = '.0.0';
30
+var CHILD_ID = '.0.0.0';
31
32
var topLevelTypes;
33
var responderEventTypes;
src/test/ReactDefaultPerf.js
+4
-4
@@ -59,7 +59,7 @@ if (__DEV__) {
59
* Runs through the logs and builds an array of arrays, where each array
60
* walks through the mounting/updating of each component underneath.
61
*
62
- * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]'
62
+ * @param {string} rootID The reactID of the root node, e.g. '.0'
63
* @return {array<array>}
64
*/
65
getRawRenderHistory: function(rootID) {
@@ -94,7 +94,7 @@ if (__DEV__) {
94
* is a multiline formatted way of walking through the mounting/updating
95
* underneath.
96
*
97
- * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]'
97
+ * @param {string} rootID The reactID of the root node, e.g. '.0'
98
* @return {array<string>}
99
*/
100
getRenderHistory: function(rootID) {
@@ -107,7 +107,7 @@ if (__DEV__) {
107
);
108
return headerString + subHistory.map(function(log) {
109
// Add two spaces for every layer in the reactID.
110
- var indents = '\t' + Array(log.reactID.split('.[').length).join(' ');
110
+ var indents = '\t' + Array(log.reactID.split('.').length).join(' ');
111
var delta = _microTime(log.timing.delta);
112
var bloat = _microTime(log.timing.timeToLog);
113
@@ -122,7 +122,7 @@ if (__DEV__) {
122
* This is currently the best way to display perf data from
123
* any React component; working on that.
124
*
125
- * @param {string} rootID The reactID of the root node, e.g. '.r[2cpyq]'
125
+ * @param {string} rootID The reactID of the root node, e.g. '.0'
126
* @param {number} index
127
*/
128
printRenderHistory: function(rootID, index) {