Skip to content

Commit

Permalink
chore: cherry-pick to 0.74-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Mar 20, 2024
1 parent d7fa3d4 commit 41a7dbf
Show file tree
Hide file tree
Showing 12 changed files with 342 additions and 426 deletions.
2 changes: 1 addition & 1 deletion packages/out-of-tree-platforms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@callstack/out-of-tree-platforms",
"version": "0.75.0-main",
"version": "0.74.75",
"description": "Utils for React Native out of tree platforms.",
"keywords": ["out-of-tree", "react-native"],
"homepage": "https://github.com/callstack/react-native-visionos/tree/HEAD/packages/out-of-tree-platforms#readme",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

#import <UIKit/UIKit.h>
#import <React/RCTAnimationUtils.h>
#import <React/RCTColorAnimatedNode.h>
#import <React/RCTObjectAnimatedNode.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result);
*/
+ (void)setInitialNotification:(UNNotification *)notification;

#if !TARGET_OS_VISION
/** DEPRECATED. Use didReceiveNotification instead. */
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification RCT_DEPRECATED;
/** DEPRECATED. Use didReceiveNotification instead. */
+ (void)didReceiveRemoteNotification:(NSDictionary *)notification RCT_DEPRECATED;
#endif

@end
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ @implementation RCTConvert (UIBackgroundFetchResult)

@implementation RCTPushNotificationManager

#if !TARGET_OS_VISION
/** DEPRECATED. UILocalNotification was deprecated in iOS 10. Please don't add new callsites. */
static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notification)
{
Expand All @@ -116,6 +117,7 @@ @implementation RCTPushNotificationManager
formattedLocalNotification[@"remote"] = @NO;
return formattedLocalNotification;
}
#endif

/** For delivered notifications */
static NSDictionary<NSString *, id> *RCTFormatUNNotification(UNNotification *notification)
Expand Down Expand Up @@ -267,6 +269,7 @@ + (void)setInitialNotification:(UNNotification *)notification
kInitialNotification = notification;
}

#if !TARGET_OS_VISION
// Deprecated
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification
{
Expand All @@ -283,6 +286,7 @@ + (void)didReceiveRemoteNotification:(NSDictionary *)notification
object:self
userInfo:userInfo];
}
#endif

- (void)invalidate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-Core/RCTWindowManagerHeaders"

add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/XR/React-RCTXR.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-Core/RCTXRHeaders"

add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
version = package['version']

# Temporaily build from source until visionOS supports prebuilt binaries
source_type = HermesEngineSourceType::BUILD_FROM_GITHUB_MAIN # hermes_source_type(version, react_native_path)
source_type = HermesEngineSourceType::BUILD_FROM_GITHUB_TAG # hermes_source_type(version, react_native_path)
source = podspec_source(source_type, version, react_native_path)

Pod::Spec.new do |spec|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ function get_platform_copy_destination {
if [[ $1 == "macosx" ]]; then
echo "macosx"
return
elif [[ $1 == "xros" ]]; then
echo "xros"
return
elif [[ $1 == "xrsimulator" ]]; then
elif [[ $1 == "xrsimulator" || $1 == "xros" ]]; then
echo "xros"
return
fi
Expand All @@ -31,8 +28,10 @@ function get_deployment_target {
if [[ $1 == "macosx" ]]; then
echo ${MACOSX_DEPLOYMENT_TARGET}
return
elif [[ $1 == "xrsimulator" || $1 == "xros" ]]; then
echo ${XROS_DEPLOYMENT_TARGET}
return
fi

echo ${IPHONEOS_DEPLOYMENT_TARGET}
}

Expand Down
27 changes: 20 additions & 7 deletions packages/react-native/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,25 @@
"react-native": "0.74.0-rc.4",
"@callstack/react-native-visionos": "0.74.0-rc.4"
},
"codegenConfig": {
"name": "AppSpecs",
"type": "all",
"jsSrcsDir": ".",
"android": {
"javaPackageName": "com.facebook.fbreact.specs"
}
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@callstack/out-of-tree-platforms": "0.74.0-rc.4",
"@react-native/babel-preset": "0.74.75",
"@react-native/eslint-config": "0.74.75",
"@react-native/metro-config": "0.74.75",
"@react-native/typescript-config": "0.74.75",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AppDelegate: RCTAppDelegate {

override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index")
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
Expand Down
Loading

0 comments on commit 41a7dbf

Please sign in to comment.