react-native 0.81.0-rc.0 → 0.81.0-rc.2

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 (124) hide show
  1. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  2. package/Libraries/Blob/React-RCTBlob.podspec +1 -0
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Libraries/Image/React-RCTImage.podspec +1 -0
  5. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -0
  6. package/Libraries/Network/React-RCTNetwork.podspec +1 -0
  7. package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +4 -1
  8. package/Libraries/Settings/React-RCTSettings.podspec +1 -0
  9. package/Libraries/Vibration/React-RCTVibration.podspec +1 -0
  10. package/React/Base/RCTVersion.m +1 -1
  11. package/React/CoreModules/React-CoreModules.podspec +1 -0
  12. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +6 -0
  13. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +9 -0
  14. package/React/React-RCTFBReactNativeSpec.podspec +1 -0
  15. package/React/React-RCTFabric.podspec +1 -0
  16. package/React/Runtime/React-RCTRuntime.podspec +1 -0
  17. package/React-Core-prebuilt.podspec +2 -3
  18. package/React-Core.podspec +1 -4
  19. package/ReactAndroid/api/ReactAndroid.api +1 -1
  20. package/ReactAndroid/build.gradle.kts +2 -0
  21. package/ReactAndroid/gradle.properties +1 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +1 -0
  23. package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.kt +1 -0
  24. package/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.kt +2 -0
  25. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +36 -27
  26. package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +4 -0
  27. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +7 -2
  28. package/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.kt +4 -0
  29. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +5 -5
  30. package/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.kt +3 -3
  31. package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.kt +1 -0
  32. package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt +2 -0
  33. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java +0 -2
  34. package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +18 -9
  35. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapperBase.kt +2 -0
  36. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt +1 -0
  37. package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java +4 -2
  38. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +2 -0
  39. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +2 -0
  40. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -1
  41. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
  42. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
  44. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +2 -2
  46. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
  47. package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.kt +1 -1
  48. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  49. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerPropertyUpdater.kt +1 -2
  50. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/UIManagerType.kt +0 -2
  51. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -1
  52. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
  53. package/ReactCommon/React-Fabric.podspec +2 -1
  54. package/ReactCommon/React-FabricComponents.podspec +1 -0
  55. package/ReactCommon/React-FabricImage.podspec +1 -0
  56. package/ReactCommon/React-Mapbuffer.podspec +1 -1
  57. package/ReactCommon/ReactCommon.podspec +2 -1
  58. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -0
  59. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  60. package/ReactCommon/hermes/React-hermes.podspec +1 -0
  61. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +2 -1
  62. package/ReactCommon/jsi/React-jsi.podspec +1 -0
  63. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -0
  64. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -0
  65. package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +2 -1
  66. package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +2 -1
  67. package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +2 -1
  68. package/ReactCommon/jsitooling/React-jsitooling.podspec +2 -1
  69. package/ReactCommon/logger/React-logger.podspec +1 -0
  70. package/ReactCommon/react/debug/React-debug.podspec +1 -1
  71. package/ReactCommon/react/featureflags/React-featureflags.podspec +2 -1
  72. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  73. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  74. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +30 -12
  75. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -2
  76. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  77. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -1
  78. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +4 -2
  79. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  80. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +2 -1
  81. package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
  82. package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -0
  83. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  84. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  85. package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -0
  86. package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -0
  87. package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -0
  88. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -0
  89. package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +2 -1
  90. package/ReactCommon/react/renderer/core/ShadowNodeTraits.h +9 -0
  91. package/ReactCommon/react/renderer/css/React-renderercss.podspec +2 -2
  92. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +2 -1
  93. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +2 -1
  94. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
  95. package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +37 -11
  96. package/ReactCommon/react/renderer/mounting/ShadowTree.h +2 -1
  97. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +2 -1
  98. package/ReactCommon/react/runtime/React-RuntimeCore.podspec +2 -1
  99. package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +2 -1
  100. package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +2 -1
  101. package/ReactCommon/react/utils/React-utils.podspec +2 -1
  102. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
  103. package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +2 -1
  104. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +13 -10
  105. package/ReactCommon/yoga/yoga/node/Node.cpp +28 -0
  106. package/ReactCommon/yoga/yoga/node/Node.h +6 -4
  107. package/package.json +11 -10
  108. package/scripts/cocoapods/new_architecture.rb +1 -0
  109. package/scripts/cocoapods/rncore.rb +26 -9
  110. package/scripts/cocoapods/rndependencies.rb +6 -1
  111. package/scripts/cocoapods/utils.rb +16 -8
  112. package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -0
  113. package/scripts/replace-rncore-version.js +120 -0
  114. package/sdks/hermes-engine/hermes-utils.rb +6 -1
  115. package/sdks/hermesc/osx-bin/hermes +0 -0
  116. package/sdks/hermesc/osx-bin/hermesc +0 -0
  117. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  118. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  119. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  120. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
  121. package/src/private/featureflags/ReactNativeFeatureFlags.js +6 -1
  122. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
  123. package/third-party-podspecs/replace_dependencies_version.js +19 -0
  124. package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/DeprecatedInNewArchitecture.kt +0 -16
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
84
84
 
85
85
  depend_on_js_engine(s)
86
86
  add_rn_third_party_dependencies(s)
87
+ add_rncore_dependency(s)
87
88
  end
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
55
55
  end
56
56
 
57
57
  add_rn_third_party_dependencies(s)
58
+ add_rncore_dependency(s)
58
59
  end
@@ -18,5 +18,5 @@ export const version: $ReadOnly<{
18
18
  major: 0,
19
19
  minor: 81,
20
20
  patch: 0,
21
- prerelease: 'rc.0',
21
+ prerelease: 'rc.2',
22
22
  };
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
53
53
  add_dependency(s, "React-NativeModulesApple")
54
54
 
55
55
  add_rn_third_party_dependencies(s)
56
+ add_rncore_dependency(s)
56
57
  end
@@ -50,4 +50,5 @@ Pod::Spec.new do |s|
50
50
  add_dependency(s, "React-featureflags")
51
51
 
52
52
  add_rn_third_party_dependencies(s)
53
+ add_rncore_dependency(s)
53
54
  end
@@ -52,4 +52,5 @@ Pod::Spec.new do |s|
52
52
  add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
53
53
 
54
54
  add_rn_third_party_dependencies(s)
55
+ add_rncore_dependency(s)
55
56
  end
@@ -18,6 +18,7 @@ end
18
18
 
19
19
  header_search_paths = [
20
20
  "\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
21
+ "\"${PODS_ROOT}/Headers/Public/React-RCTFBReactNativeSpec/FBReactNativeSpec\"",
21
22
  ]
22
23
 
23
24
  Pod::Spec.new do |s|
@@ -45,7 +46,9 @@ Pod::Spec.new do |s|
45
46
  s.dependency "React-Core/RCTPushNotificationHeaders"
46
47
  s.dependency "React-jsi"
47
48
 
48
- add_dependency(s, "React-RCTFBReactNativeSpec")
49
+ add_dependency(s, "React-RCTFBReactNativeSpec", :additional_framework_paths => ['FBReactNativeSpec'])
49
50
  add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
50
51
  add_dependency(s, "React-NativeModulesApple")
52
+
53
+ add_rncore_dependency(s)
51
54
  end
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
49
49
  add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
50
50
 
51
51
  add_rn_third_party_dependencies(s)
52
+ add_rncore_dependency(s)
52
53
  end
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
49
49
  add_dependency(s, "React-NativeModulesApple")
50
50
 
51
51
  add_rn_third_party_dependencies(s)
52
+ add_rncore_dependency(s)
52
53
  end
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(81),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"rc.2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -63,4 +63,5 @@ Pod::Spec.new do |s|
63
63
  add_dependency(s, "React-NativeModulesApple")
64
64
 
65
65
  add_rn_third_party_dependencies(s)
66
+ add_rncore_dependency(s)
66
67
  end
@@ -322,6 +322,11 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_prepare
322
322
  rt
323
323
  );
324
324
  }
325
+ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preventShadowTreeCommitExhaustionWithLocking(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
326
+ return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->preventShadowTreeCommitExhaustionWithLocking(
327
+ rt
328
+ );
329
+ }
325
330
  static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
326
331
  return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->traceTurboModulePromiseRejectionsOnAndroid(
327
332
  rt
@@ -428,6 +433,7 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI
428
433
  methodMap_["fuseboxNetworkInspectionEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxNetworkInspectionEnabled};
429
434
  methodMap_["hideOffscreenVirtualViewsOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_hideOffscreenVirtualViewsOnIOS};
430
435
  methodMap_["preparedTextCacheSize"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preparedTextCacheSize};
436
+ methodMap_["preventShadowTreeCommitExhaustionWithLocking"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preventShadowTreeCommitExhaustionWithLocking};
431
437
  methodMap_["traceTurboModulePromiseRejectionsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid};
432
438
  methodMap_["updateRuntimeShadowNodeReferencesOnCommit"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit};
433
439
  methodMap_["useAlwaysAvailableJSErrorHandling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling};
@@ -374,6 +374,7 @@ public:
374
374
  virtual bool fuseboxNetworkInspectionEnabled(jsi::Runtime &rt) = 0;
375
375
  virtual bool hideOffscreenVirtualViewsOnIOS(jsi::Runtime &rt) = 0;
376
376
  virtual double preparedTextCacheSize(jsi::Runtime &rt) = 0;
377
+ virtual bool preventShadowTreeCommitExhaustionWithLocking(jsi::Runtime &rt) = 0;
377
378
  virtual bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) = 0;
378
379
  virtual bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) = 0;
379
380
  virtual bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) = 0;
@@ -799,6 +800,14 @@ private:
799
800
  return bridging::callFromJs<double>(
800
801
  rt, &T::preparedTextCacheSize, jsInvoker_, instance_);
801
802
  }
803
+ bool preventShadowTreeCommitExhaustionWithLocking(jsi::Runtime &rt) override {
804
+ static_assert(
805
+ bridging::getParameterCount(&T::preventShadowTreeCommitExhaustionWithLocking) == 1,
806
+ "Expected preventShadowTreeCommitExhaustionWithLocking(...) to have 1 parameters");
807
+
808
+ return bridging::callFromJs<bool>(
809
+ rt, &T::preventShadowTreeCommitExhaustionWithLocking, jsInvoker_, instance_);
810
+ }
802
811
  bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) override {
803
812
  static_assert(
804
813
  bridging::getParameterCount(&T::traceTurboModulePromiseRejectionsOnAndroid) == 1,
@@ -61,6 +61,7 @@ Pod::Spec.new do |s|
61
61
 
62
62
  depend_on_js_engine(s)
63
63
  add_rn_third_party_dependencies(s)
64
+ add_rncore_dependency(s)
64
65
 
65
66
  s.subspec "components" do |ss|
66
67
  ss.source_files = podspec_sources("FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{m,mm,cpp,h}", "FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{h}")
@@ -97,6 +97,7 @@ Pod::Spec.new do |s|
97
97
 
98
98
  depend_on_js_engine(s)
99
99
  add_rn_third_party_dependencies(s)
100
+ add_rncore_dependency(s)
100
101
 
101
102
  s.test_spec 'Tests' do |test_spec|
102
103
  test_spec.source_files = podspec_sources("Tests/**/*.{mm}", "")
@@ -68,4 +68,5 @@ Pod::Spec.new do |s|
68
68
 
69
69
  depend_on_js_engine(s)
70
70
  add_rn_third_party_dependencies(s)
71
+ add_rncore_dependency(s)
71
72
  end
@@ -62,8 +62,7 @@ Pod::Spec.new do |s|
62
62
  CONFIG="Debug"
63
63
  fi
64
64
 
65
- # TODO(T228219721): Add this for React Native Core as well
66
- ##### "$NODE_BINARY" "$REACT_NATIVE_PATH/third-party-podspecs/replace_dependencies_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
65
+ "$NODE_BINARY" "$REACT_NATIVE_PATH/scripts/replace-rncore-version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
67
66
  EOS
68
67
  }
69
68
 
@@ -73,7 +72,7 @@ Pod::Spec.new do |s|
73
72
  # always run the script without warning
74
73
  script_phase[:always_out_of_date] = "1"
75
74
  end
76
-
75
+
77
76
  s.script_phase = script_phase
78
77
  end
79
78
  end
@@ -83,10 +83,6 @@ Pod::Spec.new do |s|
83
83
  ss.exclude_files = exclude_files
84
84
  ss.private_header_files = "React/Cxx*/*.h"
85
85
 
86
- # Include prebuilt if we're not building from source
87
- if !ReactNativeCoreUtils.build_rncore_from_source()
88
- ss.dependency "React-Core-prebuilt", version
89
- end
90
86
  end
91
87
 
92
88
  s.subspec "DevSupport" do |ss|
@@ -137,4 +133,5 @@ Pod::Spec.new do |s|
137
133
 
138
134
  depend_on_js_engine(s)
139
135
  add_rn_third_party_dependencies(s)
136
+ add_rncore_dependency(s)
140
137
  end
@@ -353,7 +353,7 @@ public abstract class com/facebook/react/ReactNativeHost {
353
353
  }
354
354
 
355
355
  public abstract interface class com/facebook/react/ReactPackage {
356
- public abstract fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
356
+ public fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
357
357
  public abstract fun createViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
358
358
  public fun getModule (Ljava/lang/String;Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/NativeModule;
359
359
  }
@@ -112,6 +112,8 @@ val preparePrefab by
112
112
  Pair(
113
113
  "../ReactCommon/react/renderer/animations/",
114
114
  "react/renderer/animations/"),
115
+ // react_renderer_bridging
116
+ Pair("../ReactCommon/react/renderer/bridging/", "react/renderer/bridging/"),
115
117
  // react_renderer_componentregistry
116
118
  Pair(
117
119
  "../ReactCommon/react/renderer/componentregistry/",
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.81.0-rc.0
1
+ VERSION_NAME=0.81.0-rc.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -22,6 +22,7 @@ import javax.inject.Provider
22
22
  /** Abstract class that supports lazy loading of NativeModules by default. */
23
23
  public abstract class BaseReactPackage : ReactPackage {
24
24
 
25
+ @Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
25
26
  override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
26
27
  throw UnsupportedOperationException(
27
28
  "createNativeModules method is not supported. Use getModule() method instead.")
@@ -112,6 +112,7 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
112
112
  * simply have a different mechanism for storing a `ReactNativeHost`, e.g. as a static field
113
113
  * somewhere.
114
114
  */
115
+ @Suppress("DEPRECATION")
115
116
  protected val reactNativeHost: ReactNativeHost
116
117
  get() = (application as ReactApplication).reactNativeHost
117
118
 
@@ -92,6 +92,8 @@ public abstract class LazyReactPackage : ReactPackage {
92
92
  * @param reactContext react application context that can be used to create modules
93
93
  * @return A [List]<[NativeModule]> to register
94
94
  */
95
+ @Suppress("DEPRECATION")
96
+ @Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
95
97
  override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
96
98
  buildList {
97
99
  for (holder in getNativeModules(reactContext)) {
@@ -18,20 +18,22 @@ import android.view.KeyEvent;
18
18
  import android.view.Window;
19
19
  import androidx.annotation.Nullable;
20
20
  import com.facebook.infer.annotation.Assertions;
21
+ import com.facebook.infer.annotation.Nullsafe;
21
22
  import com.facebook.react.bridge.Callback;
22
23
  import com.facebook.react.bridge.ReactContext;
23
- import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
24
24
  import com.facebook.react.interfaces.fabric.ReactSurface;
25
25
  import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags;
26
26
  import com.facebook.react.modules.core.PermissionListener;
27
27
  import com.facebook.react.views.view.WindowUtilKt;
28
28
  import com.facebook.systrace.Systrace;
29
+ import java.util.Objects;
29
30
 
30
31
  /**
31
32
  * Delegate class for {@link ReactActivity}. You can subclass this to provide custom implementations
32
33
  * for e.g. {@link #getReactNativeHost()}, if your Application class doesn't implement {@link
33
34
  * ReactApplication}.
34
35
  */
36
+ @Nullsafe(Nullsafe.Mode.LOCAL)
35
37
  public class ReactActivityDelegate {
36
38
 
37
39
  private final @Nullable Activity mActivity;
@@ -86,8 +88,11 @@ public class ReactActivityDelegate {
86
88
  * ReactApplication#getReactNativeHost()}. Override this method if your application class does not
87
89
  * implement {@code ReactApplication} or you simply have a different mechanism for storing a
88
90
  * {@code ReactNativeHost}, e.g. as a static field somewhere.
91
+ *
92
+ * @deprecated "Do not access {@link ReactNativeHost} directly. This class is going away in the
93
+ * New Architecture. You should access {@link ReactHost} instead."
89
94
  */
90
- @DeprecatedInNewArchitecture(message = "Use getReactHost()")
95
+ @Deprecated
91
96
  protected ReactNativeHost getReactNativeHost() {
92
97
  return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();
93
98
  }
@@ -107,16 +112,21 @@ public class ReactActivityDelegate {
107
112
  return mReactDelegate;
108
113
  }
109
114
 
110
- @DeprecatedInNewArchitecture(message = "Use getReactHost()")
115
+ /**
116
+ * @deprecated @deprecated "Do not access {@link ReactInstanceManager} directly. This class is
117
+ * going away in the New Architecture. You should access {@link ReactHost} instead."
118
+ * @noinspection deprecation
119
+ */
111
120
  public ReactInstanceManager getReactInstanceManager() {
112
- return mReactDelegate.getReactInstanceManager();
121
+ return Objects.requireNonNull(mReactDelegate).getReactInstanceManager();
113
122
  }
114
123
 
124
+ @Nullable
115
125
  public String getMainComponentName() {
116
126
  return mMainComponentName;
117
127
  }
118
128
 
119
- public void onCreate(Bundle savedInstanceState) {
129
+ public void onCreate(@Nullable Bundle savedInstanceState) {
120
130
  Systrace.traceSection(
121
131
  Systrace.TRACE_TAG_REACT,
122
132
  "ReactActivityDelegate.onCreate::init",
@@ -147,6 +157,7 @@ public class ReactActivityDelegate {
147
157
  launchOptions,
148
158
  isFabricEnabled()) {
149
159
  @Override
160
+ @Nullable
150
161
  protected ReactRootView createRootView() {
151
162
  ReactRootView rootView = ReactActivityDelegate.this.createRootView();
152
163
  if (rootView == null) {
@@ -162,31 +173,29 @@ public class ReactActivityDelegate {
162
173
  });
163
174
  }
164
175
 
165
- protected void loadApp(String appKey) {
166
- mReactDelegate.loadApp(appKey);
176
+ protected void loadApp(@Nullable String appKey) {
177
+ Objects.requireNonNull(mReactDelegate).loadApp(Objects.requireNonNull(appKey));
167
178
  getPlainActivity().setContentView(mReactDelegate.getReactRootView());
168
179
  }
169
180
 
170
181
  public void setReactSurface(ReactSurface reactSurface) {
171
- mReactDelegate.setReactSurface(reactSurface);
182
+ Objects.requireNonNull(mReactDelegate).setReactSurface(reactSurface);
172
183
  }
173
184
 
174
185
  public void setReactRootView(ReactRootView reactRootView) {
175
- mReactDelegate.setReactRootView(reactRootView);
186
+ Objects.requireNonNull(mReactDelegate).setReactRootView(reactRootView);
176
187
  }
177
188
 
178
189
  public void onUserLeaveHint() {
179
- if (mReactDelegate != null) {
180
- mReactDelegate.onUserLeaveHint();
181
- }
190
+ Objects.requireNonNull(mReactDelegate).onUserLeaveHint();
182
191
  }
183
192
 
184
193
  public void onPause() {
185
- mReactDelegate.onHostPause();
194
+ Objects.requireNonNull(mReactDelegate).onHostPause();
186
195
  }
187
196
 
188
197
  public void onResume() {
189
- mReactDelegate.onHostResume();
198
+ Objects.requireNonNull(mReactDelegate).onHostResume();
190
199
 
191
200
  if (mPermissionsCallback != null) {
192
201
  mPermissionsCallback.invoke();
@@ -195,43 +204,43 @@ public class ReactActivityDelegate {
195
204
  }
196
205
 
197
206
  public void onDestroy() {
198
- mReactDelegate.onHostDestroy();
207
+ Objects.requireNonNull(mReactDelegate).onHostDestroy();
199
208
  }
200
209
 
201
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
202
- mReactDelegate.onActivityResult(requestCode, resultCode, data, true);
210
+ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
211
+ Objects.requireNonNull(mReactDelegate).onActivityResult(requestCode, resultCode, data, true);
203
212
  }
204
213
 
205
214
  public boolean onKeyDown(int keyCode, KeyEvent event) {
206
- return mReactDelegate.onKeyDown(keyCode, event);
215
+ return Objects.requireNonNull(mReactDelegate).onKeyDown(keyCode, event);
207
216
  }
208
217
 
209
218
  public boolean onKeyUp(int keyCode, KeyEvent event) {
210
- return mReactDelegate.shouldShowDevMenuOrReload(keyCode, event);
219
+ return Objects.requireNonNull(mReactDelegate).shouldShowDevMenuOrReload(keyCode, event);
211
220
  }
212
221
 
213
222
  public boolean onKeyLongPress(int keyCode, KeyEvent event) {
214
- return mReactDelegate.onKeyLongPress(keyCode);
223
+ return Objects.requireNonNull(mReactDelegate).onKeyLongPress(keyCode);
215
224
  }
216
225
 
217
226
  public boolean onBackPressed() {
218
- return mReactDelegate.onBackPressed();
227
+ return Objects.requireNonNull(mReactDelegate).onBackPressed();
219
228
  }
220
229
 
221
- public boolean onNewIntent(Intent intent) {
222
- return mReactDelegate.onNewIntent(intent);
230
+ public boolean onNewIntent(@Nullable Intent intent) {
231
+ return Objects.requireNonNull(mReactDelegate).onNewIntent(Objects.requireNonNull(intent));
223
232
  }
224
233
 
225
234
  public void onWindowFocusChanged(boolean hasFocus) {
226
- mReactDelegate.onWindowFocusChanged(hasFocus);
235
+ Objects.requireNonNull(mReactDelegate).onWindowFocusChanged(hasFocus);
227
236
  }
228
237
 
229
238
  public void onConfigurationChanged(Configuration newConfig) {
230
- mReactDelegate.onConfigurationChanged(newConfig);
239
+ Objects.requireNonNull(mReactDelegate).onConfigurationChanged(newConfig);
231
240
  }
232
241
 
233
242
  public void requestPermissions(
234
- String[] permissions, int requestCode, PermissionListener listener) {
243
+ String[] permissions, int requestCode, @Nullable PermissionListener listener) {
235
244
  mPermissionListener = listener;
236
245
  getPlainActivity().requestPermissions(permissions, requestCode);
237
246
  }
@@ -267,7 +276,7 @@ public class ReactActivityDelegate {
267
276
  * context will no longer be valid.
268
277
  */
269
278
  public @Nullable ReactContext getCurrentReactContext() {
270
- return mReactDelegate.getCurrentReactContext();
279
+ return Objects.requireNonNull(mReactDelegate).getCurrentReactContext();
271
280
  }
272
281
 
273
282
  /**
@@ -10,6 +10,10 @@ package com.facebook.react
10
10
  /** Interface that represents an instance of a React Native application */
11
11
  public interface ReactApplication {
12
12
  /** Get the default [ReactNativeHost] for this app. */
13
+ @Suppress("DEPRECATION")
14
+ @Deprecated(
15
+ "You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
16
+ ReplaceWith("reactHost"))
13
17
  public val reactNativeHost: ReactNativeHost
14
18
 
15
19
  /**
@@ -14,7 +14,6 @@ import android.os.Bundle
14
14
  import android.view.KeyEvent
15
15
  import com.facebook.react.bridge.ReactContext
16
16
  import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
17
- import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
18
17
  import com.facebook.react.devsupport.DoubleTapReloadRecognizer
19
18
  import com.facebook.react.devsupport.ReleaseDevSupportManager
20
19
  import com.facebook.react.devsupport.interfaces.DevSupportManager
@@ -26,12 +25,17 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
26
25
  * A delegate for handling React Application support. This delegate is unaware whether it is used in
27
26
  * an [Activity] or a [android.app.Fragment].
28
27
  */
28
+ @Suppress("DEPRECATION")
29
29
  public open class ReactDelegate {
30
30
  private val activity: Activity
31
31
  private var internalReactRootView: ReactRootView? = null
32
32
  private val mainComponentName: String?
33
33
  private var launchOptions: Bundle?
34
34
  private var doubleTapReloadRecognizer: DoubleTapReloadRecognizer?
35
+
36
+ @Deprecated(
37
+ "You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
38
+ ReplaceWith("reactHost"))
35
39
  private var reactNativeHost: ReactNativeHost? = null
36
40
  public var reactHost: ReactHost? = null
37
41
  private set
@@ -380,7 +384,8 @@ public open class ReactDelegate {
380
384
  return false
381
385
  }
382
386
 
383
- @DeprecatedInNewArchitecture(message = "Use reactHost")
387
+ @Deprecated(
388
+ "Do not access [ReactInstanceManager] directly. This class is going away in the New Architecture. You should use [ReactHost] instead.")
384
389
  public fun getReactInstanceManager(): ReactInstanceManager {
385
390
  val nonNullReactNativeHost =
386
391
  checkNotNull(reactNativeHost) {
@@ -58,6 +58,10 @@ public open class ReactFragment : Fragment(), PermissionAwareActivity {
58
58
  * method if your application class does not implement `ReactApplication` or you simply have a
59
59
  * different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
60
60
  */
61
+ @Suppress("DEPRECATION")
62
+ @Deprecated(
63
+ "You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
64
+ ReplaceWith("reactHost"))
61
65
  protected open val reactNativeHost: ReactNativeHost?
62
66
  get() = (activity?.application as ReactApplication?)?.reactNativeHost
63
67
 
@@ -10,6 +10,7 @@ package com.facebook.react;
10
10
  import android.app.Application;
11
11
  import androidx.annotation.Nullable;
12
12
  import com.facebook.infer.annotation.Assertions;
13
+ import com.facebook.infer.annotation.Nullsafe;
13
14
  import com.facebook.react.bridge.JSExceptionHandler;
14
15
  import com.facebook.react.bridge.JavaScriptExecutorFactory;
15
16
  import com.facebook.react.bridge.ReactMarker;
@@ -18,7 +19,6 @@ import com.facebook.react.bridge.UIManagerProvider;
18
19
  import com.facebook.react.common.LifecycleState;
19
20
  import com.facebook.react.common.SurfaceDelegate;
20
21
  import com.facebook.react.common.SurfaceDelegateFactory;
21
- import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
22
22
  import com.facebook.react.common.annotations.internal.LegacyArchitecture;
23
23
  import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
24
24
  import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
@@ -32,12 +32,12 @@ import java.util.List;
32
32
  /**
33
33
  * Simple class that holds an instance of {@link ReactInstanceManager}. This can be used in your
34
34
  * {@link Application class} (see {@link ReactApplication}), or as a static field.
35
+ *
36
+ * @deprecated This class will be replaced by com.facebook.react.ReactHost in the New Architecture.
35
37
  */
36
- @DeprecatedInNewArchitecture(
37
- message =
38
- "This class will be replaced by com.facebook.react.ReactHost in the new architecture of"
39
- + " React Native.")
38
+ @Deprecated
40
39
  @LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
40
+ @Nullsafe(Nullsafe.Mode.LOCAL)
41
41
  public abstract class ReactNativeHost {
42
42
 
43
43
  static {
@@ -10,7 +10,6 @@ package com.facebook.react
10
10
  import com.facebook.react.bridge.NativeModule
11
11
  import com.facebook.react.bridge.ReactApplicationContext
12
12
  import com.facebook.react.bridge.UIManager
13
- import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
14
13
  import com.facebook.react.common.annotations.StableReactNativeAPI
15
14
  import com.facebook.react.uimanager.ViewManager
16
15
 
@@ -34,8 +33,9 @@ public interface ReactPackage {
34
33
  * @return list of native modules to register with the newly created catalyst instance This method
35
34
  * is deprecated in the new Architecture of React Native.
36
35
  */
37
- @DeprecatedInNewArchitecture(message = "Migrate to BaseReactPackage and implement getModule")
38
- public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule>
36
+ @Deprecated(message = "Migrate to [BaseReactPackage] and implement [getModule] instead.")
37
+ public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
38
+ emptyList()
39
39
 
40
40
  /** @return a list of view managers that should be registered with [UIManager] */
41
41
  public fun createViewManagers(
@@ -28,6 +28,7 @@ internal object ReactPackageHelper {
28
28
  FLog.d(
29
29
  ReactConstants.TAG,
30
30
  "${reactPackage.javaClass.simpleName} is not a LazyReactPackage, falling back to old version.")
31
+ @Suppress("DEPRECATION")
31
32
  val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
32
33
  return Iterable {
33
34
  object : Iterator<ModuleHolder> {
@@ -83,6 +83,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
83
83
 
84
84
  if (shouldSupportLegacyPackages()) {
85
85
  // TODO(T145105887): Output warnings that ReactPackage was used
86
+ @Suppress("DEPRECATION")
86
87
  val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
87
88
 
88
89
  val moduleMap: MutableMap<String, NativeModule> = mutableMapOf()
@@ -94,6 +95,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
94
95
 
95
96
  val moduleName = reactModule?.name ?: module.name
96
97
 
98
+ @Suppress("DEPRECATION")
97
99
  val moduleInfo: ReactModuleInfo =
98
100
  if (reactModule != null)
99
101
  ReactModuleInfo(
@@ -16,7 +16,6 @@ import com.facebook.infer.annotation.Nullsafe;
16
16
  import com.facebook.infer.annotation.ThreadConfined;
17
17
  import com.facebook.proguard.annotations.DoNotStrip;
18
18
  import com.facebook.react.common.ReactConstants;
19
- import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
20
19
  import com.facebook.react.common.annotations.StableReactNativeAPI;
21
20
  import com.facebook.react.common.build.ReactBuildConfig;
22
21
  import java.util.Map;
@@ -72,7 +71,6 @@ public abstract class BaseJavaModule implements NativeModule {
72
71
  /**
73
72
  * @return a map of constants this module exports to JS. Supports JSON types.
74
73
  */
75
- @DeprecatedInNewArchitecture()
76
74
  public @Nullable Map<String, Object> getConstants() {
77
75
  return null;
78
76
  }