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 de1bb7a commit dc6b80f
Show file tree
Hide file tree
Showing 48 changed files with 358 additions and 358 deletions.
12 changes: 6 additions & 6 deletions src/isomorphic/ReactDebugTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var currentTimerType = null;

function clearHistory() {
ReactComponentTreeDevtool.purgeUnmountedComponents();
ReactNativeOperationHistoryDevtool.clearHistory();
ReactHostOperationHistoryDevtool.clearHistory();
}

function getTreeSnapshot(registeredIDs) {
Expand All @@ -74,7 +74,7 @@ function resetMeasurements() {
if (__DEV__) {
var previousStartTime = currentFlushStartTime;
var previousMeasurements = currentFlushMeasurements || [];
var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
var previousOperations = ReactHostOperationHistoryDevtool.getHistory();

if (!isProfiling || currentFlushNesting === 0) {
currentFlushStartTime = null;
Expand Down Expand Up @@ -214,9 +214,9 @@ var ReactDebugTool = {
onEndProcessingChildContext() {
emitEvent('onEndProcessingChildContext');
},
onNativeOperation(debugID, type, payload) {
onHostOperation(debugID, type, payload) {
checkDebugID(debugID);
emitEvent('onNativeOperation', debugID, type, payload);
emitEvent('onHostOperation', debugID, type, payload);
},
onSetState() {
emitEvent('onSetState');
Expand Down Expand Up @@ -260,11 +260,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 @@ -23,7 +23,7 @@ var ReactNativeOperationHistoryDevtool = {
},

clearHistory() {
if (ReactNativeOperationHistoryDevtool._preventClearing) {
if (ReactHostOperationHistoryDevtool._preventClearing) {
// Should only be used for tests.
return;
}
Expand All @@ -36,4 +36,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 @@ -289,7 +289,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 @@ -532,7 +532,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 @@ -869,7 +869,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 @@ -922,7 +922,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 @@ -1172,7 +1172,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 @@ -1201,7 +1201,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 @@ -1227,7 +1227,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 @@ -1253,7 +1253,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 @@ -1286,7 +1286,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 @@ -1381,7 +1381,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 @@ -1412,7 +1412,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 @@ -1440,7 +1440,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 @@ -1468,7 +1468,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 @@ -1505,7 +1505,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 @@ -300,7 +300,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 @@ -540,7 +540,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 @@ -792,7 +792,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 @@ -857,7 +857,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 @@ -1137,7 +1137,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 @@ -1166,7 +1166,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 @@ -1192,7 +1192,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 @@ -1218,7 +1218,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 @@ -1251,7 +1251,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 @@ -1346,7 +1346,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 @@ -1377,7 +1377,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 @@ -1405,7 +1405,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 @@ -1433,7 +1433,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 @@ -1470,7 +1470,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 dc6b80f

Please sign in to comment.