Skip to content

Commit

Permalink
[ReactKit] Remove NativeModulesDeprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
sahrens committed Mar 17, 2015
1 parent 54c6a7d commit d8ee4e8
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 45 deletions.
3 changes: 2 additions & 1 deletion Libraries/ActionSheetIOS/ActionSheetIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/
'use strict';

var { RCTActionSheetManager } = require('NativeModules');

var invariant = require('invariant');
var RCTActionSheetManager = require('NativeModulesDeprecated').RCTActionSheetManager;

var ActionSheetIOS = {
showActionSheetWithOptions(options, callback) {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/AppState/AppState.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
'use strict';

var NativeModules = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var RCTAppState = NativeModules.RCTAppState;

var AppState = {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/
'use strict';

var RCTAlertManager = require('NativeModulesDeprecated').RCTAlertManager;
var { RCTAlertManager } = require('NativeModules');

module.exports = RCTAlertManager;
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Components/ScrollResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/TextInput/TextInputState.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
'use strict';

var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;

var TextInputState = {
/**
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Image/Image.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Network/XMLHttpRequest.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
'use strict';

var RCTDataManager = require('NativeModulesDeprecated').RCTDataManager;
var RCTDataManager = require('NativeModules').RCTDataManager;

var crc32 = require('crc32');

Expand Down
2 changes: 1 addition & 1 deletion Libraries/RKBackendNode/queryLayoutByID.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 6 additions & 7 deletions Libraries/ReactIOS/NativeMethodsMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) {
Expand Down Expand Up @@ -77,7 +76,7 @@ var NativeMethodsMixin = {
props = mergeFast(nativeProps, style);
}

RCTUIManagerDeprecated.updateView(
RCTUIManager.updateView(
this.getNodeHandle(),
this.viewConfig.uiViewClassName,
props
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactIOS/ReactIOSDOMIDOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactIOS/ReactIOSMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
'use strict';

var RCTUIManager = require('NativeModulesDeprecated').RCTUIManager;
var RCTUIManager = require('NativeModules').RCTUIManager;

var ReactIOSTagHandles = require('ReactIOSTagHandles');
var ReactPerf = require('ReactPerf');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactIOS/ReactIOSNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactIOS/ReactIOSTextComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
4 changes: 1 addition & 3 deletions Libraries/Utilities/AlertIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit d8ee4e8

Please sign in to comment.