[ReactNative] Rename ReactIOS JS module (and relatives) to ReactNative.

This commit is contained in:
Krzysztof Magiera 2015-05-08 09:45:43 -07:00 committed by Christopher Chedeau
parent 1db2f07192
commit ff00e1496c
37 changed files with 239 additions and 239 deletions

View File

@ -17,7 +17,7 @@
'use strict';
var React = require('react-native');
var ReactIOS = require('ReactIOS');
var ReactNative = require('ReactNative');
var UIExplorerBlock = require('./UIExplorerBlock');
var UIExplorerPage = require('./UIExplorerPage');
@ -49,15 +49,15 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
// renderComponent to be called.
var originalRender = React.render;
var originalRenderComponent = React.renderComponent;
var originalIOSRender = ReactIOS.render;
var originalIOSRenderComponent = ReactIOS.renderComponent;
var originalIOSRender = ReactNative.render;
var originalIOSRenderComponent = ReactNative.renderComponent;
var renderedComponent;
// TODO remove typecasts when Flow bug #6560135 is fixed
// and workaround is removed from react-native.js
(React: Object).render =
(React: Object).renderComponent =
(ReactIOS: Object).render =
(ReactIOS: Object).renderComponent =
(ReactNative: Object).render =
(ReactNative: Object).renderComponent =
function(element, container) {
renderedComponent = element;
};
@ -67,8 +67,8 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
}
(React: Object).render = originalRender;
(React: Object).renderComponent = originalRenderComponent;
(ReactIOS: Object).render = originalIOSRender;
(ReactIOS: Object).renderComponent = originalIOSRenderComponent;
(ReactNative: Object).render = originalIOSRender;
(ReactNative: Object).renderComponent = originalIOSRenderComponent;
return (
<UIExplorerBlock
key={i}

View File

@ -6,7 +6,7 @@
* 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 ReactIOSART
* @providesModule ReactNativeART
*/
"use strict";
@ -16,9 +16,9 @@ var Path = require('ARTSerializablePath');
var Transform = require('art/core/transform');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var merge = require('merge');
// Diff Helpers
@ -64,7 +64,7 @@ function fontAndLinesDiffer(a, b) {
// Native Attributes
var SurfaceViewAttributes = merge(ReactIOSViewAttributes.UIView, {
var SurfaceViewAttributes = merge(ReactNativeViewAttributes.UIView, {
// This should contain pixel information such as width, height and
// resolution to know what kind of buffer needs to be allocated.
// Currently we rely on UIViews and style to figure that out.
@ -100,22 +100,22 @@ var TextAttributes = merge(RenderableAttributes, {
// Native Components
var NativeSurfaceView = createReactIOSNativeComponentClass({
var NativeSurfaceView = createReactNativeComponentClass({
validAttributes: SurfaceViewAttributes,
uiViewClassName: 'ARTSurfaceView',
});
var NativeGroup = createReactIOSNativeComponentClass({
var NativeGroup = createReactNativeComponentClass({
validAttributes: GroupAttributes,
uiViewClassName: 'ARTGroup',
});
var NativeShape = createReactIOSNativeComponentClass({
var NativeShape = createReactNativeComponentClass({
validAttributes: ShapeAttributes,
uiViewClassName: 'ARTShape',
});
var NativeText = createReactIOSNativeComponentClass({
var NativeText = createReactNativeComponentClass({
validAttributes: TextAttributes,
uiViewClassName: 'ARTText',
});

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactIOSEventEmitter = require('ReactIOSEventEmitter');
var ReactNativeEventEmitter = require('ReactNativeEventEmitter');
// Completely locally implemented - no native hooks.
module.exports = ReactIOSEventEmitter;
module.exports = ReactNativeEventEmitter;

View File

@ -15,10 +15,10 @@ var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var Platform = require('Platform');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var View = require('View');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var deepDiffer = require('deepDiffer');
var insetsDiffer = require('insetsDiffer');
var merge = require('merge');
@ -163,9 +163,9 @@ var MapView = React.createClass({
});
if (Platform.OS === 'android') {
var RCTMap = createReactIOSNativeComponentClass({
var RCTMap = createReactNativeComponentClass({
validAttributes: merge(
ReactIOSViewAttributes.UIView, {
ReactNativeViewAttributes.UIView, {
showsUserLocation: true,
zoomEnabled: true,
rotateEnabled: true,

View File

@ -14,14 +14,14 @@
var EventEmitter = require('EventEmitter');
var Image = require('Image');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var RCTNavigatorManager = require('NativeModules').NavigatorManager;
var StyleSheet = require('StyleSheet');
var StaticContainer = require('StaticContainer.react');
var View = require('View');
var createReactIOSNativeComponentClass =
require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass =
require('createReactNativeComponentClass');
var invariant = require('invariant');
var logError = require('logError');
var merge = require('merge');
@ -35,14 +35,14 @@ function getuid() {
return __uid++;
}
var RCTNavigator = createReactIOSNativeComponentClass({
validAttributes: merge(ReactIOSViewAttributes.UIView, {
var RCTNavigator = createReactNativeComponentClass({
validAttributes: merge(ReactNativeViewAttributes.UIView, {
requestedTopOfStack: true
}),
uiViewClassName: 'RCTNavigator',
});
var RCTNavigatorItem = createReactIOSNativeComponentClass({
var RCTNavigatorItem = createReactNativeComponentClass({
validAttributes: {
// TODO: Remove or fix the attributes that are not fully functional.
// NavigatorIOS does not use them all, because some are problematic

View File

@ -17,7 +17,7 @@ var PointPropType = require('PointPropType');
var RCTScrollView = require('NativeModules').UIManager.RCTScrollView;
var RCTScrollViewConsts = RCTScrollView.Constants;
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var RCTUIManager = require('NativeModules').UIManager;
var ScrollResponder = require('ScrollResponder');
var StyleSheet = require('StyleSheet');
@ -25,7 +25,7 @@ var StyleSheetPropType = require('StyleSheetPropType');
var View = require('View');
var ViewStylePropTypes = require('ViewStylePropTypes');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var deepDiffer = require('deepDiffer');
var flattenStyle = require('flattenStyle');
var insetsDiffer = require('insetsDiffer');
@ -343,7 +343,7 @@ var styles = StyleSheet.create({
});
var validAttributes = {
...ReactIOSViewAttributes.UIView,
...ReactNativeViewAttributes.UIView,
alwaysBounceHorizontal: true,
alwaysBounceVertical: true,
automaticallyAdjustContentInsets: true,
@ -370,11 +370,11 @@ var validAttributes = {
};
if (Platform.OS === 'android') {
var AndroidScrollView = createReactIOSNativeComponentClass({
var AndroidScrollView = createReactNativeComponentClass({
validAttributes: validAttributes,
uiViewClassName: 'RCTScrollView',
});
var AndroidHorizontalScrollView = createReactIOSNativeComponentClass({
var AndroidHorizontalScrollView = createReactNativeComponentClass({
validAttributes: validAttributes,
uiViewClassName: 'AndroidHorizontalScrollView',
});

View File

@ -19,14 +19,14 @@ var Platform = require('Platform');
var PropTypes = require('ReactPropTypes');
var React = require('React');
var ReactChildren = require('ReactChildren');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var Text = require('Text');
var TextInputState = require('TextInputState');
var TimerMixin = require('react-timer-mixin');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var emptyFunction = require('emptyFunction');
var invariant = require('invariant');
var merge = require('merge');
@ -35,7 +35,7 @@ var autoCapitalizeConsts = RCTUIManager.UIText.AutocapitalizationType;
var keyboardTypeConsts = RCTUIManager.UIKeyboardType;
var returnKeyTypeConsts = RCTUIManager.UIReturnKeyType;
var RCTTextViewAttributes = merge(ReactIOSViewAttributes.UIView, {
var RCTTextViewAttributes = merge(ReactNativeViewAttributes.UIView, {
autoCorrect: true,
autoCapitalize: true,
clearTextOnFocus: true,
@ -582,7 +582,7 @@ var TextInput = React.createClass({
var counter = event.nativeEvent.eventCounter;
if (counter > this.state.mostRecentEventCounter) {
this.setState({mostRecentEventCounter: counter});
}
}
},
});
@ -592,17 +592,17 @@ var styles = StyleSheet.create({
},
});
var RCTTextView = createReactIOSNativeComponentClass({
var RCTTextView = createReactNativeComponentClass({
validAttributes: RCTTextViewAttributes,
uiViewClassName: 'RCTTextView',
});
var RCTTextField = createReactIOSNativeComponentClass({
var RCTTextField = createReactNativeComponentClass({
validAttributes: RCTTextFieldAttributes,
uiViewClassName: 'RCTTextField',
});
var AndroidTextInput = createReactIOSNativeComponentClass({
var AndroidTextInput = createReactNativeComponentClass({
validAttributes: AndroidTextInputAttributes,
uiViewClassName: 'AndroidTextInput',
});

View File

@ -14,7 +14,7 @@
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var TimerMixin = require('react-timer-mixin');
var Touchable = require('Touchable');
@ -120,7 +120,7 @@ var TouchableHighlight = React.createClass({
viewConfig: {
uiViewClassName: 'RCTView',
validAttributes: ReactIOSViewAttributes.RCTView
validAttributes: ReactNativeViewAttributes.RCTView
},
/**

View File

@ -15,12 +15,12 @@ var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var RCTUIManager = require('NativeModules').UIManager;
var React = require('React');
var ReactIOSStyleAttributes = require('ReactIOSStyleAttributes');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheetPropType = require('StyleSheetPropType');
var ViewStylePropTypes = require('ViewStylePropTypes');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var stylePropType = StyleSheetPropType(ViewStylePropTypes);
@ -53,7 +53,7 @@ var View = React.createClass({
*/
viewConfig: {
uiViewClassName: 'RCTView',
validAttributes: ReactIOSViewAttributes.RCTView
validAttributes: ReactNativeViewAttributes.RCTView
},
propTypes: {
@ -163,8 +163,8 @@ var View = React.createClass({
},
});
var RCTView = createReactIOSNativeComponentClass({
validAttributes: ReactIOSViewAttributes.RCTView,
var RCTView = createReactNativeComponentClass({
validAttributes: ReactNativeViewAttributes.RCTView,
uiViewClassName: 'RCTView',
});
RCTView.propTypes = View.propTypes;
@ -172,7 +172,7 @@ if (__DEV__) {
var viewConfig = RCTUIManager.viewConfigs && RCTUIManager.viewConfigs.RCTView || {};
for (var prop in viewConfig.nativeProps) {
var viewAny: any = View; // Appease flow
if (!viewAny.propTypes[prop] && !ReactIOSStyleAttributes[prop]) {
if (!viewAny.propTypes[prop] && !ReactNativeStyleAttributes[prop]) {
throw new Error(
'View is missing propType for native prop `' + prop + '`'
);

View File

@ -12,11 +12,11 @@
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var View = require('View');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var keyMirror = require('keyMirror');
var merge = require('merge');
@ -168,8 +168,8 @@ var WebView = React.createClass({
},
});
var RCTWebView = createReactIOSNativeComponentClass({
validAttributes: merge(ReactIOSViewAttributes.UIView, {
var RCTWebView = createReactNativeComponentClass({
validAttributes: merge(ReactNativeViewAttributes.UIView, {
url: true,
javaScriptEnabledAndroid: true,
}),

View File

@ -14,7 +14,7 @@
var ActivityIndicatorIOS = require('ActivityIndicatorIOS');
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var Text = require('Text');
var View = require('View');

View File

@ -18,7 +18,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModules = require('NativeModules');
var PropTypes = require('ReactPropTypes');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
@ -113,7 +113,7 @@ var Image = React.createClass({
*/
viewConfig: {
uiViewClassName: 'UIView',
validAttributes: ReactIOSViewAttributes.UIView
validAttributes: ReactNativeViewAttributes.UIView
},
render: function() {

View File

@ -15,13 +15,13 @@
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactChildren = require('ReactChildren');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var RCTPickerIOSConsts = require('NativeModules').UIManager.RCTPicker.Constants;
var StyleSheet = require('StyleSheet');
var View = require('View');
var createReactIOSNativeComponentClass =
require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass =
require('createReactNativeComponentClass');
var merge = require('merge');
var PICKER = 'picker';
@ -112,12 +112,12 @@ var styles = StyleSheet.create({
},
});
var rkPickerIOSAttributes = merge(ReactIOSViewAttributes.UIView, {
var rkPickerIOSAttributes = merge(ReactNativeViewAttributes.UIView, {
items: true,
selectedIndex: true,
});
var RCTPickerIOS = createReactIOSNativeComponentClass({
var RCTPickerIOS = createReactNativeComponentClass({
validAttributes: rkPickerIOSAttributes,
uiViewClassName: 'RCTPicker',
});

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var RCTUIManager = require('NativeModules').UIManager;
type OnSuccessCallback = (
@ -52,7 +52,7 @@ var queryLayoutByID = function(
): void {
// Native bridge doesn't *yet* surface errors.
RCTUIManager.measure(
ReactIOSTagHandles.rootNodeIDToTag[rootNodeID],
ReactNativeTagHandles.rootNodeIDToTag[rootNodeID],
onSuccess
);
};

View File

@ -14,7 +14,7 @@
var RCTUIManager = require('NativeModules').UIManager;
var UnimplementedView = require('UnimplementedView');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var deepDiffer = require('deepDiffer');
var insetsDiffer = require('insetsDiffer');
var pointsDiffer = require('pointsDiffer');
@ -59,7 +59,7 @@ function requireNativeComponent(
if (__DEV__) {
wrapperComponent && verifyPropTypes(wrapperComponent, viewConfig);
}
return createReactIOSNativeComponentClass(viewConfig);
return createReactNativeComponentClass(viewConfig);
}
var TypeToDifferMap = {

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactIOSStyleAttributes = require('ReactIOSStyleAttributes');
var ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
var View = require('View');
function verifyPropTypes(
@ -26,7 +26,7 @@ function verifyPropTypes(
for (var prop in nativeProps) {
if (!component.propTypes[prop] &&
!View.propTypes[prop] &&
!ReactIOSStyleAttributes[prop] &&
!ReactNativeStyleAttributes[prop] &&
(!nativePropsToIgnore || !nativePropsToIgnore[prop])) {
throw new Error(
'`' + component.displayName + '` has no propType for native prop `' +

View File

@ -12,4 +12,4 @@
"use strict";
module.exports = require('ReactIOS');
module.exports = require('ReactNative');

View File

@ -6,7 +6,7 @@
* 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 ReactIOS
* @providesModule ReactNative
* @flow
*/
"use strict";
@ -19,15 +19,15 @@ var ReactCurrentOwner = require('ReactCurrentOwner');
var ReactElement = require('ReactElement');
var ReactElementValidator = require('ReactElementValidator');
var ReactInstanceHandles = require('ReactInstanceHandles');
var ReactIOSDefaultInjection = require('ReactIOSDefaultInjection');
var ReactIOSMount = require('ReactIOSMount');
var ReactNativeDefaultInjection = require('ReactNativeDefaultInjection');
var ReactNativeMount = require('ReactNativeMount');
var ReactPropTypes = require('ReactPropTypes');
var deprecated = require('deprecated');
var invariant = require('invariant');
var onlyChild = require('onlyChild');
ReactIOSDefaultInjection.inject();
ReactNativeDefaultInjection.inject();
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
@ -72,11 +72,11 @@ var render = function(
mountInto: number,
callback?: ?(() => void)
): ?ReactComponent {
return ReactIOSMount.renderComponent(element, mountInto, callback);
return ReactNativeMount.renderComponent(element, mountInto, callback);
};
var ReactIOS = {
hasReactIOSInitialized: false,
var ReactNative = {
hasReactNativeInitialized: false,
Children: {
map: ReactChildren.map,
forEach: ReactChildren.forEach,
@ -91,12 +91,12 @@ var ReactIOS = {
cloneElement: cloneElement,
_augmentElement: augmentElement,
render: render,
unmountComponentAtNode: ReactIOSMount.unmountComponentAtNode,
unmountComponentAtNode: ReactNativeMount.unmountComponentAtNode,
// Hook for JSX spread, don't use this for anything else.
__spread: Object.assign,
unmountComponentAtNodeAndRemoveContainer: ReactIOSMount.unmountComponentAtNodeAndRemoveContainer,
unmountComponentAtNodeAndRemoveContainer: ReactNativeMount.unmountComponentAtNodeAndRemoveContainer,
isValidClass: ReactElement.isValidFactory,
isValidElement: ReactElement.isValidElement,
@ -126,10 +126,10 @@ if (
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
CurrentOwner: ReactCurrentOwner,
InstanceHandles: ReactInstanceHandles,
Mount: ReactIOSMount,
Mount: ReactNativeMount,
Reconciler: require('ReactReconciler'),
TextComponent: require('ReactIOSTextComponent'),
TextComponent: require('ReactNativeTextComponent'),
});
}
module.exports = ReactIOS;
module.exports = ReactNative;

View File

@ -6,19 +6,19 @@
* 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 ReactIOSComponentEnvironment
* @providesModule ReactNativeComponentEnvironment
* @flow
*/
'use strict';
var ReactIOSDOMIDOperations = require('ReactIOSDOMIDOperations');
var ReactIOSReconcileTransaction = require('ReactIOSReconcileTransaction');
var ReactNativeDOMIDOperations = require('ReactNativeDOMIDOperations');
var ReactNativeReconcileTransaction = require('ReactNativeReconcileTransaction');
var ReactIOSComponentEnvironment = {
var ReactNativeComponentEnvironment = {
processChildrenUpdates: ReactIOSDOMIDOperations.dangerouslyProcessChildrenUpdates,
processChildrenUpdates: ReactNativeDOMIDOperations.dangerouslyProcessChildrenUpdates,
replaceNodeWithMarkupByID: ReactIOSDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
replaceNodeWithMarkupByID: ReactNativeDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
/**
* Nothing to do for UIKit bridge.
@ -36,7 +36,7 @@ var ReactIOSComponentEnvironment = {
},
ReactReconcileTransaction: ReactIOSReconcileTransaction,
ReactReconcileTransaction: ReactNativeReconcileTransaction,
};
module.exports = ReactIOSComponentEnvironment;
module.exports = ReactNativeComponentEnvironment;

View File

@ -6,12 +6,12 @@
* 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 ReactIOSComponentMixin
* @providesModule ReactNativeComponentMixin
* @flow
*/
'use strict';
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var ReactInstanceMap = require('ReactInstanceMap');
/**
@ -23,7 +23,7 @@ var ReactInstanceMap = require('ReactInstanceMap');
* making assumptions about the nature of those resources, and this allows that
* infra to be shared across multiple platforms, where the resources are very
* different. General infra (such as `ReactMultiChild`) reasons opaquely about
* the data, but platform specific code (such as `ReactIOSNativeComponent`) can
* the data, but platform specific code (such as `ReactNativeBaseComponent`) can
* make assumptions about the data.
*
*
@ -54,9 +54,9 @@ var ReactInstanceMap = require('ReactInstanceMap');
* mountImage innerHTML innerHTML {rootNodeID, tag}
*
*/
var ReactIOSComponentMixin = {
var ReactNativeComponentMixin = {
/**
* This has no particular meaning in ReactIOS. If this were in the DOM, this
* This has no particular meaning in ReactNative. If this were in the DOM, this
* would return the DOM node. There should be nothing that invokes this
* method. Any current callers of this are mistaken - they should be invoking
* `getNodeHandle`.
@ -64,16 +64,16 @@ var ReactIOSComponentMixin = {
getNativeNode: function() {
// TODO (balpert): Wrap iOS native components in a composite wrapper, then
// ReactInstanceMap.get here will always succeed
return ReactIOSTagHandles.rootNodeIDToTag[
return ReactNativeTagHandles.rootNodeIDToTag[
(ReactInstanceMap.get(this) || this)._rootNodeID
];
},
getNodeHandle: function() {
return ReactIOSTagHandles.rootNodeIDToTag[
return ReactNativeTagHandles.rootNodeIDToTag[
(ReactInstanceMap.get(this) || this)._rootNodeID
];
}
};
module.exports = ReactIOSComponentMixin;
module.exports = ReactNativeComponentMixin;

View File

@ -6,13 +6,13 @@
* 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 ReactIOSDOMIDOperations
* @providesModule ReactNativeDOMIDOperations
* @flow
*/
"use strict";
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var ReactMultiChildUpdateTypes = require('ReactMultiChildUpdateTypes');
var RCTUIManager = require('NativeModules').UIManager;
var ReactPerf = require('ReactPerf');
@ -38,7 +38,7 @@ var dangerouslyProcessChildrenUpdates = function(childrenUpdates, markupList) {
// containerID.
for (var i = 0; i < childrenUpdates.length; i++) {
var update = childrenUpdates[i];
var containerTag = ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(update.parentID);
var containerTag = ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(update.parentID);
var updates = byContainerTag[containerTag] || (byContainerTag[containerTag] = {});
if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING) {
(updates.moveFromIndices || (updates.moveFromIndices = [])).push(update.fromIndex);
@ -49,7 +49,7 @@ var dangerouslyProcessChildrenUpdates = function(childrenUpdates, markupList) {
var mountImage = markupList[update.markupIndex];
var tag = mountImage.tag;
var rootNodeID = mountImage.rootNodeID;
ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle(rootNodeID, tag);
ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle(rootNodeID, tag);
(updates.addAtIndices || (updates.addAtIndices = [])).push(update.toIndex);
(updates.addChildTags || (updates.addChildTags = [])).push(tag);
}
@ -75,7 +75,7 @@ var dangerouslyProcessChildrenUpdates = function(childrenUpdates, markupList) {
* Operations used to process updates to DOM nodes. This is made injectable via
* `ReactComponent.DOMIDOperations`.
*/
var ReactIOSDOMIDOperations = {
var ReactNativeDOMIDOperations = {
dangerouslyProcessChildrenUpdates: ReactPerf.measure(
// FIXME(frantic): #4441289 Hack to avoid modifying react-tools
'ReactDOMIDOperations',
@ -93,11 +93,11 @@ var ReactIOSDOMIDOperations = {
'ReactDOMIDOperations',
'dangerouslyReplaceNodeWithMarkupByID',
function(id, mountImage) {
var oldTag = ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(id);
var oldTag = ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(id);
RCTUIManager.replaceExistingNonRootView(oldTag, mountImage.tag);
ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle(id, mountImage.tag);
ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle(id, mountImage.tag);
}
),
};
module.exports = ReactIOSDOMIDOperations;
module.exports = ReactNativeDOMIDOperations;

View File

@ -6,7 +6,7 @@
* 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 ReactIOSDefaultInjection
* @providesModule ReactNativeDefaultInjection
* @flow
*/
@ -26,18 +26,18 @@ var ReactComponentEnvironment = require('ReactComponentEnvironment');
var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
var ReactEmptyComponent = require('ReactEmptyComponent');
var ReactInstanceHandles = require('ReactInstanceHandles');
var ReactIOSComponentEnvironment = require('ReactIOSComponentEnvironment');
var ReactIOSComponentMixin = require('ReactIOSComponentMixin');
var ReactIOSGlobalInteractionHandler = require('ReactIOSGlobalInteractionHandler');
var ReactIOSGlobalResponderHandler = require('ReactIOSGlobalResponderHandler');
var ReactIOSMount = require('ReactIOSMount');
var ReactIOSTextComponent = require('ReactIOSTextComponent');
var ReactNativeComponentEnvironment = require('ReactNativeComponentEnvironment');
var ReactNativeComponentMixin = require('ReactNativeComponentMixin');
var ReactNativeGlobalInteractionHandler = require('ReactNativeGlobalInteractionHandler');
var ReactNativeGlobalResponderHandler = require('ReactNativeGlobalResponderHandler');
var ReactNativeMount = require('ReactNativeMount');
var ReactNativeTextComponent = require('ReactNativeTextComponent');
var ReactNativeComponent = require('ReactNativeComponent');
var ReactUpdates = require('ReactUpdates');
var ResponderEventPlugin = require('ResponderEventPlugin');
var UniversalWorkerNodeHandle = require('UniversalWorkerNodeHandle');
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var invariant = require('invariant');
// Just to ensure this gets packaged, since its only caller is from Native.
@ -53,11 +53,11 @@ function inject() {
EventPluginHub.injection.injectInstanceHandle(ReactInstanceHandles);
ResponderEventPlugin.injection.injectGlobalResponderHandler(
ReactIOSGlobalResponderHandler
ReactNativeGlobalResponderHandler
);
ResponderEventPlugin.injection.injectGlobalInteractionHandler(
ReactIOSGlobalInteractionHandler
ReactNativeGlobalInteractionHandler
);
/**
@ -70,7 +70,7 @@ function inject() {
});
ReactUpdates.injection.injectReconcileTransaction(
ReactIOSComponentEnvironment.ReactReconcileTransaction
ReactNativeComponentEnvironment.ReactReconcileTransaction
);
ReactUpdates.injection.injectBatchingStrategy(
@ -78,22 +78,22 @@ function inject() {
);
ReactComponentEnvironment.injection.injectEnvironment(
ReactIOSComponentEnvironment
ReactNativeComponentEnvironment
);
// Can't import View here because it depends on React to make its composite
var RCTView = createReactIOSNativeComponentClass({
var RCTView = createReactNativeComponentClass({
validAttributes: {},
uiViewClassName: 'RCTView',
});
ReactEmptyComponent.injection.injectEmptyComponent(RCTView);
EventPluginUtils.injection.injectMount(ReactIOSMount);
EventPluginUtils.injection.injectMount(ReactNativeMount);
ReactClass.injection.injectMixin(ReactIOSComponentMixin);
ReactClass.injection.injectMixin(ReactNativeComponentMixin);
ReactNativeComponent.injection.injectTextComponentClass(
ReactIOSTextComponent
ReactNativeTextComponent
);
ReactNativeComponent.injection.injectAutoWrapper(function(tag) {
// Show a nicer error message for non-function tags

View File

@ -6,7 +6,7 @@
* 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 ReactIOSEventEmitter
* @providesModule ReactNativeEventEmitter
* @flow
*/
@ -14,7 +14,7 @@
var EventPluginHub = require('EventPluginHub');
var ReactEventEmitterMixin = require('ReactEventEmitterMixin');
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var NodeHandle = require('NodeHandle');
var EventConstants = require('EventConstants');
@ -82,15 +82,15 @@ var removeTouchesAtIndices = function(
};
/**
* `ReactIOSEventEmitter` is used to attach top-level event listeners. For example:
* `ReactNativeEventEmitter` is used to attach top-level event listeners. For example:
*
* ReactIOSEventEmitter.putListener('myID', 'onClick', myFunction);
* ReactNativeEventEmitter.putListener('myID', 'onClick', myFunction);
*
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
*
* @internal
*/
var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
var ReactNativeEventEmitter = merge(ReactEventEmitterMixin, {
registrationNames: EventPluginHub.registrationNameModules,
@ -118,7 +118,7 @@ var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
nativeEventParam: Object
) {
var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT;
ReactIOSEventEmitter.handleTopLevel(
ReactNativeEventEmitter.handleTopLevel(
topLevelType,
rootNodeID,
rootNodeID,
@ -138,8 +138,8 @@ var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
topLevelType: string,
nativeEventParam: Object
) {
var rootNodeID = ReactIOSTagHandles.tagToRootNodeID[tag];
ReactIOSEventEmitter._receiveRootNodeIDEvent(
var rootNodeID = ReactNativeTagHandles.tagToRootNodeID[tag];
ReactNativeEventEmitter._receiveRootNodeIDEvent(
rootNodeID,
topLevelType,
nativeEventParam
@ -191,7 +191,7 @@ var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
var rootNodeID = null;
var target = nativeEvent.target;
if (target !== null && target !== undefined) {
if (target < ReactIOSTagHandles.tagsStartAt) {
if (target < ReactNativeTagHandles.tagsStartAt) {
if (__DEV__) {
warning(
false,
@ -202,7 +202,7 @@ var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
rootNodeID = NodeHandle.getRootNodeID(target);
}
}
ReactIOSEventEmitter._receiveRootNodeIDEvent(
ReactNativeEventEmitter._receiveRootNodeIDEvent(
rootNodeID,
eventTopLevelType,
nativeEvent
@ -211,4 +211,4 @@ var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
}
});
module.exports = ReactIOSEventEmitter;
module.exports = ReactNativeEventEmitter;

View File

@ -6,7 +6,7 @@
* 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 ReactIOSGlobalInteractionHandler
* @providesModule ReactNativeGlobalInteractionHandler
* @flow
*/
'use strict';
@ -17,7 +17,7 @@ var InteractionManager = require('InteractionManager');
// released/terminated.
var interactionHandle = null;
var ReactIOSGlobalInteractionHandler = {
var ReactNativeGlobalInteractionHandler = {
onChange: function(numberActiveTouches: number) {
if (numberActiveTouches === 0) {
if (interactionHandle) {
@ -30,4 +30,4 @@ var ReactIOSGlobalInteractionHandler = {
}
};
module.exports = ReactIOSGlobalInteractionHandler;
module.exports = ReactNativeGlobalInteractionHandler;

View File

@ -6,19 +6,19 @@
* 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 ReactIOSGlobalResponderHandler
* @providesModule ReactNativeGlobalResponderHandler
* @flow
*/
'use strict';
var RCTUIManager = require('NativeModules').UIManager;
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var ReactIOSGlobalResponderHandler = {
var ReactNativeGlobalResponderHandler = {
onChange: function(from: string, to: string) {
if (to !== null) {
RCTUIManager.setJSResponder(
ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(to)
ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(to)
);
} else {
RCTUIManager.clearJSResponder();
@ -26,4 +26,4 @@ var ReactIOSGlobalResponderHandler = {
}
};
module.exports = ReactIOSGlobalResponderHandler;
module.exports = ReactNativeGlobalResponderHandler;

View File

@ -6,14 +6,14 @@
* 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 ReactIOSMount
* @providesModule ReactNativeMount
* @flow
*/
'use strict';
var RCTUIManager = require('NativeModules').UIManager;
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var ReactPerf = require('ReactPerf');
var ReactReconciler = require('ReactReconciler');
var ReactUpdateQueue = require('ReactUpdateQueue');
@ -45,7 +45,7 @@ function mountComponentIntoNode(
componentInstance, rootID, transaction, emptyObject
);
componentInstance._isTopLevel = true;
ReactIOSMount._mountImageIntoNode(markup, container);
ReactNativeMount._mountImageIntoNode(markup, container);
}
/**
@ -75,7 +75,7 @@ function batchedMountComponentIntoNode(
* As soon as `ReactMount` is refactored to not rely on the DOM, we can share
* code between the two. For now, we'll hard code the ID logic.
*/
var ReactIOSMount = {
var ReactNativeMount = {
instanceCount: 0,
_instancesByContainerID: {},
@ -89,9 +89,9 @@ var ReactIOSMount = {
containerTag: number,
callback?: ?(() => void)
): ?ReactComponent {
var topRootNodeID = ReactIOSTagHandles.tagToRootNodeID[containerTag];
var topRootNodeID = ReactNativeTagHandles.tagToRootNodeID[containerTag];
if (topRootNodeID) {
var prevComponent = ReactIOSMount._instancesByContainerID[topRootNodeID];
var prevComponent = ReactNativeMount._instancesByContainerID[topRootNodeID];
if (prevComponent) {
var prevElement = prevComponent._currentElement;
if (shouldUpdateReactComponent(prevElement, nextElement)) {
@ -101,28 +101,28 @@ var ReactIOSMount = {
}
return prevComponent;
} else {
ReactIOSMount.unmountComponentAtNode(containerTag);
ReactNativeMount.unmountComponentAtNode(containerTag);
}
}
}
if (!ReactIOSTagHandles.reactTagIsNativeTopRootID(containerTag)) {
if (!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)) {
console.error('You cannot render into anything but a top root');
return;
}
var topRootNodeID = ReactIOSTagHandles.allocateRootNodeIDForTag(containerTag);
ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle(
var topRootNodeID = ReactNativeTagHandles.allocateRootNodeIDForTag(containerTag);
ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle(
topRootNodeID,
containerTag
);
var instance = instantiateReactComponent(nextElement);
ReactIOSMount._instancesByContainerID[topRootNodeID] = instance;
ReactNativeMount._instancesByContainerID[topRootNodeID] = instance;
var childRootNodeID = instanceNumberToChildRootID(
topRootNodeID,
ReactIOSMount.instanceCount++
ReactNativeMount.instanceCount++
);
// The initial render is synchronous but any updates that happen during
@ -153,14 +153,14 @@ var ReactIOSMount = {
function(mountImage, containerID) {
// Since we now know that the `mountImage` has been mounted, we can
// mark it as such.
ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle(
ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle(
mountImage.rootNodeID,
mountImage.tag
);
var addChildTags = [mountImage.tag];
var addAtIndices = [0];
RCTUIManager.manageChildren(
ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID),
ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID),
null, // moveFromIndices
null, // moveToIndices
addChildTags,
@ -181,7 +181,7 @@ var ReactIOSMount = {
unmountComponentAtNodeAndRemoveContainer: function(
containerTag: number
) {
ReactIOSMount.unmountComponentAtNode(containerTag);
ReactNativeMount.unmountComponentAtNode(containerTag);
// call back into native to remove all of the subviews from this container
RCTUIManager.removeRootView(containerTag);
},
@ -192,18 +192,18 @@ var ReactIOSMount = {
* component at this time.
*/
unmountComponentAtNode: function(containerTag: number): boolean {
if (!ReactIOSTagHandles.reactTagIsNativeTopRootID(containerTag)) {
if (!ReactNativeTagHandles.reactTagIsNativeTopRootID(containerTag)) {
console.error('You cannot render into anything but a top root');
return false;
}
var containerID = ReactIOSTagHandles.tagToRootNodeID[containerTag];
var instance = ReactIOSMount._instancesByContainerID[containerID];
var containerID = ReactNativeTagHandles.tagToRootNodeID[containerTag];
var instance = ReactNativeMount._instancesByContainerID[containerID];
if (!instance) {
return false;
}
ReactIOSMount.unmountComponentFromNode(instance, containerID);
delete ReactIOSMount._instancesByContainerID[containerID];
ReactNativeMount.unmountComponentFromNode(instance, containerID);
delete ReactNativeMount._instancesByContainerID[containerID];
return true;
},
@ -214,7 +214,7 @@ var ReactIOSMount = {
* @param {string} containerID ID of container we're removing from.
* @final
* @internal
* @see {ReactIOSMount.unmountComponentAtNode}
* @see {ReactNativeMount.unmountComponentAtNode}
*/
unmountComponentFromNode: function(
instance: ReactComponent,
@ -223,7 +223,7 @@ var ReactIOSMount = {
// Call back into native to remove all of the subviews from this container
ReactReconciler.unmountComponent(instance);
var containerTag =
ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID);
ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID);
RCTUIManager.removeSubviewsFromContainerWithID(containerTag);
},
@ -232,10 +232,10 @@ var ReactIOSMount = {
}
};
ReactIOSMount.renderComponent = ReactPerf.measure(
ReactNativeMount.renderComponent = ReactPerf.measure(
'ReactMount',
'_renderNewRootComponent',
ReactIOSMount.renderComponent
ReactNativeMount.renderComponent
);
module.exports = ReactIOSMount;
module.exports = ReactNativeMount;

View File

@ -6,16 +6,16 @@
* 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 ReactIOSNativeComponent
* @providesModule ReactNativeBaseComponent
* @flow
*/
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var ReactIOSComponentMixin = require('ReactIOSComponentMixin');
var ReactIOSEventEmitter = require('ReactIOSEventEmitter');
var ReactIOSStyleAttributes = require('ReactIOSStyleAttributes');
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeComponentMixin = require('ReactNativeComponentMixin');
var ReactNativeEventEmitter = require('ReactNativeEventEmitter');
var ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var ReactMultiChild = require('ReactMultiChild');
var RCTUIManager = require('NativeModules').UIManager;
@ -26,23 +26,23 @@ var flattenStyle = require('flattenStyle');
var precomputeStyle = require('precomputeStyle');
var warning = require('warning');
var registrationNames = ReactIOSEventEmitter.registrationNames;
var putListener = ReactIOSEventEmitter.putListener;
var deleteAllListeners = ReactIOSEventEmitter.deleteAllListeners;
var registrationNames = ReactNativeEventEmitter.registrationNames;
var putListener = ReactNativeEventEmitter.putListener;
var deleteAllListeners = ReactNativeEventEmitter.deleteAllListeners;
type ReactIOSNativeComponentViewConfig = {
type ReactNativeBaseComponentViewConfig = {
validAttributes: Object;
uiViewClassName: string;
}
/**
* @constructor ReactIOSNativeComponent
* @constructor ReactNativeBaseComponent
* @extends ReactComponent
* @extends ReactMultiChild
* @param {!object} UIKit View Configuration.
*/
var ReactIOSNativeComponent = function(
viewConfig: ReactIOSNativeComponentViewConfig
var ReactNativeBaseComponent = function(
viewConfig: ReactNativeBaseComponentViewConfig
) {
this.viewConfig = viewConfig;
};
@ -75,7 +75,7 @@ cachedIndexArray._cache = {};
* Mixin for containers that contain UIViews. NOTE: markup is rendered markup
* which is a `viewID` ... see the return value for `mountComponent` !
*/
ReactIOSNativeComponent.Mixin = {
ReactNativeBaseComponent.Mixin = {
getPublicInstance: function() {
// TODO: This should probably use a composite wrapper
return this;
@ -97,7 +97,7 @@ ReactIOSNativeComponent.Mixin = {
* recording the fact that its own `rootNodeID` is associated with a
* `nodeHandle`. Only the code that actually adds its `nodeHandle` (`tag`) as
* a child of a container can confidently record that in
* `ReactIOSTagHandles`.
* `ReactNativeTagHandles`.
*/
initializeChildren: function(children, containerTag, transaction, context) {
var mountImages = this.mountChildren(children, transaction, context);
@ -117,7 +117,7 @@ ReactIOSNativeComponent.Mixin = {
mountImage && mountImage.rootNodeID && mountImage.tag,
'Mount image returned does not have required data'
);
ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle(
ReactNativeTagHandles.associateRootNodeIDWithMountedNodeHandle(
childID,
childTag
);
@ -166,7 +166,7 @@ ReactIOSNativeComponent.Mixin = {
updatePayload,
this.previousFlattenedStyle,
nextFlattenedStyle,
ReactIOSStyleAttributes
ReactNativeStyleAttributes
);
this.previousFlattenedStyle = nextFlattenedStyle;
}
@ -195,7 +195,7 @@ ReactIOSNativeComponent.Mixin = {
if (updatePayload) {
RCTUIManager.updateView(
ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(this._rootNodeID),
ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(this._rootNodeID),
this.viewConfig.uiViewClassName,
updatePayload
);
@ -243,7 +243,7 @@ ReactIOSNativeComponent.Mixin = {
mountComponent: function(rootID, transaction, context) {
this._rootNodeID = rootID;
var tag = ReactIOSTagHandles.allocateTag();
var tag = ReactNativeTagHandles.allocateTag();
this.previousFlattenedStyle = {};
var updatePayload = this.computeUpdatedProperties(
@ -268,15 +268,15 @@ ReactIOSNativeComponent.Mixin = {
};
/**
* Order of mixins is important. ReactIOSNativeComponent overrides methods in
* Order of mixins is important. ReactNativeBaseComponent overrides methods in
* ReactMultiChild.
*/
Object.assign(
ReactIOSNativeComponent.prototype,
ReactNativeBaseComponent.prototype,
ReactMultiChild.Mixin,
ReactIOSNativeComponent.Mixin,
ReactNativeBaseComponent.Mixin,
NativeMethodsMixin,
ReactIOSComponentMixin
ReactNativeComponentMixin
);
module.exports = ReactIOSNativeComponent;
module.exports = ReactNativeBaseComponent;

View File

@ -6,7 +6,7 @@
* 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 ReactIOSReconcileTransaction
* @providesModule ReactNativeReconcileTransaction
* @flow
*/
@ -55,9 +55,9 @@ var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
* - Implement/integrate with customized constraint based layout system and keep
* track of which dimensions must be remeasured.
*
* @class ReactIOSReconcileTransaction
* @class ReactNativeReconcileTransaction
*/
function ReactIOSReconcileTransaction() {
function ReactNativeReconcileTransaction() {
this.reinitializeTransaction();
this.reactMountReady = CallbackQueue.getPooled(null);
}
@ -93,12 +93,12 @@ var Mixin = {
};
Object.assign(
ReactIOSReconcileTransaction.prototype,
ReactNativeReconcileTransaction.prototype,
Transaction.Mixin,
ReactIOSReconcileTransaction,
ReactNativeReconcileTransaction,
Mixin
);
PooledClass.addPoolingTo(ReactIOSReconcileTransaction);
PooledClass.addPoolingTo(ReactNativeReconcileTransaction);
module.exports = ReactIOSReconcileTransaction;
module.exports = ReactNativeReconcileTransaction;

View File

@ -6,7 +6,7 @@
* 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 ReactIOSStyleAttributes
* @providesModule ReactNativeStyleAttributes
* @flow
*/
@ -20,13 +20,13 @@ var keyMirror = require('keyMirror');
var matricesDiffer = require('matricesDiffer');
var sizesDiffer = require('sizesDiffer');
var ReactIOSStyleAttributes = {
var ReactNativeStyleAttributes = {
...keyMirror(ViewStylePropTypes),
...keyMirror(TextStylePropTypes),
...keyMirror(ImageStylePropTypes),
};
ReactIOSStyleAttributes.transformMatrix = { diff: matricesDiffer };
ReactIOSStyleAttributes.shadowOffset = { diff: sizesDiffer };
ReactNativeStyleAttributes.transformMatrix = { diff: matricesDiffer };
ReactNativeStyleAttributes.shadowOffset = { diff: sizesDiffer };
module.exports = ReactIOSStyleAttributes;
module.exports = ReactNativeStyleAttributes;

View File

@ -6,7 +6,7 @@
* 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 ReactIOSTagHandles
* @providesModule ReactNativeTagHandles
* @flow
*/
'use strict';
@ -28,17 +28,17 @@ var warning = require('warning');
* unmount a component with a `rootNodeID`, then mount a new one in its place,
*/
var INITIAL_TAG_COUNT = 1;
var ReactIOSTagHandles = {
var ReactNativeTagHandles = {
tagsStartAt: INITIAL_TAG_COUNT,
tagCount: INITIAL_TAG_COUNT,
allocateTag: function(): number {
// Skip over root IDs as those are reserved for native
while (this.reactTagIsNativeTopRootID(ReactIOSTagHandles.tagCount)) {
ReactIOSTagHandles.tagCount++;
while (this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount)) {
ReactNativeTagHandles.tagCount++;
}
var tag = ReactIOSTagHandles.tagCount;
ReactIOSTagHandles.tagCount++;
var tag = ReactNativeTagHandles.tagCount;
ReactNativeTagHandles.tagCount++;
return tag;
},
@ -57,8 +57,8 @@ var ReactIOSTagHandles = {
) {
warning(rootNodeID && tag, 'Root node or tag is null when associating');
if (rootNodeID && tag) {
ReactIOSTagHandles.tagToRootNodeID[tag] = rootNodeID;
ReactIOSTagHandles.rootNodeIDToTag[rootNodeID] = tag;
ReactNativeTagHandles.tagToRootNodeID[tag] = rootNodeID;
ReactNativeTagHandles.rootNodeIDToTag[rootNodeID] = tag;
}
},
@ -90,7 +90,7 @@ var ReactIOSTagHandles = {
mostRecentMountedNodeHandleForRootNodeID: function(
rootNodeID: string
): number {
return ReactIOSTagHandles.rootNodeIDToTag[rootNodeID];
return ReactNativeTagHandles.rootNodeIDToTag[rootNodeID];
},
tagToRootNodeID: ([] : Array<string>),
@ -98,4 +98,4 @@ var ReactIOSTagHandles = {
rootNodeIDToTag: ({} : {[key: string]: number})
};
module.exports = ReactIOSTagHandles;
module.exports = ReactNativeTagHandles;

View File

@ -6,21 +6,21 @@
* 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 ReactIOSTextComponent
* @providesModule ReactNativeTextComponent
*/
'use strict';
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var RCTUIManager = require('NativeModules').UIManager;
var assign = require('Object.assign');
var ReactIOSTextComponent = function(props) {
var ReactNativeTextComponent = function(props) {
// This constructor and its argument is currently used by mocks.
};
assign(ReactIOSTextComponent.prototype, {
assign(ReactNativeTextComponent.prototype, {
construct: function(text) {
// This is really a ReactText (ReactNode), not a ReactElement
@ -31,7 +31,7 @@ assign(ReactIOSTextComponent.prototype, {
mountComponent: function(rootID, transaction, context) {
this._rootNodeID = rootID;
var tag = ReactIOSTagHandles.allocateTag();
var tag = ReactNativeTagHandles.allocateTag();
RCTUIManager.createView(tag, 'RCTRawText', {text: this._stringText});
return {
rootNodeID: rootID,
@ -46,7 +46,7 @@ assign(ReactIOSTextComponent.prototype, {
if (nextStringText !== this._stringText) {
this._stringText = nextStringText;
RCTUIManager.updateView(
ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(
ReactNativeTagHandles.mostRecentMountedNodeHandleForRootNodeID(
this._rootNodeID
),
'RCTRawText',
@ -64,4 +64,4 @@ assign(ReactIOSTextComponent.prototype, {
});
module.exports = ReactIOSTextComponent;
module.exports = ReactNativeTextComponent;

View File

@ -6,16 +6,16 @@
* 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 ReactIOSViewAttributes
* @providesModule ReactNativeViewAttributes
* @flow
*/
'use strict';
var merge = require('merge');
var ReactIOSViewAttributes = {};
var ReactNativeViewAttributes = {};
ReactIOSViewAttributes.UIView = {
ReactNativeViewAttributes.UIView = {
pointerEvents: true,
accessible: true,
accessibilityLabel: true,
@ -23,8 +23,8 @@ ReactIOSViewAttributes.UIView = {
onLayout: true,
};
ReactIOSViewAttributes.RCTView = merge(
ReactIOSViewAttributes.UIView, {
ReactNativeViewAttributes.RCTView = merge(
ReactNativeViewAttributes.UIView, {
// This is a special performance property exposed by RCTView and useful for
// scrolling content when there are many subviews, most of which are offscreen.
@ -34,4 +34,4 @@ ReactIOSViewAttributes.RCTView = merge(
removeClippedSubviews: true,
});
module.exports = ReactIOSViewAttributes;
module.exports = ReactNativeViewAttributes;

View File

@ -6,17 +6,17 @@
* 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 createReactIOSNativeComponentClass
* @providesModule createReactNativeComponentClass
* @flow
*/
"use strict";
var ReactElement = require('ReactElement');
var ReactIOSNativeComponent = require('ReactIOSNativeComponent');
var ReactNativeBaseComponent = require('ReactNativeBaseComponent');
// See also ReactIOSNativeComponent
type ReactIOSNativeComponentViewConfig = {
// See also ReactNativeBaseComponent
type ReactNativeBaseComponentViewConfig = {
validAttributes: Object;
uiViewClassName: string;
}
@ -25,8 +25,8 @@ type ReactIOSNativeComponentViewConfig = {
* @param {string} config iOS View configuration.
* @private
*/
var createReactIOSNativeComponentClass = function(
viewConfig: ReactIOSNativeComponentViewConfig
var createReactNativeComponentClass = function(
viewConfig: ReactNativeBaseComponentViewConfig
): Function { // returning Function is lossy :/
var Constructor = function(element) {
this._currentElement = element;
@ -36,9 +36,9 @@ var createReactIOSNativeComponentClass = function(
this.previousFlattenedStyle = null;
};
Constructor.displayName = viewConfig.uiViewClassName;
Constructor.prototype = new ReactIOSNativeComponent(viewConfig);
Constructor.prototype = new ReactNativeBaseComponent(viewConfig);
return Constructor;
};
module.exports = createReactIOSNativeComponentClass;
module.exports = createReactNativeComponentClass;

View File

@ -13,19 +13,19 @@
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheetPropType = require('StyleSheetPropType');
var TextStylePropTypes = require('TextStylePropTypes');
var Touchable = require('Touchable');
var createReactIOSNativeComponentClass =
require('createReactIOSNativeComponentClass');
var createReactNativeComponentClass =
require('createReactNativeComponentClass');
var merge = require('merge');
var stylePropType = StyleSheetPropType(TextStylePropTypes);
var viewConfig = {
validAttributes: merge(ReactIOSViewAttributes.UIView, {
validAttributes: merge(ReactNativeViewAttributes.UIView, {
isHighlighted: true,
numberOfLines: true,
}),
@ -202,6 +202,6 @@ type RectOffset = {
var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
var RCTText = createReactIOSNativeComponentClass(viewConfig);
var RCTText = createReactNativeComponentClass(viewConfig);
module.exports = Text;

View File

@ -183,7 +183,7 @@ var PanResponder = {
* changes* in the centroid of recently moved touches.
*
* There is also some nuance with how we handle multiple moved touches in a
* single event. With the way `ReactIOSEventEmitter` dispatches touches as
* single event. With the way `ReactNativeEventEmitter` dispatches touches as
* individual events, multiple touches generate two 'move' events, each of
* them triggering `onResponderMove`. But with the way `PanResponder` works,
* all of the gesture inference is performed on the first dispatch, since it

View File

@ -2,7 +2,7 @@
* @providesModule UniversalWorkerNodeHandle
*/
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
var invariant = require('invariant');
@ -12,7 +12,7 @@ var UniversalWorkerNodeHandle = {
nodeHandle !== undefined && nodeHandle !== null && nodeHandle !== 0,
'No node handle defined'
);
return ReactIOSTagHandles.tagToRootNodeID[nodeHandle];
return ReactNativeTagHandles.tagToRootNodeID[nodeHandle];
}
};

View File

@ -96,7 +96,7 @@
}
RCT_IMPORT_METHOD(AppRegistry, runApplication)
RCT_IMPORT_METHOD(ReactIOS, unmountComponentAtNodeAndRemoveContainer)
RCT_IMPORT_METHOD(ReactNative, unmountComponentAtNodeAndRemoveContainer)
- (void)javaScriptDidLoad:(NSNotification *)notification
@ -217,7 +217,7 @@ RCT_IMPORT_METHOD(ReactIOS, unmountComponentAtNodeAndRemoveContainer)
- (void)dealloc
{
[_bridge enqueueJSCall:@"ReactIOS.unmountComponentAtNodeAndRemoveContainer"
[_bridge enqueueJSCall:@"ReactNative.unmountComponentAtNodeAndRemoveContainer"
args:@[self.reactTag]];
}