-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Use Objective-C nullability to provide better Swift types in RCTAppDelegate #42236
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
p: Callstack
Partner: Callstack
Partner
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
labels
Jan 10, 2024
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Base commit: 8fd2f12 |
This pull request was successfully merged by @okwasniewski in a7c5c28. When will my fix make it into a release? | Upcoming Releases |
3 tasks
Kudo
added a commit
to expo/expo
that referenced
this pull request
Jan 16, 2024
…26357) # Why fix react-native nightlies support for 0.74 # How summarize here, please check each commit messages for details - [BREAKING CHANGE] remove `unstable_useRuntimeSchedulerAlways` or `REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS` support - [BREAKING CHANGE] remove `ReactNativeHostHandler.onRegisterJSIModules()` interface - [expo][dev-menu][dev-launcher] fixed for `ReactNativeHost.getJSIModulePackage()` removal and adding `ReactNativeHost.getUIManagerProvider()` - [dev-client] add compatible methods to address facebook/react-native#42236 changes To be resolved and currently workarounded by SetupReactNativeNightly - `import com.facebook.react.turbomodule.core.CallInvokerHolderImpl` -> ``import com.facebook.react.internal.turbomodule.core.CallInvokerHolderImpl` # Test Plan ci passed
gokul1099
pushed a commit
to gokul1099/react-native-visionos
that referenced
this pull request
Jan 17, 2024
…legate (facebook#42236) Summary: This PR adds nullable type annotations + nullability audit regions (`NS_ASSUME_NONNULL_BEGIN`/`NS_ASSUME_NONNULL_END`) to provide better Swift types. Before: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge!) -> URL! { self.bundleURL() } override func bundleURL() -> URL! { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView!) { rootView.backgroundColor = .red } } ``` After: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge) -> URL { self.bundleURL() } override func bundleURL() -> URL { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView) { rootView.backgroundColor = .red } } ``` ## Changelog: [IOS] [ADDED] - Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate Pull Request resolved: facebook#42236 Test Plan: In Xcode click the top left square button and look up the generated interface: ![CleanShot 2024-01-10 at 16 40 51@2x](https://github.com/facebook/react-native/assets/52801365/ad2ac9ed-9d9a-4c5e-a200-1d7a2802e701) Reviewed By: christophpurrer Differential Revision: D52660647 Pulled By: cipolleschi fbshipit-source-id: d4d3c36b3f420b3490145c491cd3781613f4b111
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Feb 16, 2024
…legate (facebook#42236) Summary: This PR adds nullable type annotations + nullability audit regions (`NS_ASSUME_NONNULL_BEGIN`/`NS_ASSUME_NONNULL_END`) to provide better Swift types. Before: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge!) -> URL! { self.bundleURL() } override func bundleURL() -> URL! { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView!) { rootView.backgroundColor = .red } } ``` After: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge) -> URL { self.bundleURL() } override func bundleURL() -> URL { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView) { rootView.backgroundColor = .red } } ``` ## Changelog: [IOS] [ADDED] - Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate Pull Request resolved: facebook#42236 Test Plan: In Xcode click the top left square button and look up the generated interface: ![CleanShot 2024-01-10 at 16 40 51@2x](https://github.com/facebook/react-native/assets/52801365/ad2ac9ed-9d9a-4c5e-a200-1d7a2802e701) Reviewed By: christophpurrer Differential Revision: D52660647 Pulled By: cipolleschi fbshipit-source-id: d4d3c36b3f420b3490145c491cd3781613f4b111
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Apr 5, 2024
…legate (facebook#42236) Summary: This PR adds nullable type annotations + nullability audit regions (`NS_ASSUME_NONNULL_BEGIN`/`NS_ASSUME_NONNULL_END`) to provide better Swift types. Before: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge!) -> URL! { self.bundleURL() } override func bundleURL() -> URL! { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView!) { rootView.backgroundColor = .red } } ``` After: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge) -> URL { self.bundleURL() } override func bundleURL() -> URL { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView) { rootView.backgroundColor = .red } } ``` ## Changelog: [IOS] [ADDED] - Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate Pull Request resolved: facebook#42236 Test Plan: In Xcode click the top left square button and look up the generated interface: ![CleanShot 2024-01-10 at 16 40 51@2x](https://github.com/facebook/react-native/assets/52801365/ad2ac9ed-9d9a-4c5e-a200-1d7a2802e701) Reviewed By: christophpurrer Differential Revision: D52660647 Pulled By: cipolleschi fbshipit-source-id: d4d3c36b3f420b3490145c491cd3781613f4b111
okwasniewski
added a commit
to callstack/react-native-visionos
that referenced
this pull request
Jun 24, 2024
…legate (facebook#42236) Summary: This PR adds nullable type annotations + nullability audit regions (`NS_ASSUME_NONNULL_BEGIN`/`NS_ASSUME_NONNULL_END`) to provide better Swift types. Before: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge!) -> URL! { self.bundleURL() } override func bundleURL() -> URL! { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView!) { rootView.backgroundColor = .red } } ``` After: ```swift class AppDelegate: RCTAppDelegate { override func sourceURL(for bridge: RCTBridge) -> URL { self.bundleURL() } override func bundleURL() -> URL { RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") } override func customize(_ rootView: RCTRootView) { rootView.backgroundColor = .red } } ``` ## Changelog: [IOS] [ADDED] - Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate Pull Request resolved: facebook#42236 Test Plan: In Xcode click the top left square button and look up the generated interface: ![CleanShot 2024-01-10 at 16 40 51@2x](https://github.com/facebook/react-native/assets/52801365/ad2ac9ed-9d9a-4c5e-a200-1d7a2802e701) Reviewed By: christophpurrer Differential Revision: D52660647 Pulled By: cipolleschi fbshipit-source-id: d4d3c36b3f420b3490145c491cd3781613f4b111
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Merged
This PR has been merged.
p: Callstack
Partner: Callstack
Partner
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR adds nullable type annotations + nullability audit regions (
NS_ASSUME_NONNULL_BEGIN
/NS_ASSUME_NONNULL_END
) to provide better Swift types.Before:
After:
Changelog:
[IOS] [ADDED] - Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate
Test Plan:
In Xcode click the top left square button and look up the generated interface: