Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rename host-y things to “host” instead of “native” #5

Merged
merged 1 commit into from
May 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ const serialize = require('./utilities/serialize');
*
* This has a very symmetrical relationship to the userland side of creating a
* React Component. There are the additional private methods used by other parts
* of React Core, such as `getPublicInstance` or `getNativeNode`.
* of React Core, such as `getPublicInstance` or
* React <= 15.0 `getNativeNode`
* React > 15.0 `getHostNode`
*/
const MinimumViableComponent = function(element) {
// This internal API—while relatively unchanged for a while—is likely pretty
// volatile. Many of these names began with ReactDOM and ReactART which may
// not be the *best* abstraction for them.

// `this.node` in ReactDOM points to the DOM node of a component.
// `getNativeNode` should return this.
// `getNativeNode`/`getHostNode` should return this.
this.node = null;
// `this._mountImage` is the representation you use to render a ReactElement
// hierarchy. This could be an HTML string, a DOM node, or an identifier or
Expand All @@ -71,7 +73,11 @@ MinimumViableComponent.prototype = Object.assign(
mountComponent() {},
receiveComponent() {},
unmountComponent() {},
getNativeNode() {}
// implement both of these for now. React <= 15.0 uses getNativeNode, but
// that is confusing. Host environment is more accurate and will be used
// going forward
getNativeNode() {},
getHostNode() {}
},
ReactMultiChild.Mixin
);
Expand Down Expand Up @@ -146,7 +152,7 @@ const TinyRendererComponentMixin = {
this.updateChildren(nextElement.props.children, transaction, context);
},
// there is no native node
getNativeNode() {},
getHostNode() {},
// how do you unmount JSON?
unmountComponent() {},
};
Expand Down
8 changes: 4 additions & 4 deletions src/injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* * ReactDOMComponent.js
* * ReactEmptyComponent.js
* * ReactInjection.js
* * ReactNativeComponent.js
* * ReactHostComponent.js
* * ReactPerf.js
* * ReactMount.js
* * ReactServerRendering.js
Expand All @@ -61,7 +61,7 @@
* * EventPluginHub
* * EventPluginUtils
* * EventEmitter
* * NativeComponent
* * HostComponent
* * Perf
* * Updates
*
Expand All @@ -76,7 +76,7 @@ const TinyRendererComponent = require('./component');

function inject() {
// For the Tiny React Renderer only the generic component class will be
// injected. The NativeComponent injection has the following three methods:
// injected. The HostComponent injection has the following three methods:
//
// * injectGenericComponentClass
// * injectTextComponentClass
Expand All @@ -93,7 +93,7 @@ function inject() {
// For example, the following scenario would map `<input />` to the specific
// ReactDOMInput component.
// `injectComponentClasses({input: ReactDOMInput})`
ReactInjection.NativeComponent.injectGenericComponentClass(
(ReactInjection.NativeComponent || ReactInjection.HostComponent).injectGenericComponentClass(
TinyRendererComponent
);

Expand Down