react-native-tvos 0.73.0-0rc0 → 0.73.0-0rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +3 -3
  3. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +19 -29
  4. package/Libraries/Blob/React-RCTBlob.podspec +8 -14
  5. package/Libraries/Core/ReactNativeVersion.js +1 -1
  6. package/Libraries/Image/React-RCTImage.podspec +9 -13
  7. package/Libraries/LinkingIOS/React-RCTLinking.podspec +4 -12
  8. package/Libraries/LogBox/Data/LogBoxData.js +2 -1
  9. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +7 -13
  10. package/Libraries/NativeComponent/NativeComponentRegistry.js +10 -4
  11. package/Libraries/Network/React-RCTNetwork.podspec +7 -17
  12. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +7 -13
  13. package/Libraries/Settings/React-RCTSettings.podspec +7 -16
  14. package/Libraries/Vibration/React-RCTVibration.podspec +6 -14
  15. package/Libraries/promiseRejectionTrackingOptions.js +21 -7
  16. package/README.md +20 -26
  17. package/React/Base/RCTBridgeProxy.mm +11 -3
  18. package/React/Base/RCTConstants.h +1 -1
  19. package/React/Base/RCTConstants.m +1 -1
  20. package/React/Base/RCTTouchHandlerTV.m +35 -0
  21. package/React/Base/RCTVersion.m +1 -1
  22. package/React/Base/Surface/RCTSurfaceRootShadowView.h +1 -1
  23. package/React/Base/Surface/RCTSurfaceRootShadowView.m +1 -1
  24. package/React/CoreModules/RCTDeviceInfo.mm +1 -1
  25. package/React/CoreModules/React-CoreModules.podspec +5 -9
  26. package/React/Fabric/RCTSurfacePointerHandlerTV.mm +37 -0
  27. package/React/Fabric/RCTSurfaceTouchHandlerTV.mm +30 -0
  28. package/React/Modules/RCTUIManager.h +7 -0
  29. package/React/Modules/RCTUIManager.m +5 -2
  30. package/React/React-RCTFabric.podspec +32 -32
  31. package/React/UIUtils/RCTUIUtils.h +1 -1
  32. package/React/Views/RCTComponentData.m +1 -1
  33. package/React/Views/RCTLayout.h +1 -1
  34. package/React/Views/RCTRootShadowView.h +1 -1
  35. package/React/Views/RCTRootShadowView.m +1 -1
  36. package/React/Views/RCTShadowView.m +1 -1
  37. package/React/Views/RCTTVView.m +2 -2
  38. package/React/Views/ScrollView/RCTScrollView.m +1 -1
  39. package/React/Views/UIView+React.m +30 -23
  40. package/React-Core.podspec +6 -12
  41. package/ReactAndroid/gradle.properties +1 -1
  42. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +0 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +0 -1
  44. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +0 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/{interfaces/ReactHost.kt → ReactHost.kt} +2 -3
  46. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +1 -1
  47. package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/UnstableReactNativeAPI.kt +1 -1
  48. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +1 -1
  49. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +58 -8
  50. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +16 -0
  51. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +0 -11
  52. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +14 -9
  53. package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.java +6 -10
  54. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  55. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.java +8 -0
  56. package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java +5 -0
  57. package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSTimerExecutor.java +4 -1
  58. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +6 -1
  59. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java +41 -4
  60. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +5 -0
  61. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +95 -0
  62. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +2 -2
  63. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +25 -6
  64. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +33 -23
  65. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +4 -1
  66. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +4 -29
  67. package/ReactCommon/React-Fabric.podspec +12 -13
  68. package/ReactCommon/React-FabricImage.podspec +14 -14
  69. package/ReactCommon/React-Mapbuffer.podspec +2 -2
  70. package/ReactCommon/React-rncore.podspec +2 -3
  71. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  72. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +10 -7
  73. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +7 -4
  74. package/ReactCommon/jsi/React-jsi.podspec +8 -2
  75. package/ReactCommon/react/bridging/Object.h +1 -1
  76. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +3 -1
  77. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +18 -6
  78. package/ReactCommon/react/renderer/attributedstring/conversions.h +6 -0
  79. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +31 -3
  80. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -1
  81. package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +46 -10
  82. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +2 -3
  83. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +11 -16
  84. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +6 -4
  85. package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +2 -1
  86. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +17 -17
  87. package/ReactCommon/react/utils/React-utils.podspec +2 -5
  88. package/cli.js +2 -2
  89. package/gradle/libs.versions.toml +1 -1
  90. package/package.json +12 -12
  91. package/scripts/cocoapods/codegen_utils.rb +16 -17
  92. package/scripts/cocoapods/new_architecture.rb +15 -12
  93. package/scripts/cocoapods/utils.rb +83 -49
  94. package/scripts/codegen/generate-legacy-interop-components.js +8 -2
  95. package/scripts/react_native_pods.rb +36 -1
  96. package/sdks/.hermesversion +1 -1
  97. package/sdks/hermes-engine/hermes-engine.podspec +8 -2
  98. package/sdks/hermes-engine/hermes-utils.rb +9 -6
  99. package/sdks/hermes-engine/utils/replace_hermes_version.js +8 -8
  100. package/sdks/hermesc/osx-bin/hermes +0 -0
  101. package/sdks/hermesc/osx-bin/hermesc +0 -0
  102. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  103. package/template/Gemfile +2 -1
  104. package/template/android/app/build.gradle +1 -1
  105. package/template/android/app/src/main/java/com/helloworld/MainApplication.kt +3 -10
  106. package/template/index.js +0 -9
  107. package/template/package.json +2 -2
  108. package/third-party-podspecs/glog.podspec +14 -1
  109. package/types/public/ReactNativeTVTypes.d.ts +25 -25
  110. package/ReactCommon/jsinspector/.clang-tidy +0 -6
  111. package/ReactCommon/jsinspector/InspectorInterfaces.cpp +0 -106
  112. package/ReactCommon/jsinspector/InspectorInterfaces.h +0 -92
@@ -30,7 +30,7 @@ function createAnimatedStyle(
30
30
  const animatedStyles: any = {};
31
31
  for (const key in style) {
32
32
  const value = style[key];
33
- if (key === 'transform') {
33
+ if (value != null && key === 'transform') {
34
34
  animatedStyles[key] =
35
35
  ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform()
36
36
  ? new AnimatedObject(value)
@@ -23,7 +23,7 @@
23
23
  #import <React/RCTSurfaceHostingProxyRootView.h>
24
24
  #import <React/RCTSurfacePresenter.h>
25
25
  #import <ReactCommon/RCTContextContainerHandling.h>
26
- #if USE_HERMES
26
+ #if RCT_USE_HERMES
27
27
  #import <ReactCommon/RCTHermesInstance.h>
28
28
  #else
29
29
  #import <ReactCommon/RCTJscInstance.h>
@@ -195,7 +195,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
195
195
  interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
196
196
  traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
197
197
  {
198
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
198
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
199
199
  }
200
200
  #endif
201
201
 
@@ -295,7 +295,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
295
295
 
296
296
  - (std::shared_ptr<facebook::react::JSEngineInstance>)createJSEngineInstance
297
297
  {
298
- #if USE_HERMES
298
+ #if RCT_USE_HERMES
299
299
  return std::make_shared<facebook::react::RCTHermesInstance>(_reactNativeConfig, nullptr);
300
300
  #else
301
301
  return std::make_shared<facebook::react::RCTJscInstance>();
@@ -21,7 +21,6 @@ folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
21
21
 
22
22
  is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] == "1"
23
23
  use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
24
- use_frameworks = ENV['USE_FRAMEWORKS'] != nil
25
24
 
26
25
  new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
27
26
  is_fabric_enabled = is_new_arch_enabled || ENV["RCT_FABRIC_ENABLED"]
@@ -43,21 +42,7 @@ header_search_paths = [
43
42
  ].concat(use_hermes ? [
44
43
  "$(PODS_ROOT)/Headers/Public/React-hermes",
45
44
  "$(PODS_ROOT)/Headers/Public/hermes-engine"
46
- ] : []).concat(use_frameworks ? [
47
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers/",
48
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx/",
49
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/",
50
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
51
- "$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
52
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
53
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-RuntimeApple/React_RuntimeApple.framework/Headers",
54
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-RuntimeCore/React_RuntimeCore.framework/Headers",
55
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers/",
56
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers/",
57
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/",
58
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-runtimescheduler/React_runtimescheduler.framework/Headers/",
59
- "$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers/",
60
- ] : []).map{|p| "\"#{p}\""}.join(" ")
45
+ ] : [])
61
46
 
62
47
  Pod::Spec.new do |s|
63
48
  s.name = "React-RCTAppDelegate"
@@ -87,18 +72,19 @@ Pod::Spec.new do |s|
87
72
  s.dependency "RCT-Folly"
88
73
  s.dependency "RCTRequired"
89
74
  s.dependency "RCTTypeSafety"
90
- s.dependency "ReactCommon/turbomodule/core"
91
75
  s.dependency "React-RCTNetwork"
92
76
  s.dependency "React-RCTImage"
93
- s.dependency "React-NativeModulesApple"
94
77
  s.dependency "React-CoreModules"
95
78
  s.dependency "React-nativeconfig"
96
- s.dependency "React-runtimescheduler"
97
- s.dependency "React-RCTFabric"
79
+
80
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
81
+ add_dependency(s, "React-NativeModulesApple")
82
+ add_dependency(s, "React-runtimescheduler")
83
+ add_dependency(s, "React-RCTFabric", :framework_name => "RCTFabric")
98
84
 
99
85
  if is_new_arch_enabled
100
- s.dependency "React-RuntimeCore"
101
- s.dependency "React-RuntimeApple"
86
+ add_dependency(s, "React-RuntimeCore")
87
+ add_dependency(s, "React-RuntimeApple")
102
88
  if use_hermes
103
89
  s.dependency "React-RuntimeHermes"
104
90
  end
@@ -111,21 +97,25 @@ Pod::Spec.new do |s|
111
97
  end
112
98
 
113
99
  if is_new_arch_enabled
114
- s.dependency "React-Fabric"
115
- s.dependency "React-graphics"
116
- s.dependency "React-utils"
117
- s.dependency "React-debug"
118
- s.dependency "React-rendererdebug"
100
+ add_dependency(s, "React-Fabric", :additional_framework_paths => ["react/renderer/components/view/platform/cxx"])
101
+ add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"])
102
+ add_dependency(s, "React-utils")
103
+ add_dependency(s, "React-debug")
104
+ add_dependency(s, "React-rendererdebug")
105
+
106
+ rel_path_from_pods_root_to_app = Pathname.new(ENV['APP_PATH']).relative_path_from(Pod::Config.instance.installation_root)
107
+ rel_path_from_pods_to_app = Pathname.new(ENV['APP_PATH']).relative_path_from(File.join(Pod::Config.instance.installation_root, 'Pods'))
108
+
119
109
 
120
110
  s.script_phases = {
121
111
  :name => "Generate Legacy Components Interop",
122
112
  :script => "
123
113
  WITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"
124
114
  source $WITH_ENVIRONMENT
125
- ${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{ENV['APP_PATH']} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate
115
+ ${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{rel_path_from_pods_to_app} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate
126
116
  ",
127
117
  :execution_position => :before_compile,
128
- :input_files => ["#{ENV['APP_PATH']}/react-native.config.js"],
118
+ :input_files => ["#{rel_path_from_pods_root_to_app}/react-native.config.js"],
129
119
  :output_files => ["${REACT_NATIVE_PATH}/Libraries/AppDelegate/RCTLegacyInteropComponents.mm"],
130
120
  }
131
121
  end
@@ -22,16 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
32
- ])
33
- end
34
-
35
27
  Pod::Spec.new do |s|
36
28
  s.name = "React-RCTBlob"
37
29
  s.version = version
@@ -52,12 +44,14 @@ Pod::Spec.new do |s|
52
44
  }
53
45
 
54
46
  s.dependency "RCT-Folly", folly_version
55
- s.dependency "React-Codegen", version
56
- s.dependency "ReactCommon/turbomodule/core", version
57
- s.dependency "React-jsi", version
58
- s.dependency "React-Core/RCTBlobHeaders", version
59
- s.dependency "React-Core/RCTWebSocket", version
60
- s.dependency "React-RCTNetwork", version
47
+ s.dependency "React-jsi"
48
+ s.dependency "React-Core/RCTBlobHeaders"
49
+ s.dependency "React-Core/RCTWebSocket"
50
+ s.dependency "React-RCTNetwork"
51
+
52
+ add_dependency(s, "React-Codegen")
53
+ add_dependency(s, "React-NativeModulesApple")
54
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
61
55
 
62
56
  if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
63
57
  s.dependency "hermes-engine"
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
15
  patch: 0,
16
- prerelease: '0rc0',
16
+ prerelease: '0rc2',
17
17
  };
@@ -22,15 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
32
- ])
33
- end
34
27
 
35
28
  Pod::Spec.new do |s|
36
29
  s.name = "React-RCTImage"
@@ -54,10 +47,13 @@ Pod::Spec.new do |s|
54
47
  s.framework = ["Accelerate", "UIKit"]
55
48
 
56
49
  s.dependency "RCT-Folly", folly_version
57
- s.dependency "React-Codegen", version
58
- s.dependency "RCTTypeSafety", version
59
- s.dependency "ReactCommon/turbomodule/core", version
60
- s.dependency "React-jsi", version
61
- s.dependency "React-Core/RCTImageHeaders", version
62
- s.dependency "React-RCTNetwork", version
50
+ s.dependency "RCTTypeSafety"
51
+ s.dependency "React-jsi"
52
+ s.dependency "React-Core/RCTImageHeaders"
53
+ s.dependency "React-RCTNetwork"
54
+
55
+ add_dependency(s, "React-Codegen")
56
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
57
+ add_dependency(s, "React-NativeModulesApple")
58
+
63
59
  end
@@ -22,19 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
32
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
33
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
34
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\""
35
- ])
36
- end
37
-
38
27
  Pod::Spec.new do |s|
39
28
  s.name = "React-RCTLinking"
40
29
  s.version = version
@@ -55,8 +44,11 @@ Pod::Spec.new do |s|
55
44
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
56
45
  }
57
46
 
58
- s.dependency "React-Codegen", version
59
47
  s.dependency "React-Core/RCTLinkingHeaders", version
60
48
  s.dependency "ReactCommon/turbomodule/core", version
61
49
  s.dependency "React-jsi", version
50
+
51
+ add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
52
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
53
+ add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
62
54
  end
@@ -30,6 +30,7 @@ export type LogData = $ReadOnly<{|
30
30
  message: Message,
31
31
  category: Category,
32
32
  componentStack: ComponentStack,
33
+ stack?: string,
33
34
  |}>;
34
35
 
35
36
  export type Observer = (
@@ -198,7 +199,7 @@ export function addLog(log: LogData): void {
198
199
  // otherwise spammy logs would pause rendering.
199
200
  setImmediate(() => {
200
201
  try {
201
- const stack = parseErrorStack(errorForStackTrace?.stack);
202
+ const stack = parseErrorStack(log.stack ?? errorForStackTrace?.stack);
202
203
 
203
204
  appendNewLog(
204
205
  new LogBoxLog({
@@ -22,16 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
32
- ])
33
- end
34
-
35
27
  Pod::Spec.new do |s|
36
28
  s.name = "React-RCTAnimation"
37
29
  s.version = version
@@ -52,9 +44,11 @@ Pod::Spec.new do |s|
52
44
  }
53
45
 
54
46
  s.dependency "RCT-Folly", folly_version
55
- s.dependency "React-Codegen", version
56
- s.dependency "RCTTypeSafety", version
57
- s.dependency "ReactCommon/turbomodule/core", version
58
- s.dependency "React-jsi", version
59
- s.dependency "React-Core/RCTAnimationHeaders", version
47
+ s.dependency "RCTTypeSafety"
48
+ s.dependency "React-jsi"
49
+ s.dependency "React-Core/RCTAnimationHeaders"
50
+
51
+ add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
52
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
53
+ add_dependency(s, "React-NativeModulesApple")
60
54
  end
@@ -55,14 +55,20 @@ export function get<Config>(
55
55
  ): HostComponent<Config> {
56
56
  ReactNativeViewConfigRegistry.register(name, () => {
57
57
  const {native, strict, verify} = getRuntimeConfig?.(name) ?? {
58
- native: true,
58
+ native: !global.RN$Bridgeless,
59
59
  strict: false,
60
60
  verify: false,
61
61
  };
62
62
 
63
- const viewConfig = native
64
- ? getNativeComponentAttributes(name)
65
- : createViewConfig(viewConfigProvider());
63
+ let viewConfig;
64
+ if (native) {
65
+ viewConfig = getNativeComponentAttributes(name);
66
+ } else {
67
+ viewConfig = createViewConfig(viewConfigProvider());
68
+ if (viewConfig == null) {
69
+ viewConfig = getNativeComponentAttributes(name);
70
+ }
71
+ }
66
72
 
67
73
  if (verify) {
68
74
  const nativeViewConfig = native
@@ -22,20 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
32
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
33
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
34
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"",
35
-
36
- ])
37
- end
38
-
39
27
  Pod::Spec.new do |s|
40
28
  s.name = "React-RCTNetwork"
41
29
  s.version = version
@@ -57,9 +45,11 @@ Pod::Spec.new do |s|
57
45
  s.frameworks = "MobileCoreServices"
58
46
 
59
47
  s.dependency "RCT-Folly", folly_version
60
- s.dependency "React-Codegen", version
61
- s.dependency "RCTTypeSafety", version
62
- s.dependency "ReactCommon/turbomodule/core", version
63
- s.dependency "React-jsi", version
64
- s.dependency "React-Core/RCTNetworkHeaders", version
48
+ s.dependency "RCTTypeSafety"
49
+ s.dependency "React-jsi"
50
+ s.dependency "React-Core/RCTNetworkHeaders"
51
+
52
+ add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
53
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
54
+ add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
65
55
  end
@@ -22,16 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
32
- ])
33
- end
34
-
35
27
  Pod::Spec.new do |s|
36
28
  s.name = "React-RCTPushNotification"
37
29
  s.version = version
@@ -53,9 +45,11 @@ Pod::Spec.new do |s|
53
45
  }
54
46
  s.framework = "UserNotifications"
55
47
 
56
- s.dependency "React-Codegen", version
57
- s.dependency "RCTTypeSafety", version
58
- s.dependency "React-Core/RCTPushNotificationHeaders", version
59
- s.dependency "ReactCommon/turbomodule/core", version
60
- s.dependency "React-jsi", version
48
+ s.dependency "RCTTypeSafety"
49
+ s.dependency "React-Core/RCTPushNotificationHeaders"
50
+ s.dependency "React-jsi"
51
+
52
+ add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
53
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
54
+ add_dependency(s, "React-NativeModulesApple")
61
55
  end
@@ -22,19 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
32
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
33
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
34
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"",
35
- ])
36
- end
37
-
38
27
  Pod::Spec.new do |s|
39
28
  s.name = "React-RCTSettings"
40
29
  s.version = version
@@ -56,9 +45,11 @@ Pod::Spec.new do |s|
56
45
  }
57
46
 
58
47
  s.dependency "RCT-Folly", folly_version
59
- s.dependency "React-Codegen", version
60
- s.dependency "RCTTypeSafety", version
61
- s.dependency "ReactCommon/turbomodule/core", version
62
- s.dependency "React-jsi", version
63
- s.dependency "React-Core/RCTSettingsHeaders", version
48
+ s.dependency "RCTTypeSafety"
49
+ s.dependency "React-jsi"
50
+ s.dependency "React-Core/RCTSettingsHeaders"
51
+
52
+ add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
53
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
54
+ add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
64
55
  end
@@ -22,18 +22,8 @@ folly_version = '2022.05.16.00'
22
22
  header_search_paths = [
23
23
  "\"$(PODS_ROOT)/RCT-Folly\"",
24
24
  "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
25
- "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
26
25
  ]
27
26
 
28
- if ENV["USE_FRAMEWORKS"]
29
- header_search_paths = header_search_paths.concat([
30
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
31
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
32
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
33
- "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\""
34
- ])
35
- end
36
-
37
27
  Pod::Spec.new do |s|
38
28
  s.name = "React-RCTVibration"
39
29
  s.version = version
@@ -56,8 +46,10 @@ Pod::Spec.new do |s|
56
46
  s.frameworks = "AudioToolbox"
57
47
 
58
48
  s.dependency "RCT-Folly", folly_version
59
- s.dependency "React-Codegen", version
60
- s.dependency "ReactCommon/turbomodule/core", version
61
- s.dependency "React-jsi", version
62
- s.dependency "React-Core/RCTVibrationHeaders", version
49
+ s.dependency "React-jsi"
50
+ s.dependency "React-Core/RCTVibrationHeaders"
51
+
52
+ add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
53
+ add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
54
+ add_dependency(s, "React-NativeModulesApple")
63
55
  end
@@ -10,6 +10,8 @@
10
10
 
11
11
  import typeof {enable} from 'promise/setimmediate/rejection-tracking';
12
12
 
13
+ import LogBox from './LogBox/LogBox';
14
+
13
15
  let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
14
16
  allRejections: true,
15
17
  onUnhandled: (id, rejection = {}) => {
@@ -34,17 +36,29 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
34
36
  }
35
37
  }
36
38
 
37
- const warning =
38
- `Possible Unhandled Promise Rejection (id: ${id}):\n` +
39
- `${message ?? ''}\n` +
40
- (stack == null ? '' : stack);
41
- console.warn(warning);
39
+ const warning = `Possible unhandled promise rejection (id: ${id}):\n${
40
+ message ?? ''
41
+ }`;
42
+ if (__DEV__) {
43
+ LogBox.addLog({
44
+ level: 'warn',
45
+ message: {
46
+ content: warning,
47
+ substitutions: [],
48
+ },
49
+ componentStack: [],
50
+ stack,
51
+ category: 'possible_unhandled_promise_rejection',
52
+ });
53
+ } else {
54
+ console.warn(warning);
55
+ }
42
56
  },
43
57
  onHandled: id => {
44
58
  const warning =
45
- `Promise Rejection Handled (id: ${id})\n` +
59
+ `Promise rejection handled (id: ${id})\n` +
46
60
  'This means you can ignore any previous messages of the form ' +
47
- `"Possible Unhandled Promise Rejection (id: ${id}):"`;
61
+ `"Possible unhandled promise rejection (id: ${id}):"`;
48
62
  console.warn(warning);
49
63
  },
50
64
  };
package/README.md CHANGED
@@ -29,12 +29,6 @@ As of the 0.71 release, Hermes is fully working on both Apple TV and Android TV,
29
29
 
30
30
  Typescript types for TV-specific components and APIs have been added to `types/public`.
31
31
 
32
- A minimal Typescript starter template can be used to start a new project using the community react-native CLI (see below for more information on the CLI).
33
-
34
- ```sh
35
- react-native init TestApp --template=react-native-template-typescript-tv
36
- ```
37
-
38
32
  ## General support for TV
39
33
 
40
34
  TV device support has been implemented with the intention of making existing React Native applications "just work" on TV, with few or no changes needed in the JavaScript code for the applications.
@@ -49,33 +43,33 @@ You should also install `yarn` globally, as it should be used instead of `npm` f
49
43
  - _Native layer for Apple TV_: React Native Xcode projects all now have Apple TV build targets, with names ending in the string '-tvOS'.
50
44
  - _Maven artifacts for Android TV_: In 0.71, the React Native Android prebuilt archives are published to Maven instead of being included in the NPM. We are following the same model, except that the Maven artifacts will be in group `io.github.react-native-tvos` instead of `com.facebook.react`. The `@react-native/gradle-plugin` module has been upgraded so that the Android dependencies will be detected correctly during build.
51
45
 
52
- ## New project creation
46
+ ## New project creation and using the Expo CLI
47
+
48
+ > _Pitfall:_ Make sure you do not globally install `react-native` or `react-native-tvos`. If you have done this the wrong way, you may get error messages like `ld: library not found for -lPods-TestApp-tvOS`.
53
49
 
54
- > _Pitfall:_ Make sure you do not globally install `react-native` or `react-native-tvos`. You should only install `@react-native-community/cli` to use the commands below. If you have done this the wrong way, you may get error messages like `ld: library not found for -lPods-TestApp-tvOS`.
50
+ We strongly recommend [Yarn](https://classic.yarnpkg.com/en/docs/install) as the package manager.
55
51
 
56
- Creating a new project that uses this package is done using the react-native CLI. New projects created this way will automatically have properly configured Apple TV targets created in their XCode projects. To use this NPM package in a new project, you can reference it as in the following example using the React Native community CLI:
52
+ To create a new project, use `yarn create react-native-app` as shown below. (This will install the Expo tool `create-react-native-app` for you if it is not already present.)
53
+
54
+ New projects created this way will automatically have properly configured iPhone and Apple TV targets created in their XCode projects, and will have the Android manifest correctly configured for both Android phone and Android TV. New projects are set up to use the Expo CLI; the Expo dependency and `react-native.config.js` are included in the new app template.
57
55
 
58
56
  ```sh
59
- # Make sure you have the CLI installed globally (this only needs to be done once on your system)
60
- npm install -g @react-native-community/cli
61
57
  # Init an app called 'TestApp', note that you must not be in a node module (directory with node_modules sub-directory) for this to work
62
- react-native init TestApp --template=react-native-tvos@latest
63
- # Now start the app in the tvOS Simulator - this will only work on a macOS machine
64
- cd TestApp && react-native run-ios --simulator "Apple TV" --scheme "TestApp-tvOS"
65
- # The Expo CLI may also be used -- see below for more details
58
+ yarn create react-native-app TestApp --template https://github.com/react-native-tvos/react-native-template-typescript-tv/tree/tv-release-0.73.0 --template-path template
59
+ cd TestApp
60
+ # Now build and start the app in the tvOS Simulator - this will only work on a macOS machine.
61
+ # This command can also be run via "yarn tvos".
62
+ npx expo run:ios --scheme MyApp-tvOS --device "Apple TV"
63
+ # You can also build and start the app on an iOS phone simulator.
64
+ # This command can also be run via "yarn ios".
65
+ npx expo run:ios
66
+ # or specify a simulator:
67
+ npx expo run:ios --scheme MyApp --device "iPhone 15"
68
+ # This command builds and starts the app in an Android TV emulator or a phone emulator (needs to be created in advance).
69
+ # This command can also be run via "yarn android".
70
+ npx expo run:android --device tv_api_31
66
71
  ```
67
72
 
68
- ## Expo CLI support
69
-
70
- To run Apple TV (and Android TV) targets from the command line, it is now possible to use the Expo CLI, using the following steps:
71
-
72
- - In your app, install the required Expo module: `yarn add expo`
73
- - Add a file `react-native.config.js` at the top level of your app directory, with [these contents](https://github.com/byCedric/custom-prebuild-example/blob/main/app/react-native.config.js).
74
- - Then an Apple TV target can be run: `npx expo run:ios --scheme MyApp-tvOS --device "Apple TV"`
75
- - To run Android TV: `npx expo run:android`
76
-
77
- The Expo dependency and `react-native.config.js` are included in the new app template.
78
-
79
73
  See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. (Note that many of these features require that Expo SDK modules be built into your app, which is not yet supported on Apple TV.)
80
74
 
81
75
  ## Code changes
@@ -351,6 +351,11 @@ using namespace facebook;
351
351
  return (RCTUIManager *)_uiManagerProxy;
352
352
  }
353
353
 
354
+ - (RCTBridgeProxy *)object
355
+ {
356
+ return self;
357
+ }
358
+
354
359
  /**
355
360
  * NSProxy setup
356
361
  */
@@ -387,12 +392,14 @@ using namespace facebook;
387
392
 
388
393
  @implementation RCTUIManagerProxy {
389
394
  RCTViewRegistry *_viewRegistry;
395
+ NSMutableDictionary<NSNumber *, UIView *> *_legacyViewRegistry;
390
396
  }
391
397
  - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
392
398
  {
393
399
  self = [super self];
394
400
  if (self) {
395
401
  _viewRegistry = viewRegistry;
402
+ _legacyViewRegistry = [NSMutableDictionary new];
396
403
  }
397
404
  return self;
398
405
  }
@@ -404,20 +411,21 @@ using namespace facebook;
404
411
  {
405
412
  [self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
406
413
  cmd:_cmd];
407
- return [_viewRegistry viewForReactTag:reactTag];
414
+ return [_viewRegistry viewForReactTag:reactTag] ? [_viewRegistry viewForReactTag:reactTag]
415
+ : [_legacyViewRegistry objectForKey:reactTag];
408
416
  }
409
417
 
410
418
  - (void)addUIBlock:(RCTViewManagerUIBlock)block
411
419
  {
412
420
  [self
413
421
  logWarning:
414
- @"This method isn't implemented faithfully: the viewRegistry passed to RCTViewManagerUIBlock is nil. Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
422
+ @"This method isn't implemented faithfully. Please migrate to RCTViewRegistry if possible: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
415
423
  cmd:_cmd];
416
424
  __weak __typeof(self) weakSelf = self;
417
425
  RCTExecuteOnMainQueue(^{
418
426
  __typeof(self) strongSelf = weakSelf;
419
427
  if (strongSelf) {
420
- block((RCTUIManager *)strongSelf, nil);
428
+ block((RCTUIManager *)strongSelf, strongSelf->_legacyViewRegistry);
421
429
  }
422
430
  });
423
431
  }