react-native 0.72.0-rc.2 → 0.72.0-rc.4

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 (67) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.h +5 -0
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +30 -9
  3. package/Libraries/AppDelegate/RCTAppSetupUtils.h +8 -2
  4. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +25 -1
  5. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +16 -0
  6. package/Libraries/Components/TextInput/TextInput.d.ts +121 -86
  7. package/Libraries/Components/TextInput/TextInput.flow.js +121 -135
  8. package/Libraries/Components/TextInput/TextInput.js +121 -135
  9. package/Libraries/Core/ReactNativeVersion.js +1 -1
  10. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +0 -2
  11. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -13
  12. package/React/Base/RCTJavaScriptLoader.mm +11 -1
  13. package/React/Base/RCTRuntimeExecutorFromBridge.h +19 -0
  14. package/React/Base/RCTRuntimeExecutorFromBridge.mm +56 -0
  15. package/React/Base/RCTVersion.m +1 -1
  16. package/React/CxxBridge/RCTCxxBridge.mm +9 -4
  17. package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +12 -1
  18. package/React/Fabric/RCTSurfacePresenter.mm +4 -0
  19. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +0 -3
  20. package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +1 -37
  21. package/React/React-RCTFabric.podspec +14 -1
  22. package/React-Core.podspec +6 -4
  23. package/ReactAndroid/build.gradle +4 -1
  24. package/ReactAndroid/cmake-utils/ReactNative-application.cmake +14 -1
  25. package/ReactAndroid/gradle.properties +1 -1
  26. package/ReactAndroid/hermes-engine/build.gradle +5 -0
  27. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +9 -0
  28. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +7 -0
  29. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  30. package/ReactAndroid/src/main/jni/CMakeLists.txt +0 -1
  31. package/ReactCommon/React-Fabric.podspec +13 -23
  32. package/ReactCommon/ReactCommon.podspec +0 -4
  33. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
  34. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  35. package/ReactCommon/react/debug/React-debug.podspec +36 -0
  36. package/ReactCommon/react/renderer/core/CoreFeatures.cpp +1 -0
  37. package/ReactCommon/react/renderer/core/CoreFeatures.h +4 -0
  38. package/ReactCommon/react/renderer/imagemanager/ImageRequest.h +7 -3
  39. package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp +0 -11
  40. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +5 -0
  41. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequest.cpp +4 -14
  42. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +66 -0
  43. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +2 -1
  44. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +2 -1
  45. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +1 -0
  46. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +2 -1
  47. package/ReactCommon/react/renderer/runtimescheduler/primitives.h +3 -15
  48. package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.h +1 -1
  49. package/ReactCommon/react/utils/React-utils.podspec +57 -0
  50. package/package.json +10 -10
  51. package/scripts/cocoapods/__tests__/codegen_utils-test.rb +7 -2
  52. package/scripts/cocoapods/__tests__/flipper-test.rb +9 -1
  53. package/scripts/cocoapods/__tests__/new_architecture-test.rb +9 -3
  54. package/scripts/cocoapods/__tests__/utils-test.rb +0 -68
  55. package/scripts/cocoapods/codegen_utils.rb +6 -0
  56. package/scripts/cocoapods/flipper.rb +2 -2
  57. package/scripts/cocoapods/new_architecture.rb +13 -0
  58. package/scripts/cocoapods/utils.rb +0 -7
  59. package/scripts/react-native-xcode.sh +1 -1
  60. package/scripts/react_native_pods.rb +6 -6
  61. package/sdks/hermesc/linux64-bin/hermesc +0 -0
  62. package/sdks/hermesc/osx-bin/hermesc +0 -0
  63. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  64. package/template/android/app/build.gradle +0 -7
  65. package/template/ios/Podfile +1 -1
  66. package/template/package.json +6 -6
  67. package/types/experimental.d.ts +101 -0
@@ -46,7 +46,20 @@ target_include_directories(${CMAKE_PROJECT_NAME}
46
46
  ${CMAKE_CURRENT_SOURCE_DIR}
47
47
  ${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni)
48
48
 
49
- target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Werror -fexceptions -frtti -std=c++17 -DWITH_INSPECTOR=1 -DLOG_TAG=\"ReactNative\")
49
+ target_compile_options(${CMAKE_PROJECT_NAME}
50
+ PRIVATE
51
+ -Wall
52
+ -Werror
53
+ # We suppress cpp #error and #warning to don't fail the build
54
+ # due to use migrating away from
55
+ # #include <react/renderer/graphics/conversions.h>
56
+ # This can be removed for React Native 0.73
57
+ -Wno-error=cpp
58
+ -fexceptions
59
+ -frtti
60
+ -std=c++17
61
+ -DWITH_INSPECTOR=1
62
+ -DLOG_TAG=\"ReactNative\")
50
63
 
51
64
  # Prefab packages from React Native
52
65
  find_package(ReactAndroid REQUIRED CONFIG)
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.72.0-rc.2
1
+ VERSION_NAME=0.72.0-rc.4
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -154,6 +154,9 @@ android {
154
154
  // We intentionally build Hermes with Intl support only. This is to simplify
155
155
  // the build setup and to avoid overcomplicating the build-type matrix.
156
156
  arguments "-DHERMES_ENABLE_INTL=True"
157
+ // Due to https://github.com/android/ndk/issues/1693 we're losing Android
158
+ // specific compilation flags. This can be removed once we moved to NDK 25/26
159
+ arguments "-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON"
157
160
  targets "libhermes"
158
161
  }
159
162
  }
@@ -178,6 +181,8 @@ android {
178
181
  // This has the (unlucky) side effect of letting AGP call the build
179
182
  // tasks `configureCMakeRelease` while is actually building the debug flavor.
180
183
  arguments "-DCMAKE_BUILD_TYPE=Release"
184
+ // Adding -O3 to patch the issue here: https://github.com/android/ndk/issues/1740#issuecomment-1198438260
185
+ cppFlags "-O3"
181
186
  }
182
187
  }
183
188
  }
@@ -1360,6 +1360,15 @@ public class ReactInstanceManager {
1360
1360
 
1361
1361
  reactContext.initializeWithInstance(catalystInstance);
1362
1362
 
1363
+ if (ReactFeatureFlags.unstable_useRuntimeSchedulerAlways) {
1364
+ // On Old Architecture, we need to initialize the Native Runtime Scheduler so that
1365
+ // the `nativeRuntimeScheduler` object is registered on JS.
1366
+ // On New Architecture, this is normally triggered by instantiate a TurboModuleManager.
1367
+ // Here we invoke getRuntimeScheduler() to trigger the creation of it regardless of the
1368
+ // architecture so it will always be there.
1369
+ catalystInstance.getRuntimeScheduler();
1370
+ }
1371
+
1363
1372
  if (ReactFeatureFlags.useTurboModules && mTMMDelegateBuilder != null) {
1364
1373
  TurboModuleManagerDelegate tmmDelegate =
1365
1374
  mTMMDelegateBuilder
@@ -42,6 +42,13 @@ public class ReactFeatureFlags {
42
42
  */
43
43
  public static volatile boolean unstable_useFabricInterop = false;
44
44
 
45
+ /**
46
+ * Should this application always use the Native RuntimeScheduler? If yes, we'll be instantiating
47
+ * it over all the architectures (both Old and New). This is intentionally set to true as we want
48
+ * to use it more as a kill-switch to turn off this feature to potentially debug issues.
49
+ */
50
+ public static volatile boolean unstable_useRuntimeSchedulerAlways = true;
51
+
45
52
  /**
46
53
  * Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable
47
54
  * the following flags: `useTurboModules` & `enableFabricRenderer`.
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 72,
20
20
  "patch", 0,
21
- "prerelease", "rc.2");
21
+ "prerelease", "rc.4");
22
22
  }
@@ -190,7 +190,6 @@ add_executable(reactnative_unittest
190
190
  -fexceptions
191
191
  -frtti
192
192
  -std=c++17
193
- -DANDROID
194
193
  -DHERMES_ENABLE_DEBUGGER)
195
194
 
196
195
  target_link_libraries(reactnative_unittest
@@ -47,6 +47,19 @@ Pod::Spec.new do |s|
47
47
  s.dependency "RCTTypeSafety", version
48
48
  s.dependency "ReactCommon/turbomodule/core", version
49
49
  s.dependency "React-jsi", version
50
+ s.dependency "React-logger"
51
+ s.dependency "glog"
52
+ s.dependency "DoubleConversion"
53
+ s.dependency "React-Core"
54
+ s.dependency "React-debug"
55
+ s.dependency "React-utils"
56
+ s.dependency "React-runtimescheduler"
57
+
58
+ if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
59
+ s.dependency "hermes-engine"
60
+ else
61
+ s.dependency "React-jsi"
62
+ end
50
63
 
51
64
  s.subspec "animations" do |ss|
52
65
  ss.dependency folly_dep_name, folly_version
@@ -232,14 +245,6 @@ Pod::Spec.new do |s|
232
245
  end
233
246
  end
234
247
 
235
- s.subspec "debug_core" do |ss|
236
- ss.dependency folly_dep_name, folly_version
237
- ss.compiler_flags = folly_compiler_flags
238
- ss.source_files = "react/debug/**/*.{m,mm,cpp,h}"
239
- ss.exclude_files = "react/debug/tests"
240
- ss.header_dir = "react/debug"
241
- end
242
-
243
248
  s.subspec "debug_renderer" do |ss|
244
249
  ss.dependency folly_dep_name, folly_version
245
250
  ss.compiler_flags = folly_compiler_flags
@@ -323,19 +328,4 @@ Pod::Spec.new do |s|
323
328
  ss.header_dir = "react/renderer/leakchecker"
324
329
  ss.pod_target_xcconfig = { "GCC_WARN_PEDANTIC" => "YES" }
325
330
  end
326
-
327
- s.subspec "runtimescheduler" do |ss|
328
- ss.dependency folly_dep_name, folly_version
329
- ss.compiler_flags = folly_compiler_flags
330
- ss.source_files = "react/renderer/runtimescheduler/**/*.{cpp,h}"
331
- ss.exclude_files = "react/renderer/runtimescheduler/tests"
332
- ss.header_dir = "react/renderer/runtimescheduler"
333
- ss.pod_target_xcconfig = { "GCC_WARN_PEDANTIC" => "YES" }
334
- end
335
-
336
- s.subspec "utils" do |ss|
337
- ss.source_files = "react/utils/*.{m,mm,cpp,h}"
338
- ss.header_dir = "react/utils"
339
- end
340
-
341
331
  end
@@ -70,8 +70,4 @@ Pod::Spec.new do |s|
70
70
  sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}"
71
71
  end
72
72
  end
73
-
74
- s.subspec "react_debug_core" do |sss|
75
- sss.source_files = "react/debug/*.{cpp,h}"
76
- end
77
73
  end
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
33
33
  s.source_files = "*.{cpp,h}"
34
34
  s.exclude_files = "SampleCxxModule.*"
35
35
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
36
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\"",
36
+ s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
37
37
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
38
38
  s.header_dir = "cxxreact"
39
39
 
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 72;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.2";
21
+ std::string_view Prerelease = "rc.4";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -0,0 +1,36 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ require "json"
7
+
8
+ package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
9
+ version = package['version']
10
+
11
+ source = { :git => 'https://github.com/facebook/react-native.git' }
12
+ if version == '1000.0.0'
13
+ # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
14
+ source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
15
+ else
16
+ source[:tag] = "v#{version}"
17
+ end
18
+
19
+ Pod::Spec.new do |s|
20
+ s.name = "React-debug"
21
+ s.version = version
22
+ s.summary = "-" # TODO
23
+ s.homepage = "https://reactnative.dev/"
24
+ s.license = package["license"]
25
+ s.author = "Meta Platforms, Inc. and its affiliates"
26
+ s.platforms = { :ios => min_ios_version_supported }
27
+ s.source = source
28
+ s.source_files = "**/*.{cpp,h}"
29
+ s.header_dir = "react/debug"
30
+ s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
31
+
32
+ if ENV['USE_FRAMEWORKS']
33
+ s.module_name = "React_debug"
34
+ s.header_mappings_dir = "../.."
35
+ end
36
+ end
@@ -16,6 +16,7 @@ bool CoreFeatures::blockPaintForUseLayoutEffect = false;
16
16
  bool CoreFeatures::useNativeState = false;
17
17
  bool CoreFeatures::cacheNSTextStorage = false;
18
18
  bool CoreFeatures::cacheLastTextMeasurement = false;
19
+ bool CoreFeatures::cancelImageDownloadsOnRecycle = false;
19
20
 
20
21
  } // namespace react
21
22
  } // namespace facebook
@@ -44,6 +44,10 @@ class CoreFeatures {
44
44
  // This flag enables a caching mechanism to avoid subsequents measurements
45
45
  // of the same Text with the same constrainst.
46
46
  static bool cacheLastTextMeasurement;
47
+
48
+ // Fabric was not cancelling image downloads when <ImageView /> was removed
49
+ // from view hierarchy. This feature flag enables this feature.
50
+ static bool cancelImageDownloadsOnRecycle;
47
51
  };
48
52
 
49
53
  } // namespace react
@@ -35,20 +35,24 @@ class ImageRequest final {
35
35
  /*
36
36
  * The move constructor.
37
37
  */
38
- ImageRequest(ImageRequest &&other) noexcept;
38
+ ImageRequest(ImageRequest &&other) noexcept = default;
39
39
 
40
40
  /*
41
41
  * `ImageRequest` does not support copying by design.
42
42
  */
43
43
  ImageRequest(const ImageRequest &other) = delete;
44
44
 
45
- ~ImageRequest();
46
-
47
45
  /**
48
46
  * Set cancelation function.
49
47
  */
50
48
  void setCancelationFunction(std::function<void(void)> cancelationFunction);
51
49
 
50
+ /*
51
+ * Calls cancel function if one is defined. Should be when downloading
52
+ * image isn't needed anymore. E.g. <ImageView /> was removed.
53
+ */
54
+ void cancel() const;
55
+
52
56
  /*
53
57
  * Returns the Image Source associated with the request.
54
58
  */
@@ -18,17 +18,6 @@ ImageRequest::ImageRequest(
18
18
  // Not implemented.
19
19
  }
20
20
 
21
- ImageRequest::ImageRequest(ImageRequest &&other) noexcept
22
- : imageSource_(std::move(other.imageSource_)),
23
- telemetry_(std::move(other.telemetry_)),
24
- coordinator_(std::move(other.coordinator_)) {
25
- // Not implemented.
26
- }
27
-
28
- ImageRequest::~ImageRequest() {
29
- // Not implemented.
30
- }
31
-
32
21
  const ImageResponseObserverCoordinator &ImageRequest::getObserverCoordinator()
33
22
  const {
34
23
  // Not implemented
@@ -48,6 +48,8 @@ Pod::Spec.new do |s|
48
48
  "\"$(PODS_ROOT)/DoubleConversion\"",
49
49
  "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\"",
50
50
  "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"",
51
+ "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"",
52
+ "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"",
51
53
  ]
52
54
  end
53
55
 
@@ -61,4 +63,7 @@ Pod::Spec.new do |s|
61
63
  s.dependency "React-Fabric"
62
64
  s.dependency "React-Core/Default"
63
65
  s.dependency "React-RCTImage"
66
+ s.dependency "React-debug"
67
+ s.dependency "React-utils"
68
+ s.dependency "glog"
64
69
  end
@@ -17,27 +17,17 @@ ImageRequest::ImageRequest(
17
17
  coordinator_ = std::make_shared<ImageResponseObserverCoordinator>();
18
18
  }
19
19
 
20
- ImageRequest::ImageRequest(ImageRequest &&other) noexcept
21
- : imageSource_(std::move(other.imageSource_)),
22
- telemetry_(std::move(other.telemetry_)),
23
- coordinator_(std::move(other.coordinator_)) {
24
- other.coordinator_ = nullptr;
25
- other.cancelRequest_ = nullptr;
26
- other.telemetry_ = nullptr;
27
- other.imageSource_ = {};
20
+ void ImageRequest::setCancelationFunction(
21
+ std::function<void(void)> cancelationFunction) {
22
+ cancelRequest_ = cancelationFunction;
28
23
  }
29
24
 
30
- ImageRequest::~ImageRequest() {
25
+ void ImageRequest::cancel() const {
31
26
  if (cancelRequest_) {
32
27
  cancelRequest_();
33
28
  }
34
29
  }
35
30
 
36
- void ImageRequest::setCancelationFunction(
37
- std::function<void(void)> cancelationFunction) {
38
- cancelRequest_ = cancelationFunction;
39
- }
40
-
41
31
  const ImageSource &ImageRequest::getImageSource() const {
42
32
  return imageSource_;
43
33
  }
@@ -0,0 +1,66 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ require "json"
7
+
8
+ package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
9
+ version = package['version']
10
+
11
+ source = { :git => 'https://github.com/facebook/react-native.git' }
12
+ if version == '1000.0.0'
13
+ # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
14
+ source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
15
+ else
16
+ source[:tag] = "v#{version}"
17
+ end
18
+
19
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
20
+ folly_version = '2021.07.22.00'
21
+
22
+ header_search_paths = [
23
+ "\"$(PODS_ROOT)/RCT-Folly\"",
24
+ ]
25
+
26
+ if ENV['USE_FRAMEWORKS']
27
+ header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../../..\"" #this is needed to allow the RuntimeScheduler access its own files
28
+ header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\""
29
+ end
30
+
31
+ Pod::Spec.new do |s|
32
+ s.name = "React-runtimescheduler"
33
+ s.version = version
34
+ s.summary = "-" # TODO
35
+ s.homepage = "https://reactnative.dev/"
36
+ s.license = package["license"]
37
+ s.author = "Meta Platforms, Inc. and its affiliates"
38
+ s.platforms = { :ios => min_ios_version_supported }
39
+ s.source = source
40
+ s.source_files = "**/*.{cpp,h}"
41
+ s.compiler_flags = folly_compiler_flags
42
+ s.header_dir = "react/renderer/runtimescheduler"
43
+ s.exclude_files = "tests"
44
+ s.pod_target_xcconfig = {
45
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
46
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
47
+
48
+ if ENV['USE_FRAMEWORKS']
49
+ s.module_name = "React_runtimescheduler"
50
+ s.header_mappings_dir = "../../.."
51
+ end
52
+
53
+ s.dependency "React-jsi"
54
+ s.dependency "React-runtimeexecutor"
55
+ s.dependency "React-callinvoker"
56
+ s.dependency "React-debug"
57
+ s.dependency "glog"
58
+ s.dependency "RCT-Folly", folly_version
59
+
60
+ if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
61
+ s.dependency "hermes-engine"
62
+ else
63
+ s.dependency "React-jsi"
64
+ end
65
+
66
+ end
@@ -7,6 +7,7 @@
7
7
 
8
8
  #include "RuntimeSchedulerBinding.h"
9
9
  #include <ReactCommon/SchedulerPriority.h>
10
+ #include "RuntimeScheduler.h"
10
11
  #include "SchedulerPriorityUtils.h"
11
12
  #include "primitives.h"
12
13
 
@@ -78,7 +79,7 @@ jsi::Value RuntimeSchedulerBinding::get(
78
79
  jsi::Runtime &runtime,
79
80
  jsi::Value const &,
80
81
  jsi::Value const *arguments,
81
- size_t) noexcept -> jsi::Value {
82
+ size_t count) noexcept -> jsi::Value {
82
83
  SchedulerPriority priority = fromRawValue(arguments[0].getNumber());
83
84
  auto callback = arguments[1].getObject(runtime).getFunction(runtime);
84
85
 
@@ -8,11 +8,12 @@
8
8
  #pragma once
9
9
 
10
10
  #include <jsi/jsi.h>
11
- #include <react/renderer/runtimescheduler/RuntimeScheduler.h>
12
11
 
13
12
  namespace facebook {
14
13
  namespace react {
15
14
 
15
+ class RuntimeScheduler;
16
+
16
17
  /*
17
18
  * Exposes RuntimeScheduler to JavaScript realm.
18
19
  */
@@ -8,6 +8,7 @@
8
8
  #include "RuntimeSchedulerCallInvoker.h"
9
9
 
10
10
  #include <utility>
11
+ #include "RuntimeScheduler.h"
11
12
 
12
13
  namespace facebook::react {
13
14
 
@@ -8,11 +8,12 @@
8
8
  #pragma once
9
9
 
10
10
  #include <ReactCommon/CallInvoker.h>
11
- #include <react/renderer/runtimescheduler/RuntimeScheduler.h>
12
11
 
13
12
  namespace facebook {
14
13
  namespace react {
15
14
 
15
+ class RuntimeScheduler;
16
+
16
17
  /*
17
18
  * Exposes RuntimeScheduler to native modules. All calls invoked on JavaScript
18
19
  * queue from native modules will be funneled through RuntimeScheduler.
@@ -7,9 +7,7 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include <folly/dynamic.h>
11
10
  #include <jsi/jsi.h>
12
- #include <react/renderer/core/CoreFeatures.h>
13
11
  #include <react/renderer/runtimescheduler/Task.h>
14
12
 
15
13
  namespace facebook {
@@ -24,14 +22,8 @@ struct TaskWrapper : public jsi::HostObject {
24
22
  inline static jsi::Value valueFromTask(
25
23
  jsi::Runtime &runtime,
26
24
  std::shared_ptr<Task> task) {
27
- if (CoreFeatures::useNativeState) {
28
- jsi::Object obj(runtime);
29
- obj.setNativeState(runtime, std::move(task));
30
- return obj;
31
- } else {
32
- return jsi::Object::createFromHostObject(
33
- runtime, std::make_shared<TaskWrapper>(task));
34
- }
25
+ return jsi::Object::createFromHostObject(
26
+ runtime, std::make_shared<TaskWrapper>(task));
35
27
  }
36
28
 
37
29
  inline static std::shared_ptr<Task> taskFromValue(
@@ -41,11 +33,7 @@ inline static std::shared_ptr<Task> taskFromValue(
41
33
  return nullptr;
42
34
  }
43
35
 
44
- if (CoreFeatures::useNativeState) {
45
- return value.getObject(runtime).getNativeState<Task>(runtime);
46
- } else {
47
- return value.getObject(runtime).getHostObject<TaskWrapper>(runtime)->task;
48
- }
36
+ return value.getObject(runtime).getHostObject<TaskWrapper>(runtime)->task;
49
37
  }
50
38
 
51
39
  } // namespace react
@@ -13,7 +13,7 @@
13
13
  #include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
14
14
  #include <react/renderer/core/EventBeat.h>
15
15
  #include <react/renderer/leakchecker/LeakChecker.h>
16
- #include <react/renderer/runtimescheduler/RuntimeScheduler.h>
16
+
17
17
  #include <react/renderer/uimanager/UIManagerCommitHook.h>
18
18
  #include <react/renderer/uimanager/primitives.h>
19
19
  #include <react/utils/ContextContainer.h>
@@ -0,0 +1,57 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ require "json"
7
+
8
+ package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
9
+ version = package['version']
10
+
11
+ source = { :git => 'https://github.com/facebook/react-native.git' }
12
+ if version == '1000.0.0'
13
+ # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
14
+ source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
15
+ else
16
+ source[:tag] = "v#{version}"
17
+ end
18
+
19
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
20
+ folly_version = '2021.07.22.00'
21
+
22
+ header_search_paths = [
23
+ "\"$(PODS_ROOT)/RCT-Folly\"",
24
+ "\"$(PODS_TARGET_SRCROOT)\"",
25
+ "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
26
+ ]
27
+
28
+ if ENV["USE_FRAMEWORKS"]
29
+ header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\""
30
+ end
31
+
32
+ Pod::Spec.new do |s|
33
+ s.name = "React-utils"
34
+ s.version = version
35
+ s.summary = "-" # TODO
36
+ s.homepage = "https://reactnative.dev/"
37
+ s.license = package["license"]
38
+ s.author = "Meta Platforms, Inc. and its affiliates"
39
+ s.platforms = { :ios => min_ios_version_supported }
40
+ s.source = source
41
+ s.source_files = "**/*.{cpp,h,mm}"
42
+ s.compiler_flags = folly_compiler_flags
43
+ s.header_dir = "react/utils"
44
+ s.exclude_files = "tests"
45
+ s.pod_target_xcconfig = {
46
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
47
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
48
+
49
+ if ENV['USE_FRAMEWORKS']
50
+ s.module_name = "React_utils"
51
+ s.header_mappings_dir = "../.."
52
+ end
53
+
54
+ s.dependency "RCT-Folly", folly_version
55
+ s.dependency "React-debug"
56
+ s.dependency "glog"
57
+ end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.72.0-rc.2",
3
+ "version": "0.72.0-rc.4",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -79,15 +79,15 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@jest/create-cache-key-function": "^29.2.1",
82
- "@react-native-community/cli": "11.2.1",
83
- "@react-native-community/cli-platform-android": "11.2.1",
84
- "@react-native-community/cli-platform-ios": "11.2.1",
82
+ "@react-native-community/cli": "11.3.1",
83
+ "@react-native-community/cli-platform-android": "11.3.1",
84
+ "@react-native-community/cli-platform-ios": "11.3.1",
85
85
  "@react-native/assets-registry": "^0.72.0",
86
- "@react-native/codegen": "^0.72.4",
87
- "@react-native/gradle-plugin": "^0.72.6",
86
+ "@react-native/codegen": "^0.72.5",
87
+ "@react-native/gradle-plugin": "^0.72.9",
88
88
  "@react-native/js-polyfills": "^0.72.1",
89
89
  "@react-native/normalize-colors": "^0.72.0",
90
- "@react-native/virtualized-lists": "^0.72.4",
90
+ "@react-native/virtualized-lists": "^0.72.5",
91
91
  "abort-controller": "^3.0.0",
92
92
  "anser": "^1.4.9",
93
93
  "base64-js": "^1.1.2",
@@ -98,8 +98,8 @@
98
98
  "jest-environment-node": "^29.2.1",
99
99
  "jsc-android": "^250231.0.0",
100
100
  "memoize-one": "^5.0.0",
101
- "metro-runtime": "0.76.2",
102
- "metro-source-map": "0.76.2",
101
+ "metro-runtime": "0.76.5",
102
+ "metro-source-map": "0.76.5",
103
103
  "mkdirp": "^0.5.1",
104
104
  "nullthrows": "^1.1.1",
105
105
  "pretty-format": "^26.5.2",
@@ -108,7 +108,7 @@
108
108
  "react-refresh": "^0.4.0",
109
109
  "react-shallow-renderer": "^16.15.0",
110
110
  "regenerator-runtime": "^0.13.2",
111
- "scheduler": "^0.23.0",
111
+ "scheduler": "0.24.0-canary-efb381bbf-20230505",
112
112
  "stacktrace-parser": "^0.1.10",
113
113
  "use-sync-external-store": "^1.0.0",
114
114
  "whatwg-fetch": "^3.0.0",