@samitouri / QOS-React / commits / ba9b985406

Rename host-y things to be "host" not "native" (#6754)

For clarity. I left "native event" as-is because there's a lot of it, it's not particularly ambiguous, and SimulateNative/nativeTouchData are public API in ReactTestUtils.

Ben Alpert committed May 11, 2016 at 23:22 UTC ba9b985406ff56c2dea192b119328b6096895097
48 files changed +358 -358
src/isomorphic/ReactDebugTool.js
+6 -6
@@ -50,7 +50,7 @@ var currentTimerType = null;
50
51 function clearHistory() {
52 ReactComponentTreeDevtool.purgeUnmountedComponents();
53 - ReactNativeOperationHistoryDevtool.clearHistory();
53 + ReactHostOperationHistoryDevtool.clearHistory();
54 }
55
56 function getTreeSnapshot(registeredIDs) {
@@ -74,7 +74,7 @@ function resetMeasurements() {
74 if (__DEV__) {
75 var previousStartTime = currentFlushStartTime;
76 var previousMeasurements = currentFlushMeasurements || [];
77 - var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
77 + var previousOperations = ReactHostOperationHistoryDevtool.getHistory();
78
79 if (!isProfiling || currentFlushNesting === 0) {
80 currentFlushStartTime = null;
@@ -214,9 +214,9 @@ var ReactDebugTool = {
214 onEndProcessingChildContext() {
215 emitEvent('onEndProcessingChildContext');
216 },
217 - onNativeOperation(debugID, type, payload) {
217 + onHostOperation(debugID, type, payload) {
218 checkDebugID(debugID);
219 - emitEvent('onNativeOperation', debugID, type, payload);
219 + emitEvent('onHostOperation', debugID, type, payload);
220 },
221 onSetState() {
222 emitEvent('onSetState');
@@ -260,11 +260,11 @@ var ReactDebugTool = {
260
261 if (__DEV__) {
262 var ReactInvalidSetStateWarningDevTool = require('ReactInvalidSetStateWarningDevTool');
263 - var ReactNativeOperationHistoryDevtool = require('ReactNativeOperationHistoryDevtool');
263 + var ReactHostOperationHistoryDevtool = require('ReactHostOperationHistoryDevtool');
264 var ReactComponentTreeDevtool = require('ReactComponentTreeDevtool');
265 ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
266 ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
267 - ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
267 + ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool);
268 var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
269 if ((/[?&]react_perf\b/).test(url)) {
270 ReactDebugTool.beginProfiling();
src/isomorphic/ReactPerf.js
+1 -1
@@ -167,7 +167,7 @@ function getWasted(flushHistory = getFlushHistory()) {
167 var {measurements, treeSnapshot, operations} = flush;
168 var isDefinitelyNotWastedByID = {};
169
170 - // Find native components associated with an operation in this batch.
170 + // Find host components associated with an operation in this batch.
171 // Mark all components in their parent tree as definitely not wasted.
172 operations.forEach(operation => {
173 var {instanceID} = operation;
src/isomorphic/classic/class/ReactClass.js
+1 -1
@@ -55,7 +55,7 @@ var injectedMixins = [];
55
56 /**
57 * Composite components are higher-level components that compose other composite
58 - * or native components.
58 + * or host components.
59 *
60 * To create a new type of `ReactClass`, pass a specification of
61 * your new class to `React.createClass`. The only requirement of your class
src/isomorphic/devtools/ReactHostOperationHistoryDevtool.js renamed
+5 -5
@@ -6,15 +6,15 @@
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 ReactNativeOperationHistoryDevtool
9 + * @providesModule ReactHostOperationHistoryDevtool
10 */
11
12 'use strict';
13
14 var history = [];
15
16 -var ReactNativeOperationHistoryDevtool = {
17 - onNativeOperation(debugID, type, payload) {
16 +var ReactHostOperationHistoryDevtool = {
17 + onHostOperation(debugID, type, payload) {
18 history.push({
19 instanceID: debugID,
20 type,
@@ -23,7 +23,7 @@ var ReactNativeOperationHistoryDevtool = {
23 },
24
25 clearHistory() {
26 - if (ReactNativeOperationHistoryDevtool._preventClearing) {
26 + if (ReactHostOperationHistoryDevtool._preventClearing) {
27 // Should only be used for tests.
28 return;
29 }
@@ -36,4 +36,4 @@ var ReactNativeOperationHistoryDevtool = {
36 },
37 };
38
39 -module.exports = ReactNativeOperationHistoryDevtool;
39 +module.exports = ReactHostOperationHistoryDevtool;
src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.js
+14 -14
@@ -289,7 +289,7 @@ describe('ReactComponentTreeDevtool', () => {
289 assertTreeMatches([element, tree]);
290 });
291
292 - it('reports a native tree correctly', () => {
292 + it('reports a host tree correctly', () => {
293 var element = (
294 <div>
295 <p>
@@ -532,7 +532,7 @@ describe('ReactComponentTreeDevtool', () => {
532 });
533
534 describe('update', () => {
535 - describe('native component', () => {
535 + describe('host component', () => {
536 it('updates text of a single text child', () => {
537 var elementBefore = <div>Hi.</div>;
538 var treeBefore = {
@@ -869,7 +869,7 @@ describe('ReactComponentTreeDevtool', () => {
869 ]);
870 });
871
872 - it('updates native nodes when reordering with keys', () => {
872 + it('updates host nodes when reordering with keys', () => {
873 var elementBefore = (
874 <div>
875 <div key="a">Hi.</div>
@@ -922,7 +922,7 @@ describe('ReactComponentTreeDevtool', () => {
922 ]);
923 });
924
925 - it('updates native nodes when reordering without keys', () => {
925 + it('updates host nodes when reordering without keys', () => {
926 var elementBefore = (
927 <div>
928 <div>Hi.</div>
@@ -1172,7 +1172,7 @@ describe('ReactComponentTreeDevtool', () => {
1172 });
1173
1174 describe('functional component', () => {
1175 - it('updates with a native child', () => {
1175 + it('updates with a host child', () => {
1176 function Foo({ children }) {
1177 return children;
1178 }
@@ -1201,7 +1201,7 @@ describe('ReactComponentTreeDevtool', () => {
1201 ]);
1202 });
1203
1204 - it('updates from null to a native child', () => {
1204 + it('updates from null to a host child', () => {
1205 function Foo({ children }) {
1206 return children;
1207 }
@@ -1227,7 +1227,7 @@ describe('ReactComponentTreeDevtool', () => {
1227 ]);
1228 });
1229
1230 - it('updates from a native child to null', () => {
1230 + it('updates from a host child to null', () => {
1231 function Foo({ children }) {
1232 return children;
1233 }
@@ -1253,7 +1253,7 @@ describe('ReactComponentTreeDevtool', () => {
1253 ]);
1254 });
1255
1256 - it('updates from a native child to a composite child', () => {
1256 + it('updates from a host child to a composite child', () => {
1257 function Bar() {
1258 return null;
1259 }
@@ -1286,7 +1286,7 @@ describe('ReactComponentTreeDevtool', () => {
1286 ]);
1287 });
1288
1289 - it('updates from a composite child to a native child', () => {
1289 + it('updates from a composite child to a host child', () => {
1290 function Bar() {
1291 return null;
1292 }
@@ -1381,7 +1381,7 @@ describe('ReactComponentTreeDevtool', () => {
1381 });
1382
1383 describe('class component', () => {
1384 - it('updates with a native child', () => {
1384 + it('updates with a host child', () => {
1385 var Foo = React.createClass({
1386 render() {
1387 return this.props.children;
@@ -1412,7 +1412,7 @@ describe('ReactComponentTreeDevtool', () => {
1412 ]);
1413 });
1414
1415 - it('updates from null to a native child', () => {
1415 + it('updates from null to a host child', () => {
1416 var Foo = React.createClass({
1417 render() {
1418 return this.props.children;
@@ -1440,7 +1440,7 @@ describe('ReactComponentTreeDevtool', () => {
1440 ]);
1441 });
1442
1443 - it('updates from a native child to null', () => {
1443 + it('updates from a host child to null', () => {
1444 var Foo = React.createClass({
1445 render() {
1446 return this.props.children;
@@ -1468,7 +1468,7 @@ describe('ReactComponentTreeDevtool', () => {
1468 ]);
1469 });
1470
1471 - it('updates from a native child to a composite child', () => {
1471 + it('updates from a host child to a composite child', () => {
1472 var Bar = React.createClass({
1473 render() {
1474 return null;
@@ -1505,7 +1505,7 @@ describe('ReactComponentTreeDevtool', () => {
1505 ]);
1506 });
1507
1508 - it('updates from a composite child to a native child', () => {
1508 + it('updates from a composite child to a host child', () => {
1509 var Bar = React.createClass({
1510 render() {
1511 return null;
src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.native.js
+14 -14
@@ -300,7 +300,7 @@ describe('ReactComponentTreeDevtool', () => {
300 assertTreeMatches([element, tree]);
301 });
302
303 - it('reports a native tree correctly', () => {
303 + it('reports a host tree correctly', () => {
304 var element = (
305 <View>
306 <View>
@@ -540,7 +540,7 @@ describe('ReactComponentTreeDevtool', () => {
540 });
541
542 describe('update', () => {
543 - describe('native component', () => {
543 + describe('host component', () => {
544 it('updates text of a single text child', () => {
545 var elementBefore = <Text>Hi.</Text>;
546 var treeBefore = {
@@ -792,7 +792,7 @@ describe('ReactComponentTreeDevtool', () => {
792 ]);
793 });
794
795 - it('updates native nodes when reordering with keys', () => {
795 + it('updates host nodes when reordering with keys', () => {
796 var elementBefore = (
797 <View>
798 <Text key="a">Hi.</Text>
@@ -857,7 +857,7 @@ describe('ReactComponentTreeDevtool', () => {
857 ]);
858 });
859
860 - it('updates native nodes when reordering with keys', () => {
860 + it('updates host nodes when reordering with keys', () => {
861 var elementBefore = (
862 <View>
863 <Text>Hi.</Text>
@@ -1137,7 +1137,7 @@ describe('ReactComponentTreeDevtool', () => {
1137 });
1138
1139 describe('functional component', () => {
1140 - it('updates with a native child', () => {
1140 + it('updates with a host child', () => {
1141 function Foo({ children }) {
1142 return children;
1143 }
@@ -1166,7 +1166,7 @@ describe('ReactComponentTreeDevtool', () => {
1166 ]);
1167 });
1168
1169 - it('updates from null to a native child', () => {
1169 + it('updates from null to a host child', () => {
1170 function Foo({ children }) {
1171 return children;
1172 }
@@ -1192,7 +1192,7 @@ describe('ReactComponentTreeDevtool', () => {
1192 ]);
1193 });
1194
1195 - it('updates from a native child to null', () => {
1195 + it('updates from a host child to null', () => {
1196 function Foo({ children }) {
1197 return children;
1198 }
@@ -1218,7 +1218,7 @@ describe('ReactComponentTreeDevtool', () => {
1218 ]);
1219 });
1220
1221 - it('updates from a native child to a composite child', () => {
1221 + it('updates from a host child to a composite child', () => {
1222 function Bar() {
1223 return null;
1224 }
@@ -1251,7 +1251,7 @@ describe('ReactComponentTreeDevtool', () => {
1251 ]);
1252 });
1253
1254 - it('updates from a composite child to a native child', () => {
1254 + it('updates from a composite child to a host child', () => {
1255 function Bar() {
1256 return null;
1257 }
@@ -1346,7 +1346,7 @@ describe('ReactComponentTreeDevtool', () => {
1346 });
1347
1348 describe('class component', () => {
1349 - it('updates with a native child', () => {
1349 + it('updates with a host child', () => {
1350 var Foo = React.createClass({
1351 render() {
1352 return this.props.children;
@@ -1377,7 +1377,7 @@ describe('ReactComponentTreeDevtool', () => {
1377 ]);
1378 });
1379
1380 - it('updates from null to a native child', () => {
1380 + it('updates from null to a host child', () => {
1381 var Foo = React.createClass({
1382 render() {
1383 return this.props.children;
@@ -1405,7 +1405,7 @@ describe('ReactComponentTreeDevtool', () => {
1405 ]);
1406 });
1407
1408 - it('updates from a native child to null', () => {
1408 + it('updates from a host child to null', () => {
1409 var Foo = React.createClass({
1410 render() {
1411 return this.props.children;
@@ -1433,7 +1433,7 @@ describe('ReactComponentTreeDevtool', () => {
1433 ]);
1434 });
1435
1436 - it('updates from a native child to a composite child', () => {
1436 + it('updates from a host child to a composite child', () => {
1437 var Bar = React.createClass({
1438 render() {
1439 return null;
@@ -1470,7 +1470,7 @@ describe('ReactComponentTreeDevtool', () => {
1470 ]);
1471 });
1472
1473 - it('updates from a composite child to a native child', () => {
1473 + it('updates from a composite child to a host child', () => {
1474 var Bar = React.createClass({
1475 render() {
1476 return null;
src/isomorphic/devtools/__tests__/ReactHostOperationHistoryDevtool-test.js renamed
+35 -35
@@ -11,12 +11,12 @@
11
12 'use strict';
13
14 -describe('ReactNativeOperationHistoryDevtool', () => {
14 +describe('ReactHostOperationHistoryDevtool', () => {
15 var React;
16 var ReactDOM;
17 var ReactDOMComponentTree;
18 var ReactDOMFeatureFlags;
19 - var ReactNativeOperationHistoryDevtool;
19 + var ReactHostOperationHistoryDevtool;
20
21 beforeEach(() => {
22 jest.resetModuleRegistry();
@@ -25,18 +25,18 @@ describe('ReactNativeOperationHistoryDevtool', () => {
25 ReactDOM = require('ReactDOM');
26 ReactDOMComponentTree = require('ReactDOMComponentTree');
27 ReactDOMFeatureFlags = require('ReactDOMFeatureFlags');
28 - ReactNativeOperationHistoryDevtool = require('ReactNativeOperationHistoryDevtool');
28 + ReactHostOperationHistoryDevtool = require('ReactHostOperationHistoryDevtool');
29 });
30
31 function assertHistoryMatches(expectedHistory) {
32 - var actualHistory = ReactNativeOperationHistoryDevtool.getHistory();
32 + var actualHistory = ReactHostOperationHistoryDevtool.getHistory();
33 expect(actualHistory).toEqual(expectedHistory);
34 }
35
36 describe('mount', () => {
37 - it('gets recorded for native roots', () => {
37 + it('gets recorded for host roots', () => {
38 var node = document.createElement('div');
39 - ReactNativeOperationHistoryDevtool._preventClearing = true;
39 + ReactHostOperationHistoryDevtool._preventClearing = true;
40 ReactDOM.render(<div><p>Hi.</p></div>, node);
41
42 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
@@ -55,7 +55,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
55 }
56 var node = document.createElement('div');
57
58 - ReactNativeOperationHistoryDevtool._preventClearing = true;
58 + ReactHostOperationHistoryDevtool._preventClearing = true;
59 ReactDOM.render(<Foo />, node);
60
61 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
@@ -75,7 +75,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
75 }
76 var node = document.createElement('div');
77
78 - ReactNativeOperationHistoryDevtool._preventClearing = true;
78 + ReactHostOperationHistoryDevtool._preventClearing = true;
79 ReactDOM.render(<Foo />, node);
80
81 // Empty DOM components should be invisible to devtools.
@@ -88,7 +88,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
88 return element;
89 }
90
91 - ReactNativeOperationHistoryDevtool._preventClearing = true;
91 + ReactHostOperationHistoryDevtool._preventClearing = true;
92
93 var node = document.createElement('div');
94 element = null;
@@ -112,7 +112,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
112 it('gets recorded during mount', () => {
113 var node = document.createElement('div');
114
115 - ReactNativeOperationHistoryDevtool._preventClearing = true;
115 + ReactHostOperationHistoryDevtool._preventClearing = true;
116 ReactDOM.render(<div style={{
117 color: 'red',
118 backgroundColor: 'yellow',
@@ -147,7 +147,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
147 ReactDOM.render(<div />, node);
148 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
149
150 - ReactNativeOperationHistoryDevtool._preventClearing = true;
150 + ReactHostOperationHistoryDevtool._preventClearing = true;
151 ReactDOM.render(<div style={{ color: 'red' }} />, node);
152 ReactDOM.render(<div style={{
153 color: 'blue',
@@ -180,7 +180,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
180 ReactDOM.render(<div />, node);
181 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
182
183 - ReactNativeOperationHistoryDevtool._preventClearing = true;
183 + ReactHostOperationHistoryDevtool._preventClearing = true;
184 ReactDOM.render(<div style={{
185 color: 'red',
186 backgroundColor: 'yellow',
@@ -206,7 +206,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
206 it('gets recorded during mount', () => {
207 var node = document.createElement('div');
208
209 - ReactNativeOperationHistoryDevtool._preventClearing = true;
209 + ReactHostOperationHistoryDevtool._preventClearing = true;
210 ReactDOM.render(<div className="rad" tabIndex={42} />, node);
211
212 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
@@ -239,7 +239,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
239 ReactDOM.render(<div />, node);
240 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
241
242 - ReactNativeOperationHistoryDevtool._preventClearing = true;
242 + ReactHostOperationHistoryDevtool._preventClearing = true;
243 ReactDOM.render(<div className="rad" />, node);
244 ReactDOM.render(<div className="mad" tabIndex={42} />, node);
245 ReactDOM.render(<div tabIndex={43} />, node);
@@ -274,7 +274,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
274 ReactDOM.render(<div />, node);
275 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
276
277 - ReactNativeOperationHistoryDevtool._preventClearing = true;
277 + ReactHostOperationHistoryDevtool._preventClearing = true;
278 ReactDOM.render(<div disabled={true} />, node);
279 ReactDOM.render(<div disabled={false} />, node);
280
@@ -294,7 +294,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
294 it('gets recorded during mount', () => {
295 var node = document.createElement('div');
296
297 - ReactNativeOperationHistoryDevtool._preventClearing = true;
297 + ReactHostOperationHistoryDevtool._preventClearing = true;
298 ReactDOM.render(<div data-x="rad" data-y={42} />, node);
299
300 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
@@ -327,7 +327,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
327 ReactDOM.render(<div />, node);
328 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
329
330 - ReactNativeOperationHistoryDevtool._preventClearing = true;
330 + ReactHostOperationHistoryDevtool._preventClearing = true;
331 ReactDOM.render(<div data-x="rad" />, node);
332 ReactDOM.render(<div data-x="mad" data-y={42} />, node);
333 ReactDOM.render(<div data-y={43} />, node);
@@ -360,7 +360,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
360 it('gets recorded during mount', () => {
361 var node = document.createElement('div');
362
363 - ReactNativeOperationHistoryDevtool._preventClearing = true;
363 + ReactHostOperationHistoryDevtool._preventClearing = true;
364 ReactDOM.render(<my-component className="rad" tabIndex={42} />, node);
365
366 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
@@ -393,7 +393,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
393 ReactDOM.render(<my-component />, node);
394 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
395
396 - ReactNativeOperationHistoryDevtool._preventClearing = true;
396 + ReactHostOperationHistoryDevtool._preventClearing = true;
397 ReactDOM.render(<my-component className="rad" />, node);
398 ReactDOM.render(<my-component className="mad" tabIndex={42} />, node);
399 ReactDOM.render(<my-component tabIndex={43} />, node);
@@ -430,7 +430,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
430 ReactDOM.render(<div>Hi.</div>, node);
431 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
432
433 - ReactNativeOperationHistoryDevtool._preventClearing = true;
433 + ReactHostOperationHistoryDevtool._preventClearing = true;
434 ReactDOM.render(<div>Bye.</div>, node);
435
436 assertHistoryMatches([{
@@ -445,7 +445,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
445 ReactDOM.render(<div dangerouslySetInnerHTML={{__html: 'Hi.'}} />, node);
446 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
447
448 - ReactNativeOperationHistoryDevtool._preventClearing = true;
448 + ReactHostOperationHistoryDevtool._preventClearing = true;
449 ReactDOM.render(<div>Bye.</div>, node);
450
451 assertHistoryMatches([{
@@ -460,7 +460,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
460 ReactDOM.render(<div><span /><p /></div>, node);
461 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
462
463 - ReactNativeOperationHistoryDevtool._preventClearing = true;
463 + ReactHostOperationHistoryDevtool._preventClearing = true;
464 ReactDOM.render(<div>Bye.</div>, node);
465
466 assertHistoryMatches([{
@@ -482,7 +482,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
482 var node = document.createElement('div');
483 ReactDOM.render(<div>Hi.</div>, node);
484
485 - ReactNativeOperationHistoryDevtool._preventClearing = true;
485 + ReactHostOperationHistoryDevtool._preventClearing = true;
486 ReactDOM.render(<div>Hi.</div>, node);
487
488 assertHistoryMatches([]);
@@ -496,7 +496,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
496 var inst1 = ReactDOMComponentTree.getInstanceFromNode(node.firstChild.childNodes[0]);
497 var inst2 = ReactDOMComponentTree.getInstanceFromNode(node.firstChild.childNodes[3]);
498
499 - ReactNativeOperationHistoryDevtool._preventClearing = true;
499 + ReactHostOperationHistoryDevtool._preventClearing = true;
500 ReactDOM.render(<div>{'Bye.'}{43}</div>, node);
501
502 assertHistoryMatches([{
@@ -514,7 +514,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
514 var node = document.createElement('div');
515 ReactDOM.render(<div>{'Hi.'}{42}</div>, node);
516
517 - ReactNativeOperationHistoryDevtool._preventClearing = true;
517 + ReactHostOperationHistoryDevtool._preventClearing = true;
518 ReactDOM.render(<div>{'Hi.'}{42}</div>, node);
519
520 assertHistoryMatches([]);
@@ -536,7 +536,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
536
537 element = <span />;
538
539 - ReactNativeOperationHistoryDevtool._preventClearing = true;
539 + ReactHostOperationHistoryDevtool._preventClearing = true;
540 ReactDOM.render(<Foo />, node);
541
542 assertHistoryMatches([{
@@ -559,7 +559,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
559 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
560 element = null;
561
562 - ReactNativeOperationHistoryDevtool._preventClearing = true;
562 + ReactHostOperationHistoryDevtool._preventClearing = true;
563 ReactDOM.render(<Foo />, node);
564
565 assertHistoryMatches([{
@@ -581,7 +581,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
581
582 element = <div />;
583
584 - ReactNativeOperationHistoryDevtool._preventClearing = true;
584 + ReactHostOperationHistoryDevtool._preventClearing = true;
585 ReactDOM.render(<Foo />, node);
586
587 assertHistoryMatches([]);
@@ -594,7 +594,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
594 ReactDOM.render(<div>Hi.</div>, node);
595 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
596
597 - ReactNativeOperationHistoryDevtool._preventClearing = true;
597 + ReactHostOperationHistoryDevtool._preventClearing = true;
598 ReactDOM.render(
599 <div dangerouslySetInnerHTML={{__html: 'Bye.'}} />,
600 node
@@ -615,7 +615,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
615 );
616 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
617
618 - ReactNativeOperationHistoryDevtool._preventClearing = true;
618 + ReactHostOperationHistoryDevtool._preventClearing = true;
619 ReactDOM.render(
620 <div dangerouslySetInnerHTML={{__html: 'Bye.'}} />,
621 node
@@ -633,7 +633,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
633 ReactDOM.render(<div><span /><p /></div>, node);
634 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
635
636 - ReactNativeOperationHistoryDevtool._preventClearing = true;
636 + ReactHostOperationHistoryDevtool._preventClearing = true;
637 ReactDOM.render(
638 <div dangerouslySetInnerHTML={{__html: 'Hi.'}} />,
639 node
@@ -661,7 +661,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
661 node
662 );
663
664 - ReactNativeOperationHistoryDevtool._preventClearing = true;
664 + ReactHostOperationHistoryDevtool._preventClearing = true;
665 ReactDOM.render(
666 <div dangerouslySetInnerHTML={{__html: 'Hi.'}} />,
667 node
@@ -677,7 +677,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
677 ReactDOM.render(<div><span /></div>, node);
678 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
679
680 - ReactNativeOperationHistoryDevtool._preventClearing = true;
680 + ReactHostOperationHistoryDevtool._preventClearing = true;
681 ReactDOM.render(<div><span /><p /></div>, node);
682
683 assertHistoryMatches([{
@@ -694,7 +694,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
694 ReactDOM.render(<div><span key="a" /><p key="b" /></div>, node);
695 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
696
697 - ReactNativeOperationHistoryDevtool._preventClearing = true;
697 + ReactHostOperationHistoryDevtool._preventClearing = true;
698 ReactDOM.render(<div><p key="b" /><span key="a" /></div>, node);
699
700 assertHistoryMatches([{
@@ -711,7 +711,7 @@ describe('ReactNativeOperationHistoryDevtool', () => {
711 ReactDOM.render(<div><span key="a" /><p key="b" /></div>, node);
712 var inst = ReactDOMComponentTree.getInstanceFromNode(node.firstChild);
713
714 - ReactNativeOperationHistoryDevtool._preventClearing = true;
714 + ReactHostOperationHistoryDevtool._preventClearing = true;
715 ReactDOM.render(<div><span key="a" /></div>, node);
716
717 assertHistoryMatches([{
src/renderers/dom/ReactDOM.js
+2 -2
@@ -21,7 +21,7 @@ var ReactUpdates = require('ReactUpdates');
21 var ReactVersion = require('ReactVersion');
22
23 var findDOMNode = require('findDOMNode');
24 -var getNativeComponentFromComposite = require('getNativeComponentFromComposite');
24 +var getHostComponentFromComposite = require('getHostComponentFromComposite');
25 var renderSubtreeIntoContainer = require('renderSubtreeIntoContainer');
26 var warning = require('warning');
27
@@ -51,7 +51,7 @@ if (
51 getNodeFromInstance: function(inst) {
52 // inst is an internal instance (but could be a composite)
53 if (inst._renderedComponent) {
54 - inst = getNativeComponentFromComposite(inst);
54 + inst = getHostComponentFromComposite(inst);
55 }
56 if (inst) {
57 return ReactDOMComponentTree.getNodeFromInstance(inst);
src/renderers/dom/client/ReactDOMComponentTree.js
+20 -20
@@ -23,13 +23,13 @@ var internalInstanceKey =
23 '__reactInternalInstance$' + Math.random().toString(36).slice(2);
24
25 /**
26 - * Drill down (through composites and empty components) until we get a native or
27 - * native text component.
26 + * Drill down (through composites and empty components) until we get a host or
27 + * host text component.
28 *
29 * This is pretty polymorphic but unavoidable with the current structure we have
30 * for `_renderedChildren`.
31 */
32 -function getRenderedNativeOrTextFromComponent(component) {
32 +function getRenderedHostOrTextFromComponent(component) {
33 var rendered;
34 while ((rendered = component._renderedComponent)) {
35 component = rendered;
@@ -38,25 +38,25 @@ function getRenderedNativeOrTextFromComponent(component) {
38 }
39
40 /**
41 - * Populate `_nativeNode` on the rendered native/text component with the given
41 + * Populate `_hostNode` on the rendered host/text component with the given
42 * DOM node. The passed `inst` can be a composite.
43 */
44 function precacheNode(inst, node) {
45 - var nativeInst = getRenderedNativeOrTextFromComponent(inst);
46 - nativeInst._nativeNode = node;
47 - node[internalInstanceKey] = nativeInst;
45 + var hostInst = getRenderedHostOrTextFromComponent(inst);
46 + hostInst._hostNode = node;
47 + node[internalInstanceKey] = hostInst;
48 }
49
50 function uncacheNode(inst) {
51 - var node = inst._nativeNode;
51 + var node = inst._hostNode;
52 if (node) {
53 delete node[internalInstanceKey];
54 - inst._nativeNode = null;
54 + inst._hostNode = null;
55 }
56 }
57
58 /**
59 - * Populate `_nativeNode` on each child of `inst`, assuming that the children
59 + * Populate `_hostNode` on each child of `inst`, assuming that the children
60 * match up with the DOM (element) children of `node`.
61 *
62 * We cache entire levels at once to avoid an n^2 problem where we access the
@@ -80,7 +80,7 @@ function precacheChildNodes(inst, node) {
80 continue;
81 }
82 var childInst = children[name];
83 - var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;
83 + var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
84 if (childID == null) {
85 // We're currently unmounting this child in ReactMultiChild; skip it.
86 continue;
@@ -143,7 +143,7 @@ function getClosestInstanceFromNode(node) {
143 */
144 function getInstanceFromNode(node) {
145 var inst = getClosestInstanceFromNode(node);
146 - if (inst != null && inst._nativeNode === node) {
146 + if (inst != null && inst._hostNode === node) {
147 return inst;
148 } else {
149 return null;
@@ -158,32 +158,32 @@ function getNodeFromInstance(inst) {
158 // Without this first invariant, passing a non-DOM-component triggers the next
159 // invariant for a missing parent, which is super confusing.
160 invariant(
161 - inst._nativeNode !== undefined,
161 + inst._hostNode !== undefined,
162 'getNodeFromInstance: Invalid argument.'
163 );
164
165 - if (inst._nativeNode) {
166 - return inst._nativeNode;
165 + if (inst._hostNode) {
166 + return inst._hostNode;
167 }
168
169 // Walk up the tree until we find an ancestor whose DOM node we have cached.
170 var parents = [];
171 - while (!inst._nativeNode) {
171 + while (!inst._hostNode) {
172 parents.push(inst);
173 invariant(
174 - inst._nativeParent,
174 + inst._hostParent,
175 'React DOM tree root should always have a node reference.'
176 );
177 - inst = inst._nativeParent;
177 + inst = inst._hostParent;
178 }
179
180 // Now parents contains each ancestor that does *not* have a cached native
181 // node, and `inst` is the deepest ancestor that does.
182 for (; parents.length; inst = parents.pop()) {
183 - precacheChildNodes(inst, inst._nativeNode);
183 + precacheChildNodes(inst, inst._hostNode);
184 }
185
186 - return inst._nativeNode;
186 + return inst._hostNode;
187 }
188
189 var ReactDOMComponentTree = {
src/renderers/dom/client/ReactDOMTreeTraversal.js
+16 -16
@@ -18,27 +18,27 @@ var invariant = require('invariant');
18 * different trees.
19 */
20 function getLowestCommonAncestor(instA, instB) {
21 - invariant('_nativeNode' in instA, 'getNodeFromInstance: Invalid argument.');
22 - invariant('_nativeNode' in instB, 'getNodeFromInstance: Invalid argument.');
21 + invariant('_hostNode' in instA, 'getNodeFromInstance: Invalid argument.');
22 + invariant('_hostNode' in instB, 'getNodeFromInstance: Invalid argument.');
23
24 var depthA = 0;
25 - for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
25 + for (var tempA = instA; tempA; tempA = tempA._hostParent) {
26 depthA++;
27 }
28 var depthB = 0;
29 - for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
29 + for (var tempB = instB; tempB; tempB = tempB._hostParent) {
30 depthB++;
31 }
32
33 // If A is deeper, crawl up.
34 while (depthA - depthB > 0) {
35 - instA = instA._nativeParent;
35 + instA = instA._hostParent;
36 depthA--;
37 }
38
39 // If B is deeper, crawl up.
40 while (depthB - depthA > 0) {
41 - instB = instB._nativeParent;
41 + instB = instB._hostParent;
42 depthB--;
43 }
44
@@ -48,8 +48,8 @@ function getLowestCommonAncestor(instA, instB) {
48 if (instA === instB) {
49 return instA;
50 }
51 - instA = instA._nativeParent;
52 - instB = instB._nativeParent;
51 + instA = instA._hostParent;
52 + instB = instB._hostParent;
53 }
54 return null;
55 }
@@ -58,14 +58,14 @@ function getLowestCommonAncestor(instA, instB) {
58 * Return if A is an ancestor of B.
59 */
60 function isAncestor(instA, instB) {
61 - invariant('_nativeNode' in instA, 'isAncestor: Invalid argument.');
62 - invariant('_nativeNode' in instB, 'isAncestor: Invalid argument.');
61 + invariant('_hostNode' in instA, 'isAncestor: Invalid argument.');
62 + invariant('_hostNode' in instB, 'isAncestor: Invalid argument.');
63
64 while (instB) {
65 if (instB === instA) {
66 return true;
67 }
68 - instB = instB._nativeParent;
68 + instB = instB._hostParent;
69 }
70 return false;
71 }
@@ -74,9 +74,9 @@ function isAncestor(instA, instB) {
74 * Return the parent instance of the passed-in instance.
75 */
76 function getParentInstance(inst) {
77 - invariant('_nativeNode' in inst, 'getParentInstance: Invalid argument.');
77 + invariant('_hostNode' in inst, 'getParentInstance: Invalid argument.');
78
79 - return inst._nativeParent;
79 + return inst._hostParent;
80 }
81
82 /**
@@ -86,7 +86,7 @@ function traverseTwoPhase(inst, fn, arg) {
86 var path = [];
87 while (inst) {
88 path.push(inst);
89 - inst = inst._nativeParent;
89 + inst = inst._hostParent;
90 }
91 var i;
92 for (i = path.length; i-- > 0;) {
@@ -109,12 +109,12 @@ function traverseEnterLeave(from, to, fn, argFrom, argTo) {
109 var pathFrom = [];
110 while (from && from !== common) {
111 pathFrom.push(from);
112 - from = from._nativeParent;
112 + from = from._hostParent;
113 }
114 var pathTo = [];
115 while (to && to !== common) {
116 pathTo.push(to);
117 - to = to._nativeParent;
117 + to = to._hostParent;
118 }
119 var i;
120 for (i = 0; i < pathFrom.length; i++) {
src/renderers/dom/client/ReactEventListener.js
+2 -2
@@ -29,8 +29,8 @@ function findParent(inst) {
29 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
30 // traversal, but caching is difficult to do correctly without using a
31 // mutation observer to listen for all DOM changes.
32 - while (inst._nativeParent) {
33 - inst = inst._nativeParent;
32 + while (inst._hostParent) {
33 + inst = inst._hostParent;
34 }
35 var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
36 var container = rootNode.parentNode;
src/renderers/dom/client/ReactMount.js
+11 -11
@@ -195,23 +195,23 @@ function hasNonRootReactChild(container) {
195 var rootEl = getReactRootElementInContainer(container);
196 if (rootEl) {
197 var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
198 - return !!(inst && inst._nativeParent);
198 + return !!(inst && inst._hostParent);
199 }
200 }
201
202 -function getNativeRootInstanceInContainer(container) {
202 +function getHostRootInstanceInContainer(container) {
203 var rootEl = getReactRootElementInContainer(container);
204 - var prevNativeInstance =
204 + var prevHostInstance =
205 rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
206 return (
207 - prevNativeInstance && !prevNativeInstance._nativeParent ?
208 - prevNativeInstance : null
207 + prevHostInstance && !prevHostInstance._hostParent ?
208 + prevHostInstance : null
209 );
210 }
211
212 function getTopLevelWrapperInContainer(container) {
213 - var root = getNativeRootInstanceInContainer(container);
214 - return root ? root._nativeContainerInfo._topLevelWrapper : null;
213 + var root = getHostRootInstanceInContainer(container);
214 + return root ? root._hostContainerInfo._topLevelWrapper : null;
215 }
216
217 /**
@@ -701,10 +701,10 @@ var ReactMount = {
701 }
702
703 if (__DEV__) {
704 - var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
705 - if (nativeNode._debugID !== 0) {
706 - ReactInstrumentation.debugTool.onNativeOperation(
707 - nativeNode._debugID,
704 + var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
705 + if (hostNode._debugID !== 0) {
706 + ReactInstrumentation.debugTool.onHostOperation(
707 + hostNode._debugID,
708 'mount',
709 markup.toString()
710 );
src/renderers/dom/client/__tests__/inputValueTracking-test.js
+4 -4
@@ -22,7 +22,7 @@ describe('inputValueTracking', function() {
22 input.type = 'text';
23 checkbox = document.createElement('input');
24 checkbox.type = 'checkbox';
25 - mockComponent = { _nativeNode: input, _wrapperState: {} };
25 + mockComponent = { _hostNode: input, _wrapperState: {} };
26 });
27
28 it('should attach tracker to wrapper state', function() {
@@ -42,7 +42,7 @@ describe('inputValueTracking', function() {
42 });
43
44 it('should define `checked` on the instance node', function() {
45 - mockComponent._nativeNode = checkbox;
45 + mockComponent._hostNode = checkbox;
46 inputValueTracking.track(mockComponent);
47
48 expect(checkbox.hasOwnProperty('checked')).toBe(true);
@@ -59,7 +59,7 @@ describe('inputValueTracking', function() {
59 });
60
61 it('should initialize with the current `checked`', function() {
62 - mockComponent._nativeNode = checkbox;
62 + mockComponent._hostNode = checkbox;
63 checkbox.checked = true;
64 inputValueTracking.track(mockComponent);
65
@@ -80,7 +80,7 @@ describe('inputValueTracking', function() {
80 });
81
82 it('should tracked`checked` changes', function() {
83 - mockComponent._nativeNode = checkbox;
83 + mockComponent._hostNode = checkbox;
84 checkbox.checked = true;
85 inputValueTracking.track(mockComponent);
86
src/renderers/dom/client/findDOMNode.js
+2 -2
@@ -15,7 +15,7 @@ var ReactCurrentOwner = require('ReactCurrentOwner');
15 var ReactDOMComponentTree = require('ReactDOMComponentTree');
16 var ReactInstanceMap = require('ReactInstanceMap');
17
18 -var getNativeComponentFromComposite = require('getNativeComponentFromComposite');
18 +var getHostComponentFromComposite = require('getHostComponentFromComposite');
19 var invariant = require('invariant');
20 var warning = require('warning');
21
@@ -52,7 +52,7 @@ function findDOMNode(componentOrElement) {
52
53 var inst = ReactInstanceMap.get(componentOrElement);
54 if (inst) {
55 - inst = getNativeComponentFromComposite(inst);
55 + inst = getHostComponentFromComposite(inst);
56 return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
57 }
58
src/renderers/dom/client/utils/DOMChildrenOperations.js
+9 -9
@@ -23,7 +23,7 @@ var setTextContent = require('setTextContent');
23
24 function getNodeAfter(parentNode, node) {
25 // Special case for text components, which return [open, close] comments
26 - // from getNativeNode.
26 + // from getHostNode.
27 if (Array.isArray(node)) {
28 node = node[1];
29 }
@@ -123,7 +123,7 @@ function replaceDelimitedText(openingComment, closingComment, stringText) {
123 }
124
125 if (__DEV__) {
126 - ReactInstrumentation.debugTool.onNativeOperation(
126 + ReactInstrumentation.debugTool.onHostOperation(
127 ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
128 'replace text',
129 stringText
@@ -136,7 +136,7 @@ if (__DEV__) {
136 dangerouslyReplaceNodeWithMarkup = function(oldChild, markup, prevInstance) {
137 Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
138 if (prevInstance._debugID !== 0) {
139 - ReactInstrumentation.debugTool.onNativeOperation(
139 + ReactInstrumentation.debugTool.onHostOperation(
140 prevInstance._debugID,
141 'replace with',
142 markup.toString()
@@ -144,7 +144,7 @@ if (__DEV__) {
144 } else {
145 var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
146 if (nextInstance._debugID !== 0) {
147 - ReactInstrumentation.debugTool.onNativeOperation(
147 + ReactInstrumentation.debugTool.onHostOperation(
148 nextInstance._debugID,
149 'mount',
150 markup.toString()
@@ -186,7 +186,7 @@ var DOMChildrenOperations = {
186 getNodeAfter(parentNode, update.afterNode)
187 );
188 if (__DEV__) {
189 - ReactInstrumentation.debugTool.onNativeOperation(
189 + ReactInstrumentation.debugTool.onHostOperation(
190 parentNodeDebugID,
191 'insert child',
192 {toIndex: update.toIndex, content: update.content.toString()}
@@ -200,7 +200,7 @@ var DOMChildrenOperations = {
200 getNodeAfter(parentNode, update.afterNode)
201 );
202 if (__DEV__) {
203 - ReactInstrumentation.debugTool.onNativeOperation(
203 + ReactInstrumentation.debugTool.onHostOperation(
204 parentNodeDebugID,
205 'move child',
206 {fromIndex: update.fromIndex, toIndex: update.toIndex}
@@ -213,7 +213,7 @@ var DOMChildrenOperations = {
213 update.content
214 );
215 if (__DEV__) {
216 - ReactInstrumentation.debugTool.onNativeOperation(
216 + ReactInstrumentation.debugTool.onHostOperation(
217 parentNodeDebugID,
218 'replace children',
219 update.content.toString()
@@ -226,7 +226,7 @@ var DOMChildrenOperations = {
226 update.content
227 );
228 if (__DEV__) {
229 - ReactInstrumentation.debugTool.onNativeOperation(
229 + ReactInstrumentation.debugTool.onHostOperation(
230 parentNodeDebugID,
231 'replace text',
232 update.content.toString()
@@ -236,7 +236,7 @@ var DOMChildrenOperations = {
236 case ReactMultiChildUpdateTypes.REMOVE_NODE:
237 removeChild(parentNode, update.fromNode);
238 if (__DEV__) {
239 - ReactInstrumentation.debugTool.onNativeOperation(
239 + ReactInstrumentation.debugTool.onHostOperation(
240 parentNodeDebugID,
241 'remove child',
242 {fromIndex: update.fromIndex}
src/renderers/dom/client/wrappers/DisabledInputUtils.js
+5 -5
@@ -26,24 +26,24 @@ var disableableMouseListenerNames = {
26 };
27
28 /**
29 - * Implements a native component that does not receive mouse events
29 + * Implements a host component that does not receive mouse events
30 * when `disabled` is set.
31 */
32 var DisabledInputUtils = {
33 - getNativeProps: function(inst, props) {
33 + getHostProps: function(inst, props) {
34 if (!props.disabled) {
35 return props;
36 }
37
38 // Copy the props, except the mouse listeners
39 - var nativeProps = {};
39 + var hostProps = {};
40 for (var key in props) {
41 if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
42 - nativeProps[key] = props[key];
42 + hostProps[key] = props[key];
43 }
44 }
45
46 - return nativeProps;
46 + return hostProps;
47 },
48 };
49
src/renderers/dom/client/wrappers/ReactDOMButton.js
+2 -2
@@ -14,11 +14,11 @@
14 var DisabledInputUtils = require('DisabledInputUtils');
15
16 /**
17 - * Implements a <button> native component that does not receive mouse events
17 + * Implements a <button> host component that does not receive mouse events
18 * when `disabled` is set.
19 */
20 var ReactDOMButton = {
21 - getNativeProps: DisabledInputUtils.getNativeProps,
21 + getHostProps: DisabledInputUtils.getHostProps,
22 };
23
24 module.exports = ReactDOMButton;
src/renderers/dom/client/wrappers/ReactDOMInput.js
+5 -5
@@ -49,7 +49,7 @@ function warnIfValueIsNull(props) {
49 }
50
51 /**
52 - * Implements an <input> native component that allows setting these optional
52 + * Implements an <input> host component that allows setting these optional
53 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
54 *
55 * If `checked` or `value` are not supplied (or null/undefined), user actions
@@ -65,15 +65,15 @@ function warnIfValueIsNull(props) {
65 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
66 */
67 var ReactDOMInput = {
68 - getNativeProps: function(inst, props) {
68 + getHostProps: function(inst, props) {
69 var value = LinkedValueUtils.getValue(props);
70 var checked = LinkedValueUtils.getChecked(props);
71
72 - var nativeProps = Object.assign({
72 + var hostProps = Object.assign({
73 // Make sure we set .type before any other properties (setting .value
74 // before .type means .value is lost in IE11 and below)
75 type: undefined,
76 - }, DisabledInputUtils.getNativeProps(inst, props), {
76 + }, DisabledInputUtils.getHostProps(inst, props), {
77 defaultChecked: undefined,
78 defaultValue: undefined,
79 value: value != null ? value : inst._wrapperState.initialValue,
@@ -81,7 +81,7 @@ var ReactDOMInput = {
81 onChange: inst._wrapperState.onChange,
82 });
83
84 - return nativeProps;
84 + return hostProps;
85 },
86
87 mountWrapper: function(inst, props) {
src/renderers/dom/client/wrappers/ReactDOMOption.js
+11 -11
@@ -37,15 +37,15 @@ function flattenChildren(children) {
37 );
38 }
39 });
40 -
40 +
41 return content;
42 }
43
44 /**
45 - * Implements an <option> native component that warns when `selected` is set.
45 + * Implements an <option> host component that warns when `selected` is set.
46 */
47 var ReactDOMOption = {
48 - mountWrapper: function(inst, props, nativeParent) {
48 + mountWrapper: function(inst, props, hostParent) {
49 // TODO (yungsters): Remove support for `selected` in <option>.
50 if (__DEV__) {
51 warning(
@@ -57,11 +57,11 @@ var ReactDOMOption = {
57
58 // Look up whether this option is 'selected'
59 var selectValue = null;
60 - if (nativeParent != null) {
61 - var selectParent = nativeParent;
60 + if (hostParent != null) {
61 + var selectParent = hostParent;
62
63 if (selectParent._tag === 'optgroup') {
64 - selectParent = selectParent._nativeParent;
64 + selectParent = selectParent._hostParent;
65 }
66
67 if (selectParent != null && selectParent._tag === 'select') {
@@ -105,22 +105,22 @@ var ReactDOMOption = {
105 }
106 },
107
108 - getNativeProps: function(inst, props) {
109 - var nativeProps = Object.assign({selected: undefined, children: undefined}, props);
108 + getHostProps: function(inst, props) {
109 + var hostProps = Object.assign({selected: undefined, children: undefined}, props);
110
111 // Read state only from initial mount because <select> updates value
112 // manually; we need the initial state only for server rendering
113 if (inst._wrapperState.selected != null) {
114 - nativeProps.selected = inst._wrapperState.selected;
114 + hostProps.selected = inst._wrapperState.selected;
115 }
116
117 var content = flattenChildren(props.children);
118
119 if (content) {
120 - nativeProps.children = content;
120 + hostProps.children = content;
121 }
122
123 - return nativeProps;
123 + return hostProps;
124 },
125
126 };
src/renderers/dom/client/wrappers/ReactDOMSelect.js
+3 -3
@@ -143,7 +143,7 @@ function updateOptions(inst, multiple, propValue) {
143 }
144
145 /**
146 - * Implements a <select> native component that allows optionally setting the
146 + * Implements a <select> host component that allows optionally setting the
147 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
148 * stringable. If `multiple` is true, the prop must be an array of stringables.
149 *
@@ -158,8 +158,8 @@ function updateOptions(inst, multiple, propValue) {
158 * selected.
159 */
160 var ReactDOMSelect = {
161 - getNativeProps: function(inst, props) {
162 - return Object.assign({}, DisabledInputUtils.getNativeProps(inst, props), {
161 + getHostProps: function(inst, props) {
162 + return Object.assign({}, DisabledInputUtils.getHostProps(inst, props), {
163 onChange: inst._wrapperState.onChange,
164 value: undefined,
165 });
src/renderers/dom/client/wrappers/ReactDOMTextarea.js
+4 -4
@@ -45,7 +45,7 @@ function warnIfValueIsNull(props) {
45 }
46
47 /**
48 - * Implements a <textarea> native component that allows setting `value`, and
48 + * Implements a <textarea> host component that allows setting `value`, and
49 * `defaultValue`. This differs from the traditional DOM API because value is
50 * usually set as PCDATA children.
51 *
@@ -60,7 +60,7 @@ function warnIfValueIsNull(props) {
60 * `defaultValue` if specified, or the children content (deprecated).
61 */
62 var ReactDOMTextarea = {
63 - getNativeProps: function(inst, props) {
63 + getHostProps: function(inst, props) {
64 invariant(
65 props.dangerouslySetInnerHTML == null,
66 '`dangerouslySetInnerHTML` does not make sense on <textarea>.'
@@ -68,14 +68,14 @@ var ReactDOMTextarea = {
68
69 // Always set children to the same thing. In IE9, the selection range will
70 // get reset if `textContent` is mutated.
71 - var nativeProps = Object.assign({}, DisabledInputUtils.getNativeProps(inst, props), {
71 + var hostProps = Object.assign({}, DisabledInputUtils.getHostProps(inst, props), {
72 defaultValue: undefined,
73 value: undefined,
74 children: inst._wrapperState.initialValue,
75 onChange: inst._wrapperState.onChange,
76 });
77
78 - return nativeProps;
78 + return hostProps;
79 },
80
81 mountWrapper: function(inst, props) {
src/renderers/dom/shared/CSSPropertyOperations.js
+1 -1
@@ -193,7 +193,7 @@ var CSSPropertyOperations = {
193 */
194 setValueForStyles: function(node, styles, component) {
195 if (__DEV__) {
196 - ReactInstrumentation.debugTool.onNativeOperation(
196 + ReactInstrumentation.debugTool.onHostOperation(
197 component._debugID,
198 'update styles',
199 styles
src/renderers/dom/shared/DOMPropertyOperations.js
+3 -3
@@ -177,7 +177,7 @@ var DOMPropertyOperations = {
177 ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
178 var payload = {};
179 payload[name] = value;
180 - ReactInstrumentation.debugTool.onNativeOperation(
180 + ReactInstrumentation.debugTool.onHostOperation(
181 ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
182 'update attribute',
183 payload
@@ -198,7 +198,7 @@ var DOMPropertyOperations = {
198 if (__DEV__) {
199 var payload = {};
200 payload[name] = value;
201 - ReactInstrumentation.debugTool.onNativeOperation(
201 + ReactInstrumentation.debugTool.onHostOperation(
202 ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
203 'update attribute',
204 payload
@@ -239,7 +239,7 @@ var DOMPropertyOperations = {
239
240 if (__DEV__) {
241 ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
242 - ReactInstrumentation.debugTool.onNativeOperation(
242 + ReactInstrumentation.debugTool.onHostOperation(
243 ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
244 'remove attribute',
245 name
src/renderers/dom/shared/ReactDOMComponent.js
+44 -44
@@ -222,7 +222,7 @@ function enqueuePutListener(inst, registrationName, listener, transaction) {
222 'This browser doesn\'t support the `onScroll` event'
223 );
224 }
225 - var containerInfo = inst._nativeContainerInfo;
225 + var containerInfo = inst._hostContainerInfo;
226 var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
227 var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
228 listenTo(registrationName, doc);
@@ -457,11 +457,11 @@ function ReactDOMComponent(element) {
457 this._renderedChildren = null;
458 this._previousStyle = null;
459 this._previousStyleCopy = null;
460 - this._nativeNode = null;
461 - this._nativeParent = null;
460 + this._hostNode = null;
461 + this._hostParent = null;
462 this._rootNodeID = null;
463 this._domID = null;
464 - this._nativeContainerInfo = null;
464 + this._hostContainerInfo = null;
465 this._wrapperState = null;
466 this._topLevelWrapper = null;
467 this._flags = 0;
@@ -482,20 +482,20 @@ ReactDOMComponent.Mixin = {
482 * @internal
483 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
484 * @param {?ReactDOMComponent} the containing DOM component instance
485 - * @param {?object} info about the native container
485 + * @param {?object} info about the host container
486 * @param {object} context
487 * @return {string} The computed markup.
488 */
489 mountComponent: function(
490 transaction,
491 - nativeParent,
492 - nativeContainerInfo,
491 + hostParent,
492 + hostContainerInfo,
493 context
494 ) {
495 this._rootNodeID = globalIdCounter++;
496 - this._domID = nativeContainerInfo._idCounter++;
497 - this._nativeParent = nativeParent;
498 - this._nativeContainerInfo = nativeContainerInfo;
496 + this._domID = hostContainerInfo._idCounter++;
497 + this._hostParent = hostParent;
498 + this._hostContainerInfo = hostContainerInfo;
499
500 var props = this._currentElement.props;
501
@@ -512,26 +512,26 @@ ReactDOMComponent.Mixin = {
512 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
513 break;
514 case 'button':
515 - props = ReactDOMButton.getNativeProps(this, props, nativeParent);
515 + props = ReactDOMButton.getHostProps(this, props, hostParent);
516 break;
517 case 'input':
518 - ReactDOMInput.mountWrapper(this, props, nativeParent);
519 - props = ReactDOMInput.getNativeProps(this, props);
518 + ReactDOMInput.mountWrapper(this, props, hostParent);
519 + props = ReactDOMInput.getHostProps(this, props);
520 transaction.getReactMountReady().enqueue(trackInputValue, this);
521 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
522 break;
523 case 'option':
524 - ReactDOMOption.mountWrapper(this, props, nativeParent);
525 - props = ReactDOMOption.getNativeProps(this, props);
524 + ReactDOMOption.mountWrapper(this, props, hostParent);
525 + props = ReactDOMOption.getHostProps(this, props);
526 break;
527 case 'select':
528 - ReactDOMSelect.mountWrapper(this, props, nativeParent);
529 - props = ReactDOMSelect.getNativeProps(this, props);
528 + ReactDOMSelect.mountWrapper(this, props, hostParent);
529 + props = ReactDOMSelect.getHostProps(this, props);
530 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
531 break;
532 case 'textarea':
533 - ReactDOMTextarea.mountWrapper(this, props, nativeParent);
534 - props = ReactDOMTextarea.getNativeProps(this, props);
533 + ReactDOMTextarea.mountWrapper(this, props, hostParent);
534 + props = ReactDOMTextarea.getHostProps(this, props);
535 transaction.getReactMountReady().enqueue(trackInputValue, this);
536 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
537 break;
@@ -543,12 +543,12 @@ ReactDOMComponent.Mixin = {
543 // tags get no namespace.
544 var namespaceURI;
545 var parentTag;
546 - if (nativeParent != null) {
547 - namespaceURI = nativeParent._namespaceURI;
548 - parentTag = nativeParent._tag;
549 - } else if (nativeContainerInfo._tag) {
550 - namespaceURI = nativeContainerInfo._namespaceURI;
551 - parentTag = nativeContainerInfo._tag;
546 + if (hostParent != null) {
547 + namespaceURI = hostParent._namespaceURI;
548 + parentTag = hostParent._tag;
549 + } else if (hostContainerInfo._tag) {
550 + namespaceURI = hostContainerInfo._namespaceURI;
551 + parentTag = hostContainerInfo._tag;
552 }
553 if (namespaceURI == null ||
554 namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
@@ -565,10 +565,10 @@ ReactDOMComponent.Mixin = {
565
566 if (__DEV__) {
567 var parentInfo;
568 - if (nativeParent != null) {
569 - parentInfo = nativeParent._ancestorInfo;
570 - } else if (nativeContainerInfo._tag) {
571 - parentInfo = nativeContainerInfo._ancestorInfo;
568 + if (hostParent != null) {
569 + parentInfo = hostParent._ancestorInfo;
570 + } else if (hostContainerInfo._tag) {
571 + parentInfo = hostContainerInfo._ancestorInfo;
572 }
573 if (parentInfo) {
574 // parentInfo should always be present except for the top-level
@@ -585,7 +585,7 @@ ReactDOMComponent.Mixin = {
585
586 var mountImage;
587 if (transaction.useCreateElement) {
588 - var ownerDocument = nativeContainerInfo._ownerDocument;
588 + var ownerDocument = hostContainerInfo._ownerDocument;
589 var el;
590 if (namespaceURI === DOMNamespaces.html) {
591 if (this._tag === 'script') {
@@ -606,7 +606,7 @@ ReactDOMComponent.Mixin = {
606 }
607 ReactDOMComponentTree.precacheNode(this, el);
608 this._flags |= Flags.hasCachedChildNodes;
609 - if (!this._nativeParent) {
609 + if (!this._hostParent) {
610 DOMPropertyOperations.setAttributeForRoot(el);
611 }
612 this._updateDOMProperties(null, props, transaction);
@@ -705,7 +705,7 @@ ReactDOMComponent.Mixin = {
705 return ret;
706 }
707
708 - if (!this._nativeParent) {
708 + if (!this._hostParent) {
709 ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
710 }
711 ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
@@ -811,7 +811,7 @@ ReactDOMComponent.Mixin = {
811 },
812
813 /**
814 - * Updates a native DOM component after it has already been allocated and
814 + * Updates a DOM component after it has already been allocated and
815 * attached to the DOM. Reconciles the root DOM node, then recurses.
816 *
817 * @param {ReactReconcileTransaction} transaction
@@ -826,26 +826,26 @@ ReactDOMComponent.Mixin = {
826
827 switch (this._tag) {
828 case 'button':
829 - lastProps = ReactDOMButton.getNativeProps(this, lastProps);
830 - nextProps = ReactDOMButton.getNativeProps(this, nextProps);
829 + lastProps = ReactDOMButton.getHostProps(this, lastProps);
830 + nextProps = ReactDOMButton.getHostProps(this, nextProps);
831 break;
832 case 'input':
833 ReactDOMInput.updateWrapper(this);
834 - lastProps = ReactDOMInput.getNativeProps(this, lastProps);
835 - nextProps = ReactDOMInput.getNativeProps(this, nextProps);
834 + lastProps = ReactDOMInput.getHostProps(this, lastProps);
835 + nextProps = ReactDOMInput.getHostProps(this, nextProps);
836 break;
837 case 'option':
838 - lastProps = ReactDOMOption.getNativeProps(this, lastProps);
839 - nextProps = ReactDOMOption.getNativeProps(this, nextProps);
838 + lastProps = ReactDOMOption.getHostProps(this, lastProps);
839 + nextProps = ReactDOMOption.getHostProps(this, nextProps);
840 break;
841 case 'select':
842 - lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
843 - nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
842 + lastProps = ReactDOMSelect.getHostProps(this, lastProps);
843 + nextProps = ReactDOMSelect.getHostProps(this, nextProps);
844 break;
845 case 'textarea':
846 ReactDOMTextarea.updateWrapper(this);
847 - lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
848 - nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
847 + lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
848 + nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
849 break;
850 }
851
@@ -1065,7 +1065,7 @@ ReactDOMComponent.Mixin = {
1065 }
1066 },
1067
1068 - getNativeNode: function() {
1068 + getHostNode: function() {
1069 return getNode(this);
1070 },
1071
src/renderers/dom/shared/ReactDOMEmptyComponent.js
+10 -10
@@ -19,26 +19,26 @@ var ReactDOMEmptyComponent = function(instantiate) {
19 // ReactCompositeComponent uses this:
20 this._currentElement = null;
21 // ReactDOMComponentTree uses these:
22 - this._nativeNode = null;
23 - this._nativeParent = null;
24 - this._nativeContainerInfo = null;
22 + this._hostNode = null;
23 + this._hostParent = null;
24 + this._hostContainerInfo = null;
25 this._domID = null;
26 };
27 Object.assign(ReactDOMEmptyComponent.prototype, {
28 mountComponent: function(
29 transaction,
30 - nativeParent,
31 - nativeContainerInfo,
30 + hostParent,
31 + hostContainerInfo,
32 context
33 ) {
34 - var domID = nativeContainerInfo._idCounter++;
34 + var domID = hostContainerInfo._idCounter++;
35 this._domID = domID;
36 - this._nativeParent = nativeParent;
37 - this._nativeContainerInfo = nativeContainerInfo;
36 + this._hostParent = hostParent;
37 + this._hostContainerInfo = hostContainerInfo;
38
39 var nodeValue = ' react-empty: ' + this._domID + ' ';
40 if (transaction.useCreateElement) {
41 - var ownerDocument = nativeContainerInfo._ownerDocument;
41 + var ownerDocument = hostContainerInfo._ownerDocument;
42 var node = ownerDocument.createComment(nodeValue);
43 ReactDOMComponentTree.precacheNode(this, node);
44 return DOMLazyTree(node);
@@ -54,7 +54,7 @@ Object.assign(ReactDOMEmptyComponent.prototype, {
54 },
55 receiveComponent: function() {
56 },
57 - getNativeNode: function() {
57 + getHostNode: function() {
58 return ReactDOMComponentTree.getNodeFromInstance(this);
59 },
60 unmountComponent: function() {
src/renderers/dom/shared/ReactDOMTextComponent.js
+19 -19
@@ -40,8 +40,8 @@ var ReactDOMTextComponent = function(text) {
40 this._currentElement = text;
41 this._stringText = '' + text;
42 // ReactDOMComponentTree uses these:
43 - this._nativeNode = null;
44 - this._nativeParent = null;
43 + this._hostNode = null;
44 + this._hostParent = null;
45
46 // Properties
47 this._domID = null;
@@ -62,18 +62,18 @@ Object.assign(ReactDOMTextComponent.prototype, {
62 */
63 mountComponent: function(
64 transaction,
65 - nativeParent,
66 - nativeContainerInfo,
65 + hostParent,
66 + hostContainerInfo,
67 context
68 ) {
69 if (__DEV__) {
70 ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
71
72 var parentInfo;
73 - if (nativeParent != null) {
74 - parentInfo = nativeParent._ancestorInfo;
75 - } else if (nativeContainerInfo != null) {
76 - parentInfo = nativeContainerInfo._ancestorInfo;
73 + if (hostParent != null) {
74 + parentInfo = hostParent._ancestorInfo;
75 + } else if (hostContainerInfo != null) {
76 + parentInfo = hostContainerInfo._ancestorInfo;
77 }
78 if (parentInfo) {
79 // parentInfo should always be present except for the top-level
@@ -82,13 +82,13 @@ Object.assign(ReactDOMTextComponent.prototype, {
82 }
83 }
84
85 - var domID = nativeContainerInfo._idCounter++;
85 + var domID = hostContainerInfo._idCounter++;
86 var openingValue = ' react-text: ' + domID + ' ';
87 var closingValue = ' /react-text ';
88 this._domID = domID;
89 - this._nativeParent = nativeParent;
89 + this._hostParent = hostParent;
90 if (transaction.useCreateElement) {
91 - var ownerDocument = nativeContainerInfo._ownerDocument;
91 + var ownerDocument = hostContainerInfo._ownerDocument;
92 var openingComment = ownerDocument.createComment(openingValue);
93 var closingComment = ownerDocument.createComment(closingValue);
94 var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
@@ -136,7 +136,7 @@ Object.assign(ReactDOMTextComponent.prototype, {
136 // and/or updateComponent to do the actual update for consistency with
137 // other component types?
138 this._stringText = nextStringText;
139 - var commentNodes = this.getNativeNode();
139 + var commentNodes = this.getHostNode();
140 DOMChildrenOperations.replaceDelimitedText(
141 commentNodes[0],
142 commentNodes[1],
@@ -153,10 +153,10 @@ Object.assign(ReactDOMTextComponent.prototype, {
153 }
154 },
155
156 - getNativeNode: function() {
157 - var nativeNode = this._commentNodes;
158 - if (nativeNode) {
159 - return nativeNode;
156 + getHostNode: function() {
157 + var hostNode = this._commentNodes;
158 + if (hostNode) {
159 + return hostNode;
160 }
161 if (!this._closingComment) {
162 var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
@@ -174,9 +174,9 @@ Object.assign(ReactDOMTextComponent.prototype, {
174 node = node.nextSibling;
175 }
176 }
177 - nativeNode = [this._nativeNode, this._closingComment];
178 - this._commentNodes = nativeNode;
179 - return nativeNode;
177 + hostNode = [this._hostNode, this._closingComment];
178 + this._commentNodes = hostNode;
179 + return hostNode;
180 },
181
182 unmountComponent: function() {
src/renderers/dom/shared/ReactDefaultInjection.js
+2 -2
@@ -65,11 +65,11 @@ function inject() {
65 BeforeInputEventPlugin: BeforeInputEventPlugin,
66 });
67
68 - ReactInjection.NativeComponent.injectGenericComponentClass(
68 + ReactInjection.HostComponent.injectGenericComponentClass(
69 ReactDOMComponent
70 );
71
72 - ReactInjection.NativeComponent.injectTextComponentClass(
72 + ReactInjection.HostComponent.injectTextComponentClass(
73 ReactDOMTextComponent
74 );
75
src/renderers/dom/shared/ReactInjection.js
+2 -2
@@ -18,7 +18,7 @@ var ReactComponentEnvironment = require('ReactComponentEnvironment');
18 var ReactClass = require('ReactClass');
19 var ReactEmptyComponent = require('ReactEmptyComponent');
20 var ReactBrowserEventEmitter = require('ReactBrowserEventEmitter');
21 -var ReactNativeComponent = require('ReactNativeComponent');
21 +var ReactHostComponent = require('ReactHostComponent');
22 var ReactUpdates = require('ReactUpdates');
23
24 var ReactInjection = {
@@ -29,7 +29,7 @@ var ReactInjection = {
29 EventPluginHub: EventPluginHub.injection,
30 EventPluginUtils: EventPluginUtils.injection,
31 EventEmitter: ReactBrowserEventEmitter.injection,
32 - NativeComponent: ReactNativeComponent.injection,
32 + HostComponent: ReactHostComponent.injection,
33 Updates: ReactUpdates.injection,
34 };
35
src/renderers/native/ReactNativeBaseComponent.js
+5 -5
@@ -166,7 +166,7 @@ ReactNativeBaseComponent.Mixin = {
166 *
167 * @return {null} Null.
168 */
169 - getNativeNode: function() {
169 + getHostNode: function() {
170 return this._rootNodeID;
171 },
172
@@ -175,12 +175,12 @@ ReactNativeBaseComponent.Mixin = {
175 * @param {Transaction} transaction For creating/updating.
176 * @return {string} Unique iOS view tag.
177 */
178 - mountComponent: function(transaction, nativeParent, nativeContainerInfo, context) {
178 + mountComponent: function(transaction, hostParent, hostContainerInfo, context) {
179 var tag = ReactNativeTagHandles.allocateTag();
180
181 this._rootNodeID = tag;
182 - this._nativeParent = nativeParent;
183 - this._nativeContainerInfo = nativeContainerInfo;
182 + this._hostParent = hostParent;
183 + this._hostContainerInfo = hostContainerInfo;
184
185 if (__DEV__) {
186 for (var key in this.viewConfig.validAttributes) {
@@ -195,7 +195,7 @@ ReactNativeBaseComponent.Mixin = {
195 this.viewConfig.validAttributes
196 );
197
198 - var nativeTopRootTag = nativeContainerInfo._tag;
198 + var nativeTopRootTag = hostContainerInfo._tag;
199 UIManager.createView(
200 tag,
201 this.viewConfig.uiViewClassName,
src/renderers/native/ReactNativeComponentTree.js
+5 -5
@@ -16,13 +16,13 @@ var invariant = require('invariant');
16 var instanceCache = {};
17
18 /**
19 - * Drill down (through composites and empty components) until we get a native or
20 - * native text component.
19 + * Drill down (through composites and empty components) until we get a host or
20 + * host text component.
21 *
22 * This is pretty polymorphic but unavoidable with the current structure we have
23 * for `_renderedChildren`.
24 */
25 -function getRenderedNativeOrTextFromComponent(component) {
25 +function getRenderedHostOrTextFromComponent(component) {
26 var rendered;
27 while ((rendered = component._renderedComponent)) {
28 component = rendered;
@@ -31,11 +31,11 @@ function getRenderedNativeOrTextFromComponent(component) {
31 }
32
33 /**
34 - * Populate `_nativeNode` on the rendered native/text component with the given
34 + * Populate `_hostNode` on the rendered host/text component with the given
35 * DOM node. The passed `inst` can be a composite.
36 */
37 function precacheNode(inst, tag) {
38 - var nativeInst = getRenderedNativeOrTextFromComponent(inst);
38 + var nativeInst = getRenderedHostOrTextFromComponent(inst);
39 instanceCache[tag] = nativeInst;
40 }
41
src/renderers/native/ReactNativeDefaultInjection.js
+3 -3
@@ -27,7 +27,7 @@ var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
27 var ReactElement = require('ReactElement');
28 var ReactEmptyComponent = require('ReactEmptyComponent');
29 var ReactNativeBridgeEventPlugin = require('ReactNativeBridgeEventPlugin');
30 -var ReactNativeComponent = require('ReactNativeComponent');
30 +var ReactHostComponent = require('ReactHostComponent');
31 var ReactNativeComponentEnvironment = require('ReactNativeComponentEnvironment');
32 var ReactNativeComponentTree = require('ReactNativeComponentTree');
33 var ReactNativeEventEmitter = require('ReactNativeEventEmitter');
@@ -93,10 +93,10 @@ function inject() {
93
94 ReactEmptyComponent.injection.injectEmptyComponentFactory(EmptyComponent);
95
96 - ReactNativeComponent.injection.injectTextComponentClass(
96 + ReactHostComponent.injection.injectTextComponentClass(
97 ReactNativeTextComponent
98 );
99 - ReactNativeComponent.injection.injectGenericComponentClass(function(tag) {
99 + ReactHostComponent.injection.injectGenericComponentClass(function(tag) {
100 // Show a nicer error message for non-function tags
101 var info = '';
102 if (typeof tag === 'string' && /^[a-z]/.test(tag)) {
src/renderers/native/ReactNativeTextComponent.js
+6 -6
@@ -22,27 +22,27 @@ var ReactNativeTextComponent = function(text) {
22 // This is really a ReactText (ReactNode), not a ReactElement
23 this._currentElement = text;
24 this._stringText = '' + text;
25 - this._nativeParent = null;
25 + this._hostParent = null;
26 this._rootNodeID = null;
27 };
28
29 Object.assign(ReactNativeTextComponent.prototype, {
30
31 - mountComponent: function(transaction, nativeParent, nativeContainerInfo, context) {
31 + mountComponent: function(transaction, hostParent, hostContainerInfo, context) {
32 if (__DEV__) {
33 ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
34 }
35
36 - // TODO: nativeParent should have this context already. Stop abusing context.
36 + // TODO: hostParent should have this context already. Stop abusing context.
37 invariant(
38 context.isInAParentText,
39 'RawText "%s" must be wrapped in an explicit <Text> component.',
40 this._stringText
41 );
42 - this._nativeParent = nativeParent;
42 + this._hostParent = hostParent;
43 var tag = ReactNativeTagHandles.allocateTag();
44 this._rootNodeID = tag;
45 - var nativeTopRootTag = nativeContainerInfo._tag;
45 + var nativeTopRootTag = hostContainerInfo._tag;
46 UIManager.createView(
47 tag,
48 'RCTRawText',
@@ -55,7 +55,7 @@ Object.assign(ReactNativeTextComponent.prototype, {
55 return tag;
56 },
57
58 - getNativeNode: function() {
58 + getHostNode: function() {
59 return this._rootNodeID;
60 },
61
src/renderers/native/ReactNativeTreeTraversal.js
+11 -11
@@ -19,23 +19,23 @@
19 */
20 function getLowestCommonAncestor(instA, instB) {
21 var depthA = 0;
22 - for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
22 + for (var tempA = instA; tempA; tempA = tempA._hostParent) {
23 depthA++;
24 }
25 var depthB = 0;
26 - for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
26 + for (var tempB = instB; tempB; tempB = tempB._hostParent) {
27 depthB++;
28 }
29
30 // If A is deeper, crawl up.
31 while (depthA - depthB > 0) {
32 - instA = instA._nativeParent;
32 + instA = instA._hostParent;
33 depthA--;
34 }
35
36 // If B is deeper, crawl up.
37 while (depthB - depthA > 0) {
38 - instB = instB._nativeParent;
38 + instB = instB._hostParent;
39 depthB--;
40 }
41
@@ -45,8 +45,8 @@ function getLowestCommonAncestor(instA, instB) {
45 if (instA === instB) {
46 return instA;
47 }
48 - instA = instA._nativeParent;
49 - instB = instB._nativeParent;
48 + instA = instA._hostParent;
49 + instB = instB._hostParent;
50 }
51 return null;
52 }
@@ -59,7 +59,7 @@ function isAncestor(instA, instB) {
59 if (instB === instA) {
60 return true;
61 }
62 - instB = instB._nativeParent;
62 + instB = instB._hostParent;
63 }
64 return false;
65 }
@@ -68,7 +68,7 @@ function isAncestor(instA, instB) {
68 * Return the parent instance of the passed-in instance.
69 */
70 function getParentInstance(inst) {
71 - return inst._nativeParent;
71 + return inst._hostParent;
72 }
73
74 /**
@@ -78,7 +78,7 @@ function traverseTwoPhase(inst, fn, arg) {
78 var path = [];
79 while (inst) {
80 path.push(inst);
81 - inst = inst._nativeParent;
81 + inst = inst._hostParent;
82 }
83 var i;
84 for (i = path.length; i-- > 0;) {
@@ -101,12 +101,12 @@ function traverseEnterLeave(from, to, fn, argFrom, argTo) {
101 var pathFrom = [];
102 while (from && from !== common) {
103 pathFrom.push(from);
104 - from = from._nativeParent;
104 + from = from._hostParent;
105 }
106 var pathTo = [];
107 while (to && to !== common) {
108 pathTo.push(to);
109 - to = to._nativeParent;
109 + to = to._hostParent;
110 }
111 var i;
112 for (i = 0; i < pathFrom.length; i++) {
src/renderers/native/createReactNativeComponentClass.js
+2 -2
@@ -31,8 +31,8 @@ var createReactNativeComponentClass = function(
31 var Constructor = function(element) {
32 this._currentElement = element;
33 this._topLevelWrapper = null;
34 - this._nativeParent = null;
35 - this._nativeContainerInfo = null;
34 + this._hostParent = null;
35 + this._hostContainerInfo = null;
36 this._rootNodeID = null;
37 this._renderedChildren = null;
38 };
src/renderers/native/findNodeHandle.js
+1 -1
@@ -78,7 +78,7 @@ function findNodeHandle(componentOrHandle: any): ?number {
78 // ReactInstanceMap.get here will always succeed for mounted components
79 var internalInstance = ReactInstanceMap.get(component);
80 if (internalInstance) {
81 - return internalInstance.getNativeNode();
81 + return internalInstance.getHostNode();
82 } else {
83 var rootNodeID = component._rootNodeID;
84 if (rootNodeID) {
src/renderers/shared/fiber/ReactFiberReconciler.js
+2 -2
@@ -19,7 +19,7 @@ var ReactTypesOfWork = require('ReactTypesOfWork');
19 var {
20 FunctionalComponent,
21 ClassComponent,
22 - NativeComponent,
22 + HostComponent,
23 } = ReactTypesOfWork;
24
25 type ReactHostElement<T, P> = {
@@ -60,7 +60,7 @@ module.exports = function<T, P, I>(config : HostConfig<T, P, I>) : Reconciler {
60 return ReactFiberFunctionalComponent.performWork(unit);
61 case ClassComponent:
62 break;
63 - case NativeComponent:
63 + case HostComponent:
64 break;
65 }
66 return null;
src/renderers/shared/fiber/ReactTypesOfWork.js
+1 -1
@@ -15,7 +15,7 @@
15 var TypesOfWork = {
16 FunctionalComponent: 1,
17 ClassComponent: 2,
18 - NativeComponent: 3,
18 + HostComponent: 3,
19 };
20
21 module.exports = TypesOfWork;
src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js
+5 -5
@@ -46,14 +46,14 @@ var trackedTouchCount = 0;
46 */
47 var previousActiveTouches = 0;
48
49 -var changeResponder = function(nextResponderInst, blockNativeResponder) {
49 +var changeResponder = function(nextResponderInst, blockHostResponder) {
50 var oldResponderInst = responderInst;
51 responderInst = nextResponderInst;
52 if (ResponderEventPlugin.GlobalResponderHandler !== null) {
53 ResponderEventPlugin.GlobalResponderHandler.onChange(
54 oldResponderInst,
55 nextResponderInst,
56 - blockNativeResponder
56 + blockHostResponder
57 );
58 }
59 };
@@ -371,7 +371,7 @@ function setResponderAndExtractTransfer(
371 grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
372
373 EventPropagators.accumulateDirectDispatches(grantEvent);
374 - var blockNativeResponder = executeDirectDispatch(grantEvent) === true;
374 + var blockHostResponder = executeDirectDispatch(grantEvent) === true;
375 if (responderInst) {
376
377 var terminationRequestEvent = ResponderSyntheticEvent.getPooled(
@@ -398,7 +398,7 @@ function setResponderAndExtractTransfer(
398 terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
399 EventPropagators.accumulateDirectDispatches(terminateEvent);
400 extracted = accumulate(extracted, [grantEvent, terminateEvent]);
401 - changeResponder(wantsResponderInst, blockNativeResponder);
401 + changeResponder(wantsResponderInst, blockHostResponder);
402 } else {
403 var rejectEvent = ResponderSyntheticEvent.getPooled(
404 eventTypes.responderReject,
@@ -412,7 +412,7 @@ function setResponderAndExtractTransfer(
412 }
413 } else {
414 extracted = accumulate(extracted, grantEvent);
415 - changeResponder(wantsResponderInst, blockNativeResponder);
415 + changeResponder(wantsResponderInst, blockHostResponder);
416 }
417 return extracted;
418 }
src/renderers/shared/stack/reconciler/ReactChildReconciler.js
+2 -2
@@ -100,7 +100,7 @@ var ReactChildReconciler = {
100 nextChildren[name] = prevChild;
101 } else {
102 if (prevChild) {
103 - removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
103 + removedNodes[name] = ReactReconciler.getHostNode(prevChild);
104 ReactReconciler.unmountComponent(prevChild, false);
105 }
106 // The child must be instantiated before it's mounted.
@@ -113,7 +113,7 @@ var ReactChildReconciler = {
113 if (prevChildren.hasOwnProperty(name) &&
114 !(nextChildren && nextChildren.hasOwnProperty(name))) {
115 prevChild = prevChildren[name];
116 - removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
116 + removedNodes[name] = ReactReconciler.getHostNode(prevChild);
117 ReactReconciler.unmountComponent(prevChild, false);
118 }
119 }
src/renderers/shared/stack/reconciler/ReactCompositeComponent.js
+26 -26
@@ -148,8 +148,8 @@ var ReactCompositeComponentMixin = {
148 this._currentElement = element;
149 this._rootNodeID = null;
150 this._instance = null;
151 - this._nativeParent = null;
152 - this._nativeContainerInfo = null;
151 + this._hostParent = null;
152 + this._hostContainerInfo = null;
153
154 // See ReactUpdateQueue
155 this._updateBatchNumber = null;
@@ -179,8 +179,8 @@ var ReactCompositeComponentMixin = {
179 * Initializes the component, renders markup, and registers event listeners.
180 *
181 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
182 - * @param {?object} nativeParent
183 - * @param {?object} nativeContainerInfo
182 + * @param {?object} hostParent
183 + * @param {?object} hostContainerInfo
184 * @param {?object} context
185 * @return {?string} Rendered markup to be inserted into the DOM.
186 * @final
@@ -188,14 +188,14 @@ var ReactCompositeComponentMixin = {
188 */
189 mountComponent: function(
190 transaction,
191 - nativeParent,
192 - nativeContainerInfo,
191 + hostParent,
192 + hostContainerInfo,
193 context
194 ) {
195 this._context = context;
196 this._mountOrder = nextMountID++;
197 - this._nativeParent = nativeParent;
198 - this._nativeContainerInfo = nativeContainerInfo;
197 + this._hostParent = hostParent;
198 + this._hostContainerInfo = hostContainerInfo;
199
200 var publicProps = this._processProps(this._currentElement.props);
201 var publicContext = this._processContext(context);
@@ -330,13 +330,13 @@ var ReactCompositeComponentMixin = {
330 if (inst.unstable_handleError) {
331 markup = this.performInitialMountWithErrorHandling(
332 renderedElement,
333 - nativeParent,
334 - nativeContainerInfo,
333 + hostParent,
334 + hostContainerInfo,
335 transaction,
336 context
337 );
338 } else {
339 - markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
339 + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
340 }
341
342 if (inst.componentDidMount) {
@@ -410,15 +410,15 @@ var ReactCompositeComponentMixin = {
410
411 performInitialMountWithErrorHandling: function(
412 renderedElement,
413 - nativeParent,
414 - nativeContainerInfo,
413 + hostParent,
414 + hostContainerInfo,
415 transaction,
416 context
417 ) {
418 var markup;
419 var checkpoint = transaction.checkpoint();
420 try {
421 - markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
421 + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
422 } catch (e) {
423 // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
424 transaction.rollback(checkpoint);
@@ -433,12 +433,12 @@ var ReactCompositeComponentMixin = {
433
434 // Try again - we've informed the component about the error, so they can render an error message this time.
435 // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
436 - markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
436 + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
437 }
438 return markup;
439 },
440
441 - performInitialMount: function(renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
441 + performInitialMount: function(renderedElement, hostParent, hostContainerInfo, transaction, context) {
442 var inst = this._instance;
443 if (inst.componentWillMount) {
444 if (__DEV__) {
@@ -478,8 +478,8 @@ var ReactCompositeComponentMixin = {
478 var markup = ReactReconciler.mountComponent(
479 this._renderedComponent,
480 transaction,
481 - nativeParent,
482 - nativeContainerInfo,
481 + hostParent,
482 + hostContainerInfo,
483 this._processChildContext(context)
484 );
485
@@ -497,8 +497,8 @@ var ReactCompositeComponentMixin = {
497 return markup;
498 },
499
500 - getNativeNode: function() {
501 - return ReactReconciler.getNativeNode(this._renderedComponent);
500 + getHostNode: function() {
501 + return ReactReconciler.getHostNode(this._renderedComponent);
502 },
503
504 /**
@@ -1027,7 +1027,7 @@ var ReactCompositeComponentMixin = {
1027 this._processChildContext(context)
1028 );
1029 } else {
1030 - var oldNativeNode = ReactReconciler.getNativeNode(prevComponentInstance);
1030 + var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
1031 ReactReconciler.unmountComponent(prevComponentInstance, false);
1032
1033 this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement);
@@ -1038,8 +1038,8 @@ var ReactCompositeComponentMixin = {
1038 var nextMarkup = ReactReconciler.mountComponent(
1039 this._renderedComponent,
1040 transaction,
1041 - this._nativeParent,
1042 - this._nativeContainerInfo,
1041 + this._hostParent,
1042 + this._hostContainerInfo,
1043 this._processChildContext(context)
1044 );
1045
@@ -1055,7 +1055,7 @@ var ReactCompositeComponentMixin = {
1055 }
1056
1057 this._replaceNodeWithMarkup(
1058 - oldNativeNode,
1058 + oldHostNode,
1059 nextMarkup,
1060 prevComponentInstance
1061 );
@@ -1067,9 +1067,9 @@ var ReactCompositeComponentMixin = {
1067 *
1068 * @protected
1069 */
1070 - _replaceNodeWithMarkup: function(oldNativeNode, nextMarkup, prevInstance) {
1070 + _replaceNodeWithMarkup: function(oldHostNode, nextMarkup, prevInstance) {
1071 ReactComponentEnvironment.replaceNodeWithMarkup(
1072 - oldNativeNode,
1072 + oldHostNode,
1073 nextMarkup,
1074 prevInstance
1075 );
src/renderers/shared/stack/reconciler/ReactHostComponent.js renamed
+7 -7
@@ -6,7 +6,7 @@
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 ReactNativeComponent
9 + * @providesModule ReactHostComponent
10 */
11
12 'use strict';
@@ -15,11 +15,11 @@ var invariant = require('invariant');
15
16 var autoGenerateWrapperClass = null;
17 var genericComponentClass = null;
18 -// This registry keeps track of wrapper classes around native tags.
18 +// This registry keeps track of wrapper classes around host tags.
19 var tagToComponentClass = {};
20 var textComponentClass = null;
21
22 -var ReactNativeComponentInjection = {
22 +var ReactHostComponentInjection = {
23 // This accepts a class that receives the tag string. This is a catch all
24 // that can render any kind of tag.
25 injectGenericComponentClass: function(componentClass) {
@@ -56,7 +56,7 @@ function getComponentClassForElement(element) {
56 }
57
58 /**
59 - * Get a native internal component class for a specific tag.
59 + * Get a host internal component class for a specific tag.
60 *
61 * @param {ReactElement} element The element to create.
62 * @return {function} The internal class constructor function.
@@ -86,12 +86,12 @@ function isTextComponent(component) {
86 return component instanceof textComponentClass;
87 }
88
89 -var ReactNativeComponent = {
89 +var ReactHostComponent = {
90 getComponentClassForElement: getComponentClassForElement,
91 createInternalComponent: createInternalComponent,
92 createInstanceForText: createInstanceForText,
93 isTextComponent: isTextComponent,
94 - injection: ReactNativeComponentInjection,
94 + injection: ReactHostComponentInjection,
95 };
96
97 -module.exports = ReactNativeComponent;
97 +module.exports = ReactHostComponent;
src/renderers/shared/stack/reconciler/ReactMultiChild.js
+4 -4
@@ -55,7 +55,7 @@ function makeMove(child, afterNode, toIndex) {
55 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
56 content: null,
57 fromIndex: child._mountIndex,
58 - fromNode: ReactReconciler.getNativeNode(child),
58 + fromNode: ReactReconciler.getHostNode(child),
59 toIndex: toIndex,
60 afterNode: afterNode,
61 };
@@ -236,7 +236,7 @@ var ReactMultiChild = {
236 child,
237 transaction,
238 this,
239 - this._nativeContainerInfo,
239 + this._hostContainerInfo,
240 context
241 );
242 child._mountIndex = index++;
@@ -360,7 +360,7 @@ var ReactMultiChild = {
360 );
361 }
362 nextIndex++;
363 - lastPlacedNode = ReactReconciler.getNativeNode(nextChild);
363 + lastPlacedNode = ReactReconciler.getHostNode(nextChild);
364 }
365 // Remove children that are no longer present.
366 for (name in removedNodes) {
@@ -453,7 +453,7 @@ var ReactMultiChild = {
453 child,
454 transaction,
455 this,
456 - this._nativeContainerInfo,
456 + this._hostContainerInfo,
457 context
458 );
459 child._mountIndex = index;
src/renderers/shared/stack/reconciler/ReactReconciler.js
+8 -8
@@ -31,8 +31,8 @@ var ReactReconciler = {
31 *
32 * @param {ReactComponent} internalInstance
33 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
34 - * @param {?object} the containing native component instance
35 - * @param {?object} info about the native container
34 + * @param {?object} the containing host component instance
35 + * @param {?object} info about the host container
36 * @return {?string} Rendered markup to be inserted into the DOM.
37 * @final
38 * @internal
@@ -40,8 +40,8 @@ var ReactReconciler = {
40 mountComponent: function(
41 internalInstance,
42 transaction,
43 - nativeParent,
44 - nativeContainerInfo,
43 + hostParent,
44 + hostContainerInfo,
45 context
46 ) {
47 if (__DEV__) {
@@ -54,8 +54,8 @@ var ReactReconciler = {
54 }
55 var markup = internalInstance.mountComponent(
56 transaction,
57 - nativeParent,
58 - nativeContainerInfo,
57 + hostParent,
58 + hostContainerInfo,
59 context
60 );
61 if (internalInstance._currentElement &&
@@ -80,8 +80,8 @@ var ReactReconciler = {
80 * Returns a value that can be passed to
81 * ReactComponentEnvironment.replaceNodeWithMarkup.
82 */
83 - getNativeNode: function(internalInstance) {
84 - return internalInstance.getNativeNode();
83 + getHostNode: function(internalInstance) {
84 + return internalInstance.getHostNode();
85 },
86
87 /**
src/renderers/shared/stack/reconciler/ReactSimpleEmptyComponent.js
+6 -6
@@ -21,22 +21,22 @@ var ReactSimpleEmptyComponent = function(placeholderElement, instantiate) {
21 Object.assign(ReactSimpleEmptyComponent.prototype, {
22 mountComponent: function(
23 transaction,
24 - nativeParent,
25 - nativeContainerInfo,
24 + hostParent,
25 + hostContainerInfo,
26 context
27 ) {
28 return ReactReconciler.mountComponent(
29 this._renderedComponent,
30 transaction,
31 - nativeParent,
32 - nativeContainerInfo,
31 + hostParent,
32 + hostContainerInfo,
33 context
34 );
35 },
36 receiveComponent: function() {
37 },
38 - getNativeNode: function() {
39 - return ReactReconciler.getNativeNode(this._renderedComponent);
38 + getHostNode: function() {
39 + return ReactReconciler.getHostNode(this._renderedComponent);
40 },
41 unmountComponent: function() {
42 ReactReconciler.unmountComponent(this._renderedComponent);
src/renderers/shared/stack/reconciler/instantiateReactComponent.js
+4 -4
@@ -13,7 +13,7 @@
13
14 var ReactCompositeComponent = require('ReactCompositeComponent');
15 var ReactEmptyComponent = require('ReactEmptyComponent');
16 -var ReactNativeComponent = require('ReactNativeComponent');
16 +var ReactHostComponent = require('ReactHostComponent');
17 var ReactInstrumentation = require('ReactInstrumentation');
18
19 var invariant = require('invariant');
@@ -100,7 +100,7 @@ function instantiateReactComponent(node) {
100
101 // Special case string values
102 if (typeof element.type === 'string') {
103 - instance = ReactNativeComponent.createInternalComponent(element);
103 + instance = ReactHostComponent.createInternalComponent(element);
104 } else if (isInternalComponentType(element.type)) {
105 // This is temporarily available for custom components that are not string
106 // representations. I.e. ART. Once those are updated to use the string
@@ -110,7 +110,7 @@ function instantiateReactComponent(node) {
110 instance = new ReactCompositeComponentWrapper(element);
111 }
112 } else if (typeof node === 'string' || typeof node === 'number') {
113 - instance = ReactNativeComponent.createInstanceForText(node);
113 + instance = ReactHostComponent.createInstanceForText(node);
114 } else {
115 invariant(
116 false,
@@ -123,7 +123,7 @@ function instantiateReactComponent(node) {
123 warning(
124 typeof instance.mountComponent === 'function' &&
125 typeof instance.receiveComponent === 'function' &&
126 - typeof instance.getNativeNode === 'function' &&
126 + typeof instance.getHostNode === 'function' &&
127 typeof instance.unmountComponent === 'function',
128 'Only React Components can be mounted.'
129 );
src/shared/utils/ReactNodeTypes.js
+2 -2
@@ -16,7 +16,7 @@ var ReactElement = require('ReactElement');
16 var invariant = require('invariant');
17
18 var ReactNodeTypes = {
19 - NATIVE: 0,
19 + HOST: 0,
20 COMPOSITE: 1,
21 EMPTY: 2,
22
@@ -27,7 +27,7 @@ var ReactNodeTypes = {
27 if (typeof node.type === 'function') {
28 return ReactNodeTypes.COMPOSITE;
29 } else {
30 - return ReactNodeTypes.NATIVE;
30 + return ReactNodeTypes.HOST;
31 }
32 }
33 invariant(false, 'Unexpected node: %s', node);
src/shared/utils/getHostComponentFromComposite.js renamed
+4 -4
@@ -6,25 +6,25 @@
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 getNativeComponentFromComposite
9 + * @providesModule getHostComponentFromComposite
10 */
11
12 'use strict';
13
14 var ReactNodeTypes = require('ReactNodeTypes');
15
16 -function getNativeComponentFromComposite(inst) {
16 +function getHostComponentFromComposite(inst) {
17 var type;
18
19 while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
20 inst = inst._renderedComponent;
21 }
22
23 - if (type === ReactNodeTypes.NATIVE) {
23 + if (type === ReactNodeTypes.HOST) {
24 return inst._renderedComponent;
25 } else if (type === ReactNodeTypes.EMPTY) {
26 return null;
27 }
28 }
29
30 -module.exports = getNativeComponentFromComposite;
30 +module.exports = getHostComponentFromComposite;
src/test/ReactTestUtils.js
+1 -1
@@ -394,7 +394,7 @@ NoopInternalComponent.prototype = {
394 this._currentElement = element;
395 },
396
397 - getNativeNode: function() {
397 + getHostNode: function() {
398 return undefined;
399 },
400