-
Couldn't load subscription status.
- Fork 24.9k
iOS: Add new configuration for RCTDevMenu
#53505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
A diff we have internally at Microsoft is we expose RCTDevSetting's dataSource (which is private, but seems like it was meant to be public?) so that we can set our own custom one, which sets whether the dev menu is shown and other settings that way. I was considering upstreaming that change when I noticed this PR. Food for thought in case it's helpful / you wanna go that way. See these two:
|
Hey, thanks for the suggestion. I think exposing |
Ah, didn't see the RFC :) thanks! |
Summary: Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes: - isDevMenuEnabled, - isShakeGestureEnabled, - areKeyboardShortcutsEnabled ## Changelog: [IOS][ADDED] - Add new configuration for `RCTDevMenu` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Test Plan: Tested with different configurations on `RCTDevMenuConfiguration`: <details> <summary>Click to view code</summary> ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; #if USE_OSS_CODEGEN self.dependencyProvider = [RCTAppDependencyProvider new]; #endif RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false]; [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" inWindow:self.window initialProperties:[self prepareInitialProps] launchOptions:launchOptions]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; } ``` </details> Differential Revision: D81684275 Pulled By: coado
Summary: Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes: - isDevMenuEnabled, - isShakeGestureEnabled, - areKeyboardShortcutsEnabled ## Changelog: [IOS][ADDED] - Add new configuration for `RCTDevMenu` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Test Plan: Tested with different configurations on `RCTDevMenuConfiguration`: <details> <summary>Click to view code</summary> ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; #if USE_OSS_CODEGEN self.dependencyProvider = [RCTAppDependencyProvider new]; #endif RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false]; [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" inWindow:self.window initialProperties:[self prepareInitialProps] launchOptions:launchOptions]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; } ``` </details> Run helloworld: <img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300"> Differential Revision: D81684275 Pulled By: coado
Summary: Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes: - isDevMenuEnabled, - isShakeGestureEnabled, - areKeyboardShortcutsEnabled ## Changelog: [IOS][ADDED] - Add new configuration for `RCTDevMenu` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Test Plan: Tested with different configurations on `RCTDevMenuConfiguration`: <details> <summary>Click to view code</summary> ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; #if USE_OSS_CODEGEN self.dependencyProvider = [RCTAppDependencyProvider new]; #endif RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false]; [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" inWindow:self.window initialProperties:[self prepareInitialProps] launchOptions:launchOptions]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; } ``` </details> Run helloworld: <img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300"> Differential Revision: D81684275 Pulled By: coado
Summary: Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes: - isDevMenuEnabled, - isShakeGestureEnabled, - areKeyboardShortcutsEnabled ## Changelog: [IOS][ADDED] - Add new configuration for `RCTDevMenu` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Test Plan: Tested with different configurations on `RCTDevMenuConfiguration`: <details> <summary>Click to view code</summary> ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; #if USE_OSS_CODEGEN self.dependencyProvider = [RCTAppDependencyProvider new]; #endif RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false]; [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" inWindow:self.window initialProperties:[self prepareInitialProps] launchOptions:launchOptions]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; } ``` </details> Run helloworld: <img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300"> Differential Revision: D81684275 Pulled By: coado
Summary: Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes: - isDevMenuEnabled, - isShakeGestureEnabled, - areKeyboardShortcutsEnabled ## Changelog: [IOS][ADDED] - Add new configuration for `RCTDevMenu` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Test Plan: Tested with different configurations on `RCTDevMenuConfiguration`: <details> <summary>Click to view code</summary> ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; #if USE_OSS_CODEGEN self.dependencyProvider = [RCTAppDependencyProvider new]; #endif RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false]; [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" inWindow:self.window initialProperties:[self prepareInitialProps] launchOptions:launchOptions]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; } ``` </details> Run helloworld: <img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300"> Differential Revision: D81684275 Pulled By: coado
Summary: Following the [RFC](react-native-community/discussions-and-proposals#925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes: - isDevMenuEnabled, - isShakeGestureEnabled, - areKeyboardShortcutsEnabled ## Changelog: [IOS][ADDED] - Add new configuration for `RCTDevMenu` <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Test Plan: Tested with different configurations on `RCTDevMenuConfiguration`: <details> <summary>Click to view code</summary> ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; #if USE_OSS_CODEGEN self.dependencyProvider = [RCTAppDependencyProvider new]; #endif RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false]; [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" inWindow:self.window initialProperties:[self prepareInitialProps] launchOptions:launchOptions]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; } ``` </details> Run helloworld: <img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300"> Differential Revision: D81684275 Pulled By: coado
|
This pull request was successfully merged by @coado in 29d5aa5 When will my fix make it into a release? | How to file a pick request? |
Summary:
Following the RFC, this PR adds new
RCTDevMenuconfiguration and extendsRCTReactNativeFactoryAPI for passing it to the particularRCTHost. TheRCTDevMenuConfigurationincludes:Changelog:
[IOS][ADDED] - Add new configuration for
RCTDevMenuTest Plan:
Tested with different configurations on
RCTDevMenuConfiguration:Click to view code
Run helloworld: