Skip to content

Commit

Permalink
Rename host-y things to be "host" not "native"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sophiebits committed May 12, 2016
1 parent cf15788 commit 784f261
Show file tree
Hide file tree
Showing 48 changed files with 344 additions and 344 deletions.
12 changes: 6 additions & 6 deletions src/isomorphic/ReactDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function resetMeasurements() {

var previousStartTime = currentFlushStartTime;
var previousMeasurements = currentFlushMeasurements || [];
var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
var previousOperations = ReactHostOperationHistoryDevtool.getHistory();

if (previousMeasurements.length || previousOperations.length) {
var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
Expand Down Expand Up @@ -86,7 +86,7 @@ function resetMeasurements() {
currentFlushStartTime = performanceNow();
currentFlushMeasurements = [];
ReactComponentTreeDevtool.purgeUnmountedComponents();
ReactNativeOperationHistoryDevtool.clearHistory();
ReactHostOperationHistoryDevtool.clearHistory();
}
}

Expand Down Expand Up @@ -197,8 +197,8 @@ var ReactDebugTool = {
onEndProcessingChildContext() {
emitEvent('onEndProcessingChildContext');
},
onNativeOperation(debugID, type, payload) {
emitEvent('onNativeOperation', debugID, type, payload);
onHostOperation(debugID, type, payload) {
emitEvent('onHostOperation', debugID, type, payload);
},
onSetState() {
emitEvent('onSetState');
Expand Down Expand Up @@ -234,11 +234,11 @@ var ReactDebugTool = {

if (__DEV__) {
var ReactInvalidSetStateWarningDevTool = require('ReactInvalidSetStateWarningDevTool');
var ReactNativeOperationHistoryDevtool = require('ReactNativeOperationHistoryDevtool');
var ReactHostOperationHistoryDevtool = require('ReactHostOperationHistoryDevtool');
var ReactComponentTreeDevtool = require('ReactComponentTreeDevtool');
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool);
var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
if ((/[?&]react_perf\b/).test(url)) {
ReactDebugTool.beginProfiling();
Expand Down
2 changes: 1 addition & 1 deletion src/isomorphic/ReactPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function getWasted(flushHistory = getFlushHistory()) {
var {measurements, treeSnapshot, operations} = flush;
var isDefinitelyNotWastedByID = {};

// Find native components associated with an operation in this batch.
// Find host components associated with an operation in this batch.
// Mark all components in their parent tree as definitely not wasted.
operations.forEach(operation => {
var {instanceID} = operation;
Expand Down
2 changes: 1 addition & 1 deletion src/isomorphic/classic/class/ReactClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var injectedMixins = [];

/**
* Composite components are higher-level components that compose other composite
* or native components.
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactNativeOperationHistoryDevtool
* @providesModule ReactHostOperationHistoryDevtool
*/

'use strict';

var history = [];

var ReactNativeOperationHistoryDevtool = {
onNativeOperation(debugID, type, payload) {
var ReactHostOperationHistoryDevtool = {
onHostOperation(debugID, type, payload) {
history.push({
instanceID: debugID,
type,
Expand All @@ -31,4 +31,4 @@ var ReactNativeOperationHistoryDevtool = {
},
};

module.exports = ReactNativeOperationHistoryDevtool;
module.exports = ReactHostOperationHistoryDevtool;
28 changes: 14 additions & 14 deletions src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ describe('ReactComponentTreeDevtool', () => {
assertTreeMatches([element, tree]);
});

it('reports a native tree correctly', () => {
it('reports a host tree correctly', () => {
var element = (
<div>
<p>
Expand Down Expand Up @@ -510,7 +510,7 @@ describe('ReactComponentTreeDevtool', () => {
});

describe('update', () => {
describe('native component', () => {
describe('host component', () => {
it('updates text of a single text child', () => {
var elementBefore = <div>Hi.</div>;
var treeBefore = {
Expand Down Expand Up @@ -847,7 +847,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates native nodes when reordering with keys', () => {
it('updates host nodes when reordering with keys', () => {
var elementBefore = (
<div>
<div key="a">Hi.</div>
Expand Down Expand Up @@ -900,7 +900,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates native nodes when reordering without keys', () => {
it('updates host nodes when reordering without keys', () => {
var elementBefore = (
<div>
<div>Hi.</div>
Expand Down Expand Up @@ -1150,7 +1150,7 @@ describe('ReactComponentTreeDevtool', () => {
});

describe('functional component', () => {
it('updates with a native child', () => {
it('updates with a host child', () => {
function Foo({ children }) {
return children;
}
Expand Down Expand Up @@ -1179,7 +1179,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from null to a native child', () => {
it('updates from null to a host child', () => {
function Foo({ children }) {
return children;
}
Expand All @@ -1205,7 +1205,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to null', () => {
it('updates from a host child to null', () => {
function Foo({ children }) {
return children;
}
Expand All @@ -1231,7 +1231,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to a composite child', () => {
it('updates from a host child to a composite child', () => {
function Bar() {
return null;
}
Expand Down Expand Up @@ -1264,7 +1264,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a composite child to a native child', () => {
it('updates from a composite child to a host child', () => {
function Bar() {
return null;
}
Expand Down Expand Up @@ -1359,7 +1359,7 @@ describe('ReactComponentTreeDevtool', () => {
});

describe('class component', () => {
it('updates with a native child', () => {
it('updates with a host child', () => {
var Foo = React.createClass({
render() {
return this.props.children;
Expand Down Expand Up @@ -1390,7 +1390,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from null to a native child', () => {
it('updates from null to a host child', () => {
var Foo = React.createClass({
render() {
return this.props.children;
Expand Down Expand Up @@ -1418,7 +1418,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to null', () => {
it('updates from a host child to null', () => {
var Foo = React.createClass({
render() {
return this.props.children;
Expand Down Expand Up @@ -1446,7 +1446,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to a composite child', () => {
it('updates from a host child to a composite child', () => {
var Bar = React.createClass({
render() {
return null;
Expand Down Expand Up @@ -1483,7 +1483,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a composite child to a native child', () => {
it('updates from a composite child to a host child', () => {
var Bar = React.createClass({
render() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('ReactComponentTreeDevtool', () => {
assertTreeMatches([element, tree]);
});

it('reports a native tree correctly', () => {
it('reports a host tree correctly', () => {
var element = (
<View>
<View>
Expand Down Expand Up @@ -530,7 +530,7 @@ describe('ReactComponentTreeDevtool', () => {
});

describe('update', () => {
describe('native component', () => {
describe('host component', () => {
it('updates text of a single text child', () => {
var elementBefore = <Text>Hi.</Text>;
var treeBefore = {
Expand Down Expand Up @@ -782,7 +782,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates native nodes when reordering with keys', () => {
it('updates host nodes when reordering with keys', () => {
var elementBefore = (
<View>
<Text key="a">Hi.</Text>
Expand Down Expand Up @@ -847,7 +847,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates native nodes when reordering with keys', () => {
it('updates host nodes when reordering with keys', () => {
var elementBefore = (
<View>
<Text>Hi.</Text>
Expand Down Expand Up @@ -1127,7 +1127,7 @@ describe('ReactComponentTreeDevtool', () => {
});

describe('functional component', () => {
it('updates with a native child', () => {
it('updates with a host child', () => {
function Foo({ children }) {
return children;
}
Expand Down Expand Up @@ -1156,7 +1156,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from null to a native child', () => {
it('updates from null to a host child', () => {
function Foo({ children }) {
return children;
}
Expand All @@ -1182,7 +1182,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to null', () => {
it('updates from a host child to null', () => {
function Foo({ children }) {
return children;
}
Expand All @@ -1208,7 +1208,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to a composite child', () => {
it('updates from a host child to a composite child', () => {
function Bar() {
return null;
}
Expand Down Expand Up @@ -1241,7 +1241,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a composite child to a native child', () => {
it('updates from a composite child to a host child', () => {
function Bar() {
return null;
}
Expand Down Expand Up @@ -1336,7 +1336,7 @@ describe('ReactComponentTreeDevtool', () => {
});

describe('class component', () => {
it('updates with a native child', () => {
it('updates with a host child', () => {
var Foo = React.createClass({
render() {
return this.props.children;
Expand Down Expand Up @@ -1367,7 +1367,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from null to a native child', () => {
it('updates from null to a host child', () => {
var Foo = React.createClass({
render() {
return this.props.children;
Expand Down Expand Up @@ -1395,7 +1395,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to null', () => {
it('updates from a host child to null', () => {
var Foo = React.createClass({
render() {
return this.props.children;
Expand Down Expand Up @@ -1423,7 +1423,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a native child to a composite child', () => {
it('updates from a host child to a composite child', () => {
var Bar = React.createClass({
render() {
return null;
Expand Down Expand Up @@ -1460,7 +1460,7 @@ describe('ReactComponentTreeDevtool', () => {
]);
});

it('updates from a composite child to a native child', () => {
it('updates from a composite child to a host child', () => {
var Bar = React.createClass({
render() {
return null;
Expand Down
Loading

0 comments on commit 784f261

Please sign in to comment.