2019-07-04 21:17:06 +03:00
|
|
|
/**
|
2021-12-31 02:08:43 +03:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2019-07-04 21:17:06 +03:00
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2019-07-04 21:17:06 +03:00
|
|
|
*
|
|
|
|
* @generated by an internal plugin build system
|
2019-07-04 21:17:06 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
|
|
|
|
|
2019-07-04 21:17:06 +03:00
|
|
|
// OSS-compatibility layer
|
2019-07-04 21:17:06 +03:00
|
|
|
|
|
|
|
#import "CoreModulesPlugins.h"
|
|
|
|
|
|
|
|
#import <string>
|
|
|
|
#import <unordered_map>
|
|
|
|
|
|
|
|
Class RCTCoreModulesClassProvider(const char *name) {
|
2021-04-28 23:28:01 +03:00
|
|
|
// Intentionally leak to avoid crashing after static destructors are run.
|
|
|
|
static const auto sCoreModuleClassMap = new const std::unordered_map<std::string, Class (*)(void)>{
|
Make update-plugins.js script support multiple libraries
Summary:
Some NativeModules belong to their own buck target (separate from `ReactInternal`). We shouldn't move those NativeModules to `CoreModuels`, because that would unnecessarily bloat `CoreModules`.
In this diff, I extended the `update-plugins.js` script to also generate plugin stubs for those additional targets. This way, we can convert those NativeModules to TurboModules without moving them to CoreModules.
Now, in `update-plugins.js`, we have this array:
```
const libraries = [
{
name: 'CoreModules',
outputFiles: {
ios: ['CoreModulesPlugins.h', 'CoreModulesPlugins.mm'],
android: [],
},
outputPath: {
ios: `${GITHUB_DIR}/React/CoreModules`,
android: '',
},
},
];
```
To codegen another pair of plugin files for another target, simply insert to this array.
**Note:** We'll have to modify RNTesterTurboModuleProvider, but I can take care of that when I setup RNTester for TurboModules.
Reviewed By: fkgozali
Differential Revision: D17671288
fbshipit-source-id: 412d2e730682f82740241506f241dcfb4d302e99
2019-10-01 21:07:08 +03:00
|
|
|
{"AccessibilityManager", RCTAccessibilityManagerCls},
|
|
|
|
{"Appearance", RCTAppearanceCls},
|
|
|
|
{"DeviceInfo", RCTDeviceInfoCls},
|
|
|
|
{"ExceptionsManager", RCTExceptionsManagerCls},
|
|
|
|
{"PlatformConstants", RCTPlatformCls},
|
|
|
|
{"Clipboard", RCTClipboardCls},
|
|
|
|
{"I18nManager", RCTI18nManagerCls},
|
|
|
|
{"SourceCode", RCTSourceCodeCls},
|
|
|
|
{"ActionSheetManager", RCTActionSheetManagerCls},
|
2019-10-15 19:12:56 +03:00
|
|
|
{"AlertManager", RCTAlertManagerCls},
|
2019-10-15 19:12:56 +03:00
|
|
|
{"AsyncLocalStorage", RCTAsyncLocalStorageCls},
|
2019-10-17 04:43:00 +03:00
|
|
|
{"Timing", RCTTimingCls},
|
2019-11-01 21:54:44 +03:00
|
|
|
{"StatusBarManager", RCTStatusBarManagerCls},
|
2019-11-01 21:54:44 +03:00
|
|
|
{"KeyboardObserver", RCTKeyboardObserverCls},
|
2019-11-01 21:54:44 +03:00
|
|
|
{"AppState", RCTAppStateCls},
|
2019-11-01 21:54:44 +03:00
|
|
|
{"PerfMonitor", RCTPerfMonitorCls},
|
2019-11-05 02:58:49 +03:00
|
|
|
{"DevMenu", RCTDevMenuCls},
|
|
|
|
{"DevSettings", RCTDevSettingsCls},
|
2019-11-05 02:58:49 +03:00
|
|
|
{"RedBox", RCTRedBoxCls},
|
2019-12-10 13:28:06 +03:00
|
|
|
{"LogBox", RCTLogBoxCls},
|
2019-11-09 01:08:11 +03:00
|
|
|
{"WebSocketExecutor", RCTWebSocketExecutorCls},
|
|
|
|
{"WebSocketModule", RCTWebSocketModuleCls},
|
2020-02-28 04:01:18 +03:00
|
|
|
{"DevLoadingView", RCTDevLoadingViewCls},
|
2020-06-08 19:04:56 +03:00
|
|
|
{"DevSplitBundleLoader", RCTDevSplitBundleLoaderCls},
|
2020-10-14 12:37:51 +03:00
|
|
|
{"EventDispatcher", RCTEventDispatcherCls},
|
Make update-plugins.js script support multiple libraries
Summary:
Some NativeModules belong to their own buck target (separate from `ReactInternal`). We shouldn't move those NativeModules to `CoreModuels`, because that would unnecessarily bloat `CoreModules`.
In this diff, I extended the `update-plugins.js` script to also generate plugin stubs for those additional targets. This way, we can convert those NativeModules to TurboModules without moving them to CoreModules.
Now, in `update-plugins.js`, we have this array:
```
const libraries = [
{
name: 'CoreModules',
outputFiles: {
ios: ['CoreModulesPlugins.h', 'CoreModulesPlugins.mm'],
android: [],
},
outputPath: {
ios: `${GITHUB_DIR}/React/CoreModules`,
android: '',
},
},
];
```
To codegen another pair of plugin files for another target, simply insert to this array.
**Note:** We'll have to modify RNTesterTurboModuleProvider, but I can take care of that when I setup RNTester for TurboModules.
Reviewed By: fkgozali
Differential Revision: D17671288
fbshipit-source-id: 412d2e730682f82740241506f241dcfb4d302e99
2019-10-01 21:07:08 +03:00
|
|
|
};
|
|
|
|
|
2021-04-28 23:28:01 +03:00
|
|
|
auto p = sCoreModuleClassMap->find(name);
|
|
|
|
if (p != sCoreModuleClassMap->end()) {
|
2019-07-04 21:17:06 +03:00
|
|
|
auto classFunc = p->second;
|
|
|
|
return classFunc();
|
|
|
|
}
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // RN_DISABLE_OSS_PLUGIN_HEADER
|