mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 03:26:07 +00:00
strip off RK/RCT prefix from NativeModules
Reviewed By: javache Differential Revision: D4487530 fbshipit-source-id: ea16720dc15e490267ad244c43ea9d237f81e353
This commit is contained in:
parent
b6f494c313
commit
29616e3122
@ -65,7 +65,7 @@ public class NetworkRecordingModuleMock extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String getName() {
|
public final String getName() {
|
||||||
return "RCTNetworking";
|
return "Networking";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fireReactCallback(
|
private void fireReactCallback(
|
||||||
|
@ -19,10 +19,12 @@ import com.facebook.react.bridge.WritableMap;
|
|||||||
import com.facebook.react.module.annotations.ReactModule;
|
import com.facebook.react.module.annotations.ReactModule;
|
||||||
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;
|
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;
|
||||||
|
|
||||||
@ReactModule(name = "AppState")
|
@ReactModule(name = AppStateModule.NAME)
|
||||||
public class AppStateModule extends ReactContextBaseJavaModule
|
public class AppStateModule extends ReactContextBaseJavaModule
|
||||||
implements LifecycleEventListener {
|
implements LifecycleEventListener {
|
||||||
|
|
||||||
|
protected static final String NAME = "AppState";
|
||||||
|
|
||||||
public static final String APP_STATE_ACTIVE = "active";
|
public static final String APP_STATE_ACTIVE = "active";
|
||||||
public static final String APP_STATE_BACKGROUND = "background";
|
public static final String APP_STATE_BACKGROUND = "background";
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ public class AppStateModule extends ReactContextBaseJavaModule
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "AppState";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,9 +56,11 @@ import com.facebook.react.module.annotations.ReactModule;
|
|||||||
* {@link NativeModule} that allows JS to interact with the photos on the device (i.e.
|
* {@link NativeModule} that allows JS to interact with the photos on the device (i.e.
|
||||||
* {@link MediaStore.Images}).
|
* {@link MediaStore.Images}).
|
||||||
*/
|
*/
|
||||||
@ReactModule(name = "RKCameraRollManager")
|
@ReactModule(name = CameraRollManager.NAME)
|
||||||
public class CameraRollManager extends ReactContextBaseJavaModule {
|
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 = "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_LOAD_PERMISSION = "E_UNABLE_TO_LOAD_PERMISSION";
|
||||||
private static final String ERROR_UNABLE_TO_SAVE = "E_UNABLE_TO_SAVE";
|
private static final String ERROR_UNABLE_TO_SAVE = "E_UNABLE_TO_SAVE";
|
||||||
@ -100,7 +102,7 @@ public class CameraRollManager extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RKCameraRollManager";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,9 +52,11 @@ import com.facebook.react.module.annotations.ReactModule;
|
|||||||
/**
|
/**
|
||||||
* Native module that provides image cropping functionality.
|
* Native module that provides image cropping functionality.
|
||||||
*/
|
*/
|
||||||
@ReactModule(name = "RKImageEditingManager")
|
@ReactModule(name = ImageEditingManager.NAME)
|
||||||
public class ImageEditingManager extends ReactContextBaseJavaModule {
|
public class ImageEditingManager extends ReactContextBaseJavaModule {
|
||||||
|
|
||||||
|
protected static final String NAME = "ImageEditingManager";
|
||||||
|
|
||||||
private static final List<String> LOCAL_URI_PREFIXES = Arrays.asList(
|
private static final List<String> LOCAL_URI_PREFIXES = Arrays.asList(
|
||||||
"file://", "content://");
|
"file://", "content://");
|
||||||
|
|
||||||
@ -98,7 +100,7 @@ public class ImageEditingManager extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RKImageEditingManager";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,9 +23,11 @@ import com.facebook.react.common.JavascriptException;
|
|||||||
import com.facebook.react.common.ReactConstants;
|
import com.facebook.react.common.ReactConstants;
|
||||||
import com.facebook.react.module.annotations.ReactModule;
|
import com.facebook.react.module.annotations.ReactModule;
|
||||||
|
|
||||||
@ReactModule(name = "RKExceptionsManager")
|
@ReactModule(name = ExceptionsManagerModule.NAME)
|
||||||
public class ExceptionsManagerModule extends BaseJavaModule {
|
public class ExceptionsManagerModule extends BaseJavaModule {
|
||||||
|
|
||||||
|
protected static final String NAME = "ExceptionsManager";
|
||||||
|
|
||||||
static private final Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
|
static private final Pattern mJsModuleIdPattern = Pattern.compile("(?:^|[/\\\\])(\\d+\\.js)$");
|
||||||
private final DevSupportManager mDevSupportManager;
|
private final DevSupportManager mDevSupportManager;
|
||||||
|
|
||||||
@ -35,7 +37,7 @@ public class ExceptionsManagerModule extends BaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
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
|
// If the file name of a stack frame is numeric (+ ".js"), we assume it's a lazily injected module
|
||||||
|
@ -44,10 +44,12 @@ import com.facebook.react.uimanager.ReactChoreographer;
|
|||||||
/**
|
/**
|
||||||
* Native module for JS timer execution. Timers fire on frame boundaries.
|
* 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,
|
public final class Timing extends ReactContextBaseJavaModule implements LifecycleEventListener,
|
||||||
OnExecutorUnregisteredListener, HeadlessJsTaskEventListener {
|
OnExecutorUnregisteredListener, HeadlessJsTaskEventListener {
|
||||||
|
|
||||||
|
protected static final String NAME = "Timing";
|
||||||
|
|
||||||
// These timing contants should be kept in sync with the ones in `JSTimersExecution.js`.
|
// 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.
|
// The minimum time in milliseconds left in the frame to call idle callbacks.
|
||||||
private static final float IDLE_CALLBACK_FRAME_DEADLINE_MS = 1.f;
|
private static final float IDLE_CALLBACK_FRAME_DEADLINE_MS = 1.f;
|
||||||
@ -349,7 +351,7 @@ public final class Timing extends ReactContextBaseJavaModule implements Lifecycl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RCTTiming";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,9 +29,11 @@ import com.facebook.react.module.annotations.ReactModule;
|
|||||||
* Module that records debug information during transitions (animated navigation events such as
|
* Module that records debug information during transitions (animated navigation events such as
|
||||||
* going from one screen to another).
|
* going from one screen to another).
|
||||||
*/
|
*/
|
||||||
@ReactModule(name = "AnimationsDebugModule")
|
@ReactModule(name = AnimationsDebugModule.NAME)
|
||||||
public class AnimationsDebugModule extends ReactContextBaseJavaModule {
|
public class AnimationsDebugModule extends ReactContextBaseJavaModule {
|
||||||
|
|
||||||
|
protected static final String NAME = "AnimationsDebugModule";
|
||||||
|
|
||||||
private @Nullable FpsDebugFrameCallback mFrameCallback;
|
private @Nullable FpsDebugFrameCallback mFrameCallback;
|
||||||
private @Nullable final DeveloperSettings mCatalystSettings;
|
private @Nullable final DeveloperSettings mCatalystSettings;
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ public class AnimationsDebugModule extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "AnimationsDebugModule";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
|
@ -22,9 +22,11 @@ import com.facebook.react.module.annotations.ReactModule;
|
|||||||
/**
|
/**
|
||||||
* Module that exposes the URL to the source code map (used for exception stack trace parsing) to JS
|
* 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 class SourceCodeModule extends BaseJavaModule {
|
||||||
|
|
||||||
|
public static final String NAME = "SourceCode";
|
||||||
|
|
||||||
private final ReactContext mReactContext;
|
private final ReactContext mReactContext;
|
||||||
|
|
||||||
public SourceCodeModule(ReactContext reactContext) {
|
public SourceCodeModule(ReactContext reactContext) {
|
||||||
@ -33,7 +35,7 @@ public class SourceCodeModule extends BaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RCTSourceCode";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -51,9 +51,11 @@ import okio.ByteString;
|
|||||||
/**
|
/**
|
||||||
* Implements the XMLHttpRequest JavaScript interface.
|
* Implements the XMLHttpRequest JavaScript interface.
|
||||||
*/
|
*/
|
||||||
@ReactModule(name = "RCTNetworking", supportsWebWorkers = true)
|
@ReactModule(name = NetworkingModule.NAME, supportsWebWorkers = true)
|
||||||
public final class NetworkingModule extends ReactContextBaseJavaModule {
|
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_ENCODING_HEADER_NAME = "content-encoding";
|
||||||
private static final String CONTENT_TYPE_HEADER_NAME = "content-type";
|
private static final String CONTENT_TYPE_HEADER_NAME = "content-type";
|
||||||
private static final String REQUEST_BODY_KEY_STRING = "string";
|
private static final String REQUEST_BODY_KEY_STRING = "string";
|
||||||
@ -141,7 +143,7 @@ public final class NetworkingModule extends ReactContextBaseJavaModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RCTNetworking";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,10 +33,12 @@ import static com.facebook.react.modules.storage.ReactDatabaseSupplier.KEY_COLUM
|
|||||||
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.TABLE_CATALYST;
|
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.TABLE_CATALYST;
|
||||||
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.VALUE_COLUMN;
|
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.VALUE_COLUMN;
|
||||||
|
|
||||||
@ReactModule(name = "AsyncSQLiteDBStorage")
|
@ReactModule(name = AsyncStorageModule.NAME)
|
||||||
public final class AsyncStorageModule
|
public final class AsyncStorageModule
|
||||||
extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable {
|
extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable {
|
||||||
|
|
||||||
|
protected static final String NAME = "AsyncSQLiteDBStorage";
|
||||||
|
|
||||||
// SQL variable number limit, defined by SQLITE_LIMIT_VARIABLE_NUMBER:
|
// SQL variable number limit, defined by SQLITE_LIMIT_VARIABLE_NUMBER:
|
||||||
// https://raw.githubusercontent.com/android/platform_external_sqlite/master/dist/sqlite3.c
|
// https://raw.githubusercontent.com/android/platform_external_sqlite/master/dist/sqlite3.c
|
||||||
private static final int MAX_SQL_KEYS = 999;
|
private static final int MAX_SQL_KEYS = 999;
|
||||||
@ -51,7 +53,7 @@ public final class AsyncStorageModule
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "AsyncSQLiteDBStorage";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,10 +72,12 @@ import static com.facebook.react.bridge.ReactMarkerConstants.UI_MANAGER_MODULE_C
|
|||||||
* consider implementing a pool
|
* consider implementing a pool
|
||||||
* TODO(5483063): Don't dispatch the view hierarchy at the end of a batch if no UI changes occurred
|
* 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
|
public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||||
OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter, NativeModuleLogger {
|
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
|
// Keep in sync with ReactIOSTagHandles JS module - see that file for an explanation on why the
|
||||||
// increment here is 10
|
// increment here is 10
|
||||||
private static final int ROOT_VIEW_TAG_INCREMENT = 10;
|
private static final int ROOT_VIEW_TAG_INCREMENT = 10;
|
||||||
@ -114,7 +116,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RKUIManager";
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user