Permalink
Browse files

strip off RK/RCT prefix from NativeModules

Reviewed By: javache

Differential Revision: D4487530

fbshipit-source-id: ea16720dc15e490267ad244c43ea9d237f81e353
  • Loading branch information...
AaaChiuuu authored and facebook-github-bot committed Jan 31, 2017
1 parent b6f494c commit 29616e3122dc47af76da5732301a034f388cda0a
@@ -65,7 +65,7 @@ public void setRequestListener(RequestListener requestListener) {
@Override
public final String getName() {
return "RCTNetworking";
return "Networking";
}
private void fireReactCallback(
@@ -19,10 +19,12 @@
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;
@ReactModule(name = "AppState")
@ReactModule(name = AppStateModule.NAME)
public class AppStateModule extends ReactContextBaseJavaModule
implements LifecycleEventListener {
protected static final String NAME = "AppState";
public static final String APP_STATE_ACTIVE = "active";
public static final String APP_STATE_BACKGROUND = "background";
@@ -34,7 +36,7 @@ public AppStateModule(ReactApplicationContext reactContext) {
@Override
public String getName() {
return "AppState";
return NAME;
}
@Override
@@ -56,9 +56,11 @@
* {@link NativeModule} that allows JS to interact with the photos on the device (i.e.
* {@link MediaStore.Images}).
*/
@ReactModule(name = "RKCameraRollManager")
@ReactModule(name = CameraRollManager.NAME)
public class CameraRollManager extends ReactContextBaseJavaModule {
protected static final String NAME = "CameraRollManager";
private static final String ERROR_UNABLE_TO_LOAD = "E_UNABLE_TO_LOAD";
private static final String ERROR_UNABLE_TO_LOAD_PERMISSION = "E_UNABLE_TO_LOAD_PERMISSION";
private static final String ERROR_UNABLE_TO_SAVE = "E_UNABLE_TO_SAVE";
@@ -100,7 +102,7 @@ public CameraRollManager(ReactApplicationContext reactContext) {
@Override
public String getName() {
return "RKCameraRollManager";
return NAME;
}
/**
@@ -52,9 +52,11 @@
/**
* Native module that provides image cropping functionality.
*/
@ReactModule(name = "RKImageEditingManager")
@ReactModule(name = ImageEditingManager.NAME)
public class ImageEditingManager extends ReactContextBaseJavaModule {
protected static final String NAME = "ImageEditingManager";
private static final List<String> LOCAL_URI_PREFIXES = Arrays.asList(
"file://", "content://");
@@ -98,7 +100,7 @@ public ImageEditingManager(ReactApplicationContext reactContext) {
@Override
public String getName() {
return "RKImageEditingManager";
return NAME;
}
@Override
@@ -23,9 +23,11 @@
import com.facebook.react.common.ReactConstants;
import com.facebook.react.module.annotations.ReactModule;
@ReactModule(name = "RKExceptionsManager")
@ReactModule(name = ExceptionsManagerModule.NAME)
public class ExceptionsManagerModule extends BaseJavaModule {
protected static final String NAME = "ExceptionsManager";
static private final Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
private final DevSupportManager mDevSupportManager;
@@ -35,7 +37,7 @@ public ExceptionsManagerModule(DevSupportManager devSupportManager) {
@Override
public String getName() {
return "RKExceptionsManager";
return NAME;
}
// If the file name of a stack frame is numeric (+ ".js"), we assume it's a lazily injected module
@@ -44,10 +44,12 @@
/**
* Native module for JS timer execution. Timers fire on frame boundaries.
*/
@ReactModule(name = "RCTTiming", supportsWebWorkers = true)
@ReactModule(name = Timing.NAME, supportsWebWorkers = true)
public final class Timing extends ReactContextBaseJavaModule implements LifecycleEventListener,
OnExecutorUnregisteredListener, HeadlessJsTaskEventListener {
protected static final String NAME = "Timing";
// These timing contants should be kept in sync with the ones in `JSTimersExecution.js`.
// The minimum time in milliseconds left in the frame to call idle callbacks.
private static final float IDLE_CALLBACK_FRAME_DEADLINE_MS = 1.f;
@@ -349,7 +351,7 @@ private void clearChoreographerIdleCallback() {
@Override
public String getName() {
return "RCTTiming";
return NAME;
}
@Override
@@ -29,9 +29,11 @@
* Module that records debug information during transitions (animated navigation events such as
* going from one screen to another).
*/
@ReactModule(name = "AnimationsDebugModule")
@ReactModule(name = AnimationsDebugModule.NAME)
public class AnimationsDebugModule extends ReactContextBaseJavaModule {
protected static final String NAME = "AnimationsDebugModule";
private @Nullable FpsDebugFrameCallback mFrameCallback;
private @Nullable final DeveloperSettings mCatalystSettings;
@@ -44,7 +46,7 @@ public AnimationsDebugModule(
@Override
public String getName() {
return "AnimationsDebugModule";
return NAME;
}
@ReactMethod
@@ -22,9 +22,11 @@
/**
* Module that exposes the URL to the source code map (used for exception stack trace parsing) to JS
*/
@ReactModule(name = "RCTSourceCode")
@ReactModule(name = SourceCodeModule.NAME)
public class SourceCodeModule extends BaseJavaModule {
public static final String NAME = "SourceCode";
private final ReactContext mReactContext;
public SourceCodeModule(ReactContext reactContext) {
@@ -33,7 +35,7 @@ public SourceCodeModule(ReactContext reactContext) {
@Override
public String getName() {
return "RCTSourceCode";
return NAME;
}
@Override
@@ -51,9 +51,11 @@
/**
* Implements the XMLHttpRequest JavaScript interface.
*/
@ReactModule(name = "RCTNetworking", supportsWebWorkers = true)
@ReactModule(name = NetworkingModule.NAME, supportsWebWorkers = true)
public final class NetworkingModule extends ReactContextBaseJavaModule {
protected static final String NAME = "Networking";
private static final String CONTENT_ENCODING_HEADER_NAME = "content-encoding";
private static final String CONTENT_TYPE_HEADER_NAME = "content-type";
private static final String REQUEST_BODY_KEY_STRING = "string";
@@ -141,7 +143,7 @@ public void initialize() {
@Override
public String getName() {
return "RCTNetworking";
return NAME;
}
@Override
@@ -33,10 +33,12 @@
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.TABLE_CATALYST;
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.VALUE_COLUMN;
@ReactModule(name = "AsyncSQLiteDBStorage")
@ReactModule(name = AsyncStorageModule.NAME)
public final class AsyncStorageModule
extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable {
protected static final String NAME = "AsyncSQLiteDBStorage";
// SQL variable number limit, defined by SQLITE_LIMIT_VARIABLE_NUMBER:
// https://raw.githubusercontent.com/android/platform_external_sqlite/master/dist/sqlite3.c
private static final int MAX_SQL_KEYS = 999;
@@ -51,7 +53,7 @@ public AsyncStorageModule(ReactApplicationContext reactContext) {
@Override
public String getName() {
return "AsyncSQLiteDBStorage";
return NAME;
}
@Override
@@ -72,10 +72,12 @@
* consider implementing a pool
* TODO(5483063): Don't dispatch the view hierarchy at the end of a batch if no UI changes occurred
*/
@ReactModule(name = "RKUIManager")
@ReactModule(name = UIManagerModule.NAME)
public class UIManagerModule extends ReactContextBaseJavaModule implements
OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter, NativeModuleLogger {
protected static final String NAME = "UIManager";
// Keep in sync with ReactIOSTagHandles JS module - see that file for an explanation on why the
// increment here is 10
private static final int ROOT_VIEW_TAG_INCREMENT = 10;
@@ -114,7 +116,7 @@ public UIImplementation getUIImplementation() {
@Override
public String getName() {
return "RKUIManager";
return NAME;
}
@Override

0 comments on commit 29616e3

Please sign in to comment.