[ReactKit] Remove NativeModulesDeprecated

This commit is contained in:
Spencer Ahrens 2015-03-17 03:08:52 -07:00
parent 54c6a7ddff
commit d8ee4e87a1
20 changed files with 27 additions and 45 deletions

View File

@ -5,8 +5,9 @@
*/
'use strict';
var { RCTActionSheetManager } = require('NativeModules');
var invariant = require('invariant');
var RCTActionSheetManager = require('NativeModulesDeprecated').RCTActionSheetManager;
var ActionSheetIOS = {
showActionSheetWithOptions(options, callback) {

View File

@ -5,7 +5,7 @@
*/
'use strict';
var NativeModules = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var RCTAppState = NativeModules.RCTAppState;
var AppState = {

View File

@ -1,14 +0,0 @@
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @providesModule NativeModulesDeprecated
*/
'use strict';
var NativeModulesDeprecated = require('BatchedBridge').RemoteModulesDeprecated;
var nativeModulePrefixDuplicator = require('nativeModulePrefixDuplicator');
nativeModulePrefixDuplicator(NativeModulesDeprecated);
module.exports = NativeModulesDeprecated;

View File

@ -5,7 +5,7 @@
*/
'use strict';
var RCTPOPAnimationManager = require('NativeModulesDeprecated').RCTPOPAnimationManager;
var RCTPOPAnimationManager = require('NativeModules').RCTPOPAnimationManager;
if (!RCTPOPAnimationManager) {
// POP animation isn't available in the OSS fork - this is a temporary
// workaround to enable its availability to be determined at runtime.

View File

@ -5,6 +5,6 @@
*/
'use strict';
var RCTAlertManager = require('NativeModulesDeprecated').RCTAlertManager;
var { RCTAlertManager } = require('NativeModules');
module.exports = RCTAlertManager;

View File

@ -65,8 +65,6 @@ var BatchedBridgeFactory = {
invokeCallbackAndReturnFlushedQueue:
messageQueue.invokeCallbackAndReturnFlushedQueue.bind(messageQueue),
flushedQueue: messageQueue.flushedQueue.bind(messageQueue),
// These deprecated modules do not accept an error callback.
RemoteModulesDeprecated: mapObject(modulesConfig, this._createBridgedModule.bind(this, messageQueue)),
RemoteModules: mapObject(modulesConfig, this._createBridgedModule.bind(this, messageQueue)),
setLoggingEnabled: messageQueue.setLoggingEnabled.bind(messageQueue),
getLoggedOutgoingItems: messageQueue.getLoggedOutgoingItems.bind(messageQueue),

View File

@ -6,13 +6,13 @@
'use strict';
var NativeModules = require('NativeModules');
var NativeModulesDeprecated = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
var Subscribable = require('Subscribable');
var TextInputState = require('TextInputState');
var RCTUIManager = NativeModules.RCTUIManager;
var RCTUIManagerDeprecated = NativeModulesDeprecated.RCTUIManager;
var RCTUIManagerDeprecated = NativeModules.RCTUIManager;
var RCTScrollViewConsts = RCTUIManager.RCTScrollView.Constants;
var warning = require('warning');

View File

@ -13,7 +13,7 @@ var RCTScrollViewConsts = RCTScrollView.Constants;
var React = require('React');
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
var ScrollResponder = require('ScrollResponder');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');

View File

@ -9,7 +9,7 @@
*/
'use strict';
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
var TextInputState = {
/**

View File

@ -7,7 +7,7 @@
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModulesDeprecated = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var PropTypes = require('ReactPropTypes');
var ImageResizeMode = require('ImageResizeMode');
var ImageStylePropTypes = require('ImageStylePropTypes');
@ -114,7 +114,7 @@ var Image = React.createClass({
warning(RawImage === RCTStaticImage, 'tintColor style only supported on static images.');
}
var contentModes = NativeModulesDeprecated.RCTUIManager.UIView.ContentMode;
var contentModes = NativeModules.RCTUIManager.UIView.ContentMode;
var resizeMode;
if (style.resizeMode === ImageResizeMode.stretch) {
resizeMode = contentModes.ScaleToFill;

View File

@ -115,7 +115,7 @@ function setupTimers() {
}
function setupAlert() {
var RCTAlertManager = require('RCTAlertManager');
var { RCTAlertManager } = require('NativeModules');
if (!GLOBAL.alert) {
GLOBAL.alert = function(text) {
var alertOpts = {

View File

@ -6,7 +6,7 @@
*/
'use strict';
var RCTDataManager = require('NativeModulesDeprecated').RCTDataManager;
var RCTDataManager = require('NativeModules').RCTDataManager;
var crc32 = require('crc32');

View File

@ -6,7 +6,7 @@
'use strict';
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
/**
* Queries the layout of a view. The layout does not reflect the element as

View File

@ -7,13 +7,13 @@
"use strict";
var EventPropagators = require('EventPropagators');
var NativeModulesDeprecated = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var SyntheticEvent = require('SyntheticEvent');
var merge = require('merge');
var warning = require('warning');
var RCTUIManager = NativeModulesDeprecated.RCTUIManager;
var RCTUIManager = NativeModules.RCTUIManager;
var customBubblingEventTypes = RCTUIManager.customBubblingEventTypes;
var customDirectEventTypes = RCTUIManager.customDirectEventTypes;

View File

@ -6,10 +6,9 @@
'use strict';
var NativeModules = require('NativeModules');
var NativeModulesDeprecated = require('NativeModulesDeprecated');
var RCTPOPAnimationManagerDeprecated = NativeModulesDeprecated.RCTPOPAnimationManager;
var NativeModules = require('NativeModules');
var RCTPOPAnimationManager = NativeModules.RCTPOPAnimationManager;
var RCTUIManager = NativeModules.RCTUIManager;
var RCTUIManagerDeprecated = NativeModulesDeprecated.RCTUIManager;
var TextInputState = require('TextInputState');
var flattenStyle = require('flattenStyle');
@ -27,16 +26,16 @@ var animationIDInvariant = function(funcName, anim) {
var NativeMethodsMixin = {
addAnimation: function(anim, callback) {
animationIDInvariant('addAnimation', anim);
RCTPOPAnimationManagerDeprecated.addAnimation(this.getNodeHandle(), anim, callback);
RCTPOPAnimationManager.addAnimation(this.getNodeHandle(), anim, callback);
},
removeAnimation: function(anim) {
animationIDInvariant('removeAnimation', anim);
RCTPOPAnimationManagerDeprecated.removeAnimation(this.getNodeHandle(), anim);
RCTPOPAnimationManager.removeAnimation(this.getNodeHandle(), anim);
},
measure: function(callback) {
RCTUIManagerDeprecated.measure(this.getNodeHandle(), callback);
RCTUIManager.measure(this.getNodeHandle(), callback);
},
measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
@ -77,7 +76,7 @@ var NativeMethodsMixin = {
props = mergeFast(nativeProps, style);
}
RCTUIManagerDeprecated.updateView(
RCTUIManager.updateView(
this.getNodeHandle(),
this.viewConfig.uiViewClassName,
props

View File

@ -9,7 +9,7 @@
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactMultiChildUpdateTypes = require('ReactMultiChildUpdateTypes');
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
var ReactPerf = require('ReactPerf');
/**

View File

@ -5,7 +5,7 @@
*/
'use strict';
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactPerf = require('ReactPerf');

View File

@ -11,7 +11,7 @@ var ReactIOSEventEmitter = require('ReactIOSEventEmitter');
var ReactIOSStyleAttributes = require('ReactIOSStyleAttributes');
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactMultiChild = require('ReactMultiChild');
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
var styleDiffer = require('styleDiffer');
var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');

View File

@ -7,7 +7,7 @@
'use strict';
var ReactIOSTagHandles = require('ReactIOSTagHandles');
var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;
var assign = require('Object.assign');

View File

@ -6,9 +6,7 @@
*/
'use strict';
var NativeModules = require('NativeModulesDeprecated');
var RCTAlertManager = NativeModules.RCTAlertManager;
var { RCTAlertManager } = require('NativeModules');
var DEFAULT_BUTTON_TEXT = 'OK';
var DEFAULT_BUTTON = {