react-native 0.82.0-rc.0 → 0.82.0-rc.1

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 (59) hide show
  1. package/Libraries/BatchedBridge/BatchedBridge.js +1 -0
  2. package/Libraries/BatchedBridge/MessageQueue.js +1 -0
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Libraries/Core/Timers/JSTimers.js +1 -0
  5. package/Libraries/Core/Timers/NativeTiming.js +1 -0
  6. package/Libraries/Core/Timers/immediateShim.js +1 -0
  7. package/Libraries/Core/setUpPerformance.js +3 -5
  8. package/React/Base/RCTVersion.m +1 -1
  9. package/React/CoreModules/RCTAlertController.mm +6 -1
  10. package/ReactAndroid/build.gradle.kts +7 -0
  11. package/ReactAndroid/gradle.properties +3 -1
  12. package/ReactAndroid/hermes-engine/build.gradle.kts +28 -7
  13. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  14. package/ReactAndroid/src/main/jni/CMakeLists.txt +2 -0
  15. package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/CMakeLists.txt +4 -0
  16. package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/CMakeLists.txt +4 -0
  17. package/ReactAndroid/src/main/jni/react/runtime/jni/CMakeLists.txt +4 -0
  18. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  19. package/ReactCommon/hermes/executor/CMakeLists.txt +4 -0
  20. package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +8 -5
  21. package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +4 -0
  22. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +2 -2
  23. package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +2 -2
  24. package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +2 -2
  25. package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +2 -2
  26. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -0
  27. package/ReactCommon/react/runtime/CMakeLists.txt +4 -0
  28. package/ReactCommon/react/runtime/hermes/CMakeLists.txt +4 -0
  29. package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +7 -3
  30. package/flow/bom.js.flow +157 -0
  31. package/package.json +8 -8
  32. package/scripts/cocoapods/autolinking.rb +6 -0
  33. package/scripts/cocoapods/codegen_utils.rb +1 -1
  34. package/scripts/cocoapods/jsengine.rb +2 -1
  35. package/scripts/cocoapods/utils.rb +8 -2
  36. package/scripts/codegen/generate-artifacts-executor/index.js +5 -1
  37. package/scripts/codegen/generate-artifacts-executor/utils.js +41 -10
  38. package/scripts/replace-rncore-version.js +4 -2
  39. package/sdks/hermes-engine/hermes-engine.podspec +30 -12
  40. package/sdks/hermes-engine/hermes-utils.rb +41 -10
  41. package/sdks/hermes-engine/utils/build-apple-framework.sh +7 -1
  42. package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -1
  43. package/sdks/hermes-engine/utils/build-hermesc-xcode.sh +1 -1
  44. package/sdks/hermes-engine/utils/replace_hermes_version.js +4 -2
  45. package/sdks/hermesc/osx-bin/hermes +0 -0
  46. package/sdks/hermesc/osx-bin/hermesc +0 -0
  47. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  48. package/settings.gradle.kts +9 -0
  49. package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
  50. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -0
  51. package/src/private/webapis/performance/EventTiming.js +34 -15
  52. package/src/private/webapis/performance/LongTasks.js +35 -2
  53. package/src/private/webapis/performance/Performance.js +23 -6
  54. package/src/private/webapis/performance/PerformanceEntry.js +21 -8
  55. package/src/private/webapis/performance/PerformanceObserver.js +30 -1
  56. package/src/private/webapis/performance/ResourceTiming.js +29 -18
  57. package/src/private/webapis/performance/UserTiming.js +33 -28
  58. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
  59. package/third-party-podspecs/replace_dependencies_version.js +4 -2
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow strict
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  'use strict';
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow strict
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  'use strict';
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
29
29
  static major: number = 0;
30
30
  static minor: number = 82;
31
31
  static patch: number = 0;
32
- static prerelease: string | null = 'rc.0';
32
+ static prerelease: string | null = 'rc.1';
33
33
 
34
34
  static getVersionString(): string {
35
35
  return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  import NativeTiming from './NativeTiming';
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow strict
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  export * from '../../../src/private/specs_DEPRECATED/modules/NativeTiming';
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @flow
8
8
  * @format
9
+ * @deprecated
9
10
  */
10
11
 
11
12
  'use strict';
@@ -4,19 +4,17 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @flow strict
7
+ * @flow strict-local
8
8
  * @format
9
9
  */
10
10
 
11
+ import setUpPerformanceModern from '../../src/private/setup/setUpPerformanceModern';
11
12
  import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
12
13
 
13
14
  // In case if the native implementation of the Performance API is available, use it,
14
15
  // otherwise fall back to the legacy/default one, which only defines 'Performance.now()'
15
16
  if (NativePerformance) {
16
- const Performance =
17
- require('../../src/private/webapis/performance/Performance').default;
18
- // $FlowExpectedError[cannot-write]
19
- global.performance = new Performance();
17
+ setUpPerformanceModern();
20
18
  } else {
21
19
  if (!global.performance) {
22
20
  // $FlowExpectedError[cannot-write]
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(82),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"rc.1",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -20,7 +20,12 @@
20
20
  - (UIWindow *)alertWindow
21
21
  {
22
22
  if (_alertWindow == nil) {
23
- _alertWindow = [[UIWindow alloc] initWithWindowScene:RCTKeyWindow().windowScene];
23
+ UIWindowScene *scene = RCTKeyWindow().windowScene;
24
+ if (scene != nil) {
25
+ _alertWindow = [[UIWindow alloc] initWithWindowScene:scene];
26
+ } else {
27
+ _alertWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
28
+ }
24
29
 
25
30
  if (_alertWindow) {
26
31
  _alertWindow.rootViewController = [UIViewController new];
@@ -39,6 +39,9 @@ val downloadsDir =
39
39
  val thirdPartyNdkDir = File("$buildDir/third-party-ndk")
40
40
  val reactNativeRootDir = projectDir.parent
41
41
 
42
+ val hermesV1Enabled =
43
+ rootProject.extensions.getByType(PrivateReactExtension::class.java).hermesV1Enabled.get()
44
+
42
45
  // We put the publishing version from gradle.properties inside ext. so other
43
46
  // subprojects can access it as well.
44
47
  extra["publishing_version"] = project.findProperty("VERSION_NAME")?.toString()!!
@@ -565,6 +568,10 @@ android {
565
568
  "-DCMAKE_POLICY_DEFAULT_CMP0069=NEW",
566
569
  )
567
570
 
571
+ if (hermesV1Enabled) {
572
+ arguments("-DHERMES_V1_ENABLED=1")
573
+ }
574
+
568
575
  targets(
569
576
  "reactnative",
570
577
  "jsi",
@@ -1,5 +1,7 @@
1
- VERSION_NAME=0.82.0-rc.0
1
+ VERSION_NAME=0.82.0-rc.1
2
+ HERMES_VERSION_NAME=1000.0.0
2
3
  react.internal.publishingGroup=com.facebook.react
4
+ react.internal.hermesPublishingGroup=com.facebook.hermes
3
5
 
4
6
  android.useAndroidX=true
5
7
 
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ import com.facebook.react.internal.PrivateReactExtension
8
9
  import com.facebook.react.tasks.internal.*
9
10
  import de.undercouch.gradle.tasks.download.Download
10
11
  import org.apache.tools.ant.taskdefs.condition.Os
@@ -50,6 +51,8 @@ fun getSDKManagerPath(): String {
50
51
  }
51
52
  }
52
53
 
54
+ val hermesV1Enabled =
55
+ rootProject.extensions.getByType(PrivateReactExtension::class.java).hermesV1Enabled.get()
53
56
  val reactNativeRootDir = project(":packages:react-native:ReactAndroid").projectDir.parent
54
57
  val customDownloadDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR")
55
58
  val downloadsDir =
@@ -79,12 +82,21 @@ val hermesBuildOutputFileTree =
79
82
  fileTree(hermesBuildDir.toString())
80
83
  .include("**/*.cmake", "**/*.marks", "**/compiler_depends.ts", "**/Makefile", "**/link.txt")
81
84
 
82
- var hermesVersion = "main"
83
- val hermesVersionFile = File(reactNativeRootDir, "sdks/.hermesversion")
85
+ val hermesVersionProvider: Provider<String> =
86
+ providers.provider {
87
+ var hermesVersion = if (hermesV1Enabled) "250829098.0.0-stable" else "main"
88
+ val hermesVersionFile =
89
+ File(
90
+ reactNativeRootDir,
91
+ if (hermesV1Enabled) "sdks/.hermesv1version" else "sdks/.hermesversion",
92
+ )
84
93
 
85
- if (hermesVersionFile.exists()) {
86
- hermesVersion = hermesVersionFile.readText()
87
- }
94
+ if (hermesVersionFile.exists()) {
95
+ hermesVersion = hermesVersionFile.readText()
96
+ }
97
+
98
+ hermesVersion
99
+ }
88
100
 
89
101
  val ndkBuildJobs = Runtime.getRuntime().availableProcessors().toString()
90
102
  val prefabHeadersDir = File("$buildDir/prefab-headers")
@@ -95,7 +107,11 @@ val jsiDir = File(reactNativeRootDir, "ReactCommon/jsi")
95
107
  val downloadHermesDest = File(downloadsDir, "hermes.tar.gz")
96
108
  val downloadHermes by
97
109
  tasks.registering(Download::class) {
98
- src("https://github.com/facebook/hermes/tarball/${hermesVersion}")
110
+ src(
111
+ providers.provider {
112
+ "https://github.com/facebook/hermes/tarball/${hermesVersionProvider.get()}"
113
+ }
114
+ )
99
115
  onlyIfModified(true)
100
116
  overwrite(true)
101
117
  quiet(true)
@@ -151,6 +167,7 @@ val configureBuildForHermes by
151
167
  "-B",
152
168
  hermesBuildDir.toString(),
153
169
  "-DJSI_DIR=" + jsiDir.absolutePath,
170
+ "-DCMAKE_BUILD_TYPE=Release",
154
171
  )
155
172
  if (Os.isFamily(Os.FAMILY_WINDOWS)) {
156
173
  cmakeCommandLine = cmakeCommandLine + "-GNMake Makefiles"
@@ -295,7 +312,11 @@ android {
295
312
  // Therefore we're passing as build type Release, to provide a faster build.
296
313
  // This has the (unlucky) side effect of letting AGP call the build
297
314
  // tasks `configureCMakeRelease` while is actually building the debug flavor.
298
- arguments("-DCMAKE_BUILD_TYPE=Release")
315
+ arguments(
316
+ "-DCMAKE_BUILD_TYPE=Release",
317
+ // For debug builds, explicitly enable the Hermes Debugger.
318
+ "-DHERMES_ENABLE_DEBUGGER=True",
319
+ )
299
320
  }
300
321
  }
301
322
  }
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 82,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.0"
18
+ "prerelease" to "rc.1"
19
19
  )
20
20
  }
@@ -22,6 +22,8 @@ file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
22
22
  file(TO_CMAKE_PATH "${REACT_BUILD_DIR}" REACT_BUILD_DIR)
23
23
  file(TO_CMAKE_PATH "${REACT_COMMON_DIR}" REACT_COMMON_DIR)
24
24
 
25
+ set(HERMES_V1_ENABLED OFF CACHE BOOL "Build with support for Hermes v1")
26
+
25
27
  # If you have ccache installed, we're going to honor it.
26
28
  find_program(CCACHE_FOUND ccache)
27
29
  if(CCACHE_FOUND)
@@ -27,4 +27,8 @@ target_link_libraries(
27
27
  target_compile_reactnative_options(hermes_executor PRIVATE)
28
28
  if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
29
29
  target_compile_options(hermes_executor PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
30
+
31
+ if (DEFINED HERMES_V1_ENABLED)
32
+ target_compile_options(hermes_executor PRIVATE -DHERMES_V1_ENABLED=1)
33
+ endif()
30
34
  endif()
@@ -29,4 +29,8 @@ target_link_libraries(hermesinstancejni
29
29
  target_compile_reactnative_options(hermesinstancejni PRIVATE)
30
30
  if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
31
31
  target_compile_options(hermesinstancejni PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
32
+
33
+ if (DEFINED HERMES_V1_ENABLED)
34
+ target_compile_options(hermesinstancejni PRIVATE -DHERMES_V1_ENABLED=1)
35
+ endif()
32
36
  endif ()
@@ -19,6 +19,10 @@ add_library(rninstance
19
19
  target_compile_reactnative_options(rninstance PRIVATE)
20
20
  if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
21
21
  target_compile_options(rninstance PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
22
+
23
+ if (DEFINED HERMES_V1_ENABLED)
24
+ target_compile_options(rninstance PRIVATE -DHERMES_V1_ENABLED=1)
25
+ endif()
22
26
  endif ()
23
27
 
24
28
  target_merge_so(rninstance)
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 82;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "rc.0";
25
+ std::string_view Prerelease = "rc.1";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -32,6 +32,10 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
32
32
  PRIVATE
33
33
  -DHERMES_ENABLE_DEBUGGER=1
34
34
  )
35
+
36
+ if (DEFINED HERMES_V1_ENABLED)
37
+ target_compile_options(hermes_executor_common PRIVATE -DHERMES_V1_ENABLED=1)
38
+ endif()
35
39
  else()
36
40
  target_compile_options(
37
41
  hermes_executor_common
@@ -14,8 +14,11 @@
14
14
  #include <jsinspector-modern/InspectorFlags.h>
15
15
 
16
16
  #include <hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h>
17
+
18
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
17
19
  #include <hermes/inspector-modern/chrome/Registration.h>
18
20
  #include <hermes/inspector/RuntimeAdapter.h>
21
+ #endif
19
22
 
20
23
  using namespace facebook::hermes;
21
24
  using namespace facebook::jsi;
@@ -24,7 +27,7 @@ namespace facebook::react {
24
27
 
25
28
  namespace {
26
29
 
27
- #ifdef HERMES_ENABLE_DEBUGGER
30
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
28
31
 
29
32
  class HermesExecutorRuntimeAdapter
30
33
  : public facebook::hermes::inspector_modern::RuntimeAdapter {
@@ -59,7 +62,7 @@ class HermesExecutorRuntimeAdapter
59
62
  std::shared_ptr<MessageQueueThread> thread_;
60
63
  };
61
64
 
62
- #endif // HERMES_ENABLE_DEBUGGER
65
+ #endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
63
66
 
64
67
  struct ReentrancyCheck {
65
68
  // This is effectively a very subtle and complex assert, so only
@@ -144,7 +147,7 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {
144
147
  const std::string& debuggerName)
145
148
  : jsi::WithRuntimeDecorator<ReentrancyCheck>(*runtime, reentrancyCheck_),
146
149
  runtime_(std::move(runtime)) {
147
- #ifdef HERMES_ENABLE_DEBUGGER
150
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
148
151
  enableDebugger_ = enableDebugger;
149
152
  if (enableDebugger_) {
150
153
  std::shared_ptr<HermesRuntime> rt(runtime_, &hermesRuntime);
@@ -159,7 +162,7 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {
159
162
  }
160
163
 
161
164
  ~DecoratedRuntime() {
162
- #ifdef HERMES_ENABLE_DEBUGGER
165
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
163
166
  if (enableDebugger_) {
164
167
  facebook::hermes::inspector_modern::chrome::disableDebugging(debugToken_);
165
168
  }
@@ -176,7 +179,7 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {
176
179
 
177
180
  std::shared_ptr<Runtime> runtime_;
178
181
  ReentrancyCheck reentrancyCheck_;
179
- #ifdef HERMES_ENABLE_DEBUGGER
182
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
180
183
  bool enableDebugger_;
181
184
  facebook::hermes::inspector_modern::chrome::DebugSessionToken debugToken_;
182
185
  #endif // HERMES_ENABLE_DEBUGGER
@@ -23,6 +23,10 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
23
23
  PRIVATE
24
24
  -DHERMES_ENABLE_DEBUGGER=1
25
25
  )
26
+
27
+ if (DEFINED HERMES_V1_ENABLED)
28
+ target_compile_options(hermes_inspector_modern PRIVATE -DHERMES_V1_ENABLED=1)
29
+ endif()
26
30
  endif()
27
31
 
28
32
  target_include_directories(hermes_inspector_modern PUBLIC ${REACT_COMMON_DIR})
@@ -7,7 +7,7 @@
7
7
 
8
8
  #include "ConnectionDemux.h"
9
9
 
10
- #ifdef HERMES_ENABLE_DEBUGGER
10
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
11
11
 
12
12
  #include <hermes/inspector/RuntimeAdapter.h>
13
13
  #include <hermes/inspector/chrome/CDPHandler.h>
@@ -139,4 +139,4 @@ void ConnectionDemux::removePage(int pageId) {
139
139
 
140
140
  } // namespace facebook::hermes::inspector_modern::chrome
141
141
 
142
- #endif // HERMES_ENABLE_DEBUGGER
142
+ #endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
@@ -7,7 +7,7 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #ifdef HERMES_ENABLE_DEBUGGER
10
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
11
11
 
12
12
  #include <memory>
13
13
  #include <mutex>
@@ -59,4 +59,4 @@ class ConnectionDemux {
59
59
 
60
60
  } // namespace facebook::hermes::inspector_modern::chrome
61
61
 
62
- #endif // HERMES_ENABLE_DEBUGGER
62
+ #endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
@@ -8,7 +8,7 @@
8
8
  #include "Registration.h"
9
9
  #include "ConnectionDemux.h"
10
10
 
11
- #ifdef HERMES_ENABLE_DEBUGGER
11
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
12
12
 
13
13
  namespace facebook::hermes::inspector_modern::chrome {
14
14
 
@@ -34,4 +34,4 @@ void disableDebugging(DebugSessionToken session) {
34
34
 
35
35
  } // namespace facebook::hermes::inspector_modern::chrome
36
36
 
37
- #endif // HERMES_ENABLE_DEBUGGER
37
+ #endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
@@ -7,7 +7,7 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #ifdef HERMES_ENABLE_DEBUGGER
10
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
11
11
 
12
12
  #include <memory>
13
13
  #include <string>
@@ -38,4 +38,4 @@ extern void disableDebugging(DebugSessionToken session);
38
38
 
39
39
  } // namespace facebook::hermes::inspector_modern::chrome
40
40
 
41
- #endif // HERMES_ENABLE_DEBUGGER
41
+ #endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
@@ -54,6 +54,8 @@ Pod::Spec.new do |s|
54
54
  add_dependency(s, "React-jsinspectornetwork", :framework_name => 'jsinspector_modernnetwork')
55
55
  add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
56
56
  s.dependency "React-perflogger", version
57
+ add_dependency(s, "React-oscompat")
58
+
57
59
  if use_hermes()
58
60
  s.dependency "hermes-engine"
59
61
  end
@@ -18,6 +18,10 @@ add_library(bridgeless
18
18
  target_compile_reactnative_options(bridgeless PRIVATE)
19
19
  if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
20
20
  target_compile_options(bridgeless PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
21
+
22
+ if (DEFINED HERMES_V1_ENABLED)
23
+ target_compile_options(bridgeless PRIVATE -DHERMES_V1_ENABLED=1)
24
+ endif()
21
25
  endif ()
22
26
  target_include_directories(bridgeless PUBLIC .)
23
27
 
@@ -35,4 +35,8 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
35
35
  PRIVATE
36
36
  -DHERMES_ENABLE_DEBUGGER=1
37
37
  )
38
+
39
+ if (DEFINED HERMES_V1_ENABLED)
40
+ target_compile_options(bridgelesshermes PRIVATE -DHERMES_V1_ENABLED=1)
41
+ endif()
38
42
  endif()
@@ -14,7 +14,11 @@
14
14
 
15
15
  #ifdef HERMES_ENABLE_DEBUGGER
16
16
  #include <hermes/inspector-modern/chrome/Registration.h>
17
+
18
+ #ifndef HERMES_V1_ENABLED
17
19
  #include <hermes/inspector/RuntimeAdapter.h>
20
+ #endif
21
+
18
22
  #include <jsi/decorator.h>
19
23
  #endif
20
24
 
@@ -23,7 +27,7 @@ using namespace facebook::jsi;
23
27
 
24
28
  namespace facebook::react {
25
29
 
26
- #ifdef HERMES_ENABLE_DEBUGGER
30
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
27
31
 
28
32
  // Wrapper that strongly retains the HermesRuntime for on device debugging.
29
33
  //
@@ -90,7 +94,7 @@ class DecoratedRuntime : public jsi::RuntimeDecorator<jsi::Runtime> {
90
94
  inspector_modern::chrome::DebugSessionToken debugToken_;
91
95
  };
92
96
 
93
- #endif
97
+ #endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
94
98
 
95
99
  class HermesJSRuntime : public JSRuntime {
96
100
  public:
@@ -157,7 +161,7 @@ std::unique_ptr<JSRuntime> HermesInstance::createJSRuntime(
157
161
  .getPropertyAsObject(*hermesRuntime, "prototype");
158
162
  errorPrototype.setProperty(*hermesRuntime, "jsEngine", "hermes");
159
163
 
160
- #ifdef HERMES_ENABLE_DEBUGGER
164
+ #if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
161
165
  auto& inspectorFlags = jsinspector_modern::InspectorFlags::getInstance();
162
166
  if (!inspectorFlags.getFuseboxEnabled()) {
163
167
  std::unique_ptr<DecoratedRuntime> decoratedRuntime =
package/flow/bom.js.flow CHANGED
@@ -88,12 +88,169 @@ declare var navigator: Navigator;
88
88
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp
89
89
  declare type DOMHighResTimeStamp = number;
90
90
 
91
+ type PerformanceEntryFilterOptions = {
92
+ entryType: string,
93
+ name: string,
94
+ ...
95
+ };
96
+
97
+ // https://www.w3.org/TR/performance-timeline-2/
98
+ declare class PerformanceEntry {
99
+ duration: DOMHighResTimeStamp;
100
+ entryType: string;
101
+ name: string;
102
+ startTime: DOMHighResTimeStamp;
103
+ toJSON(): string;
104
+ }
105
+
106
+ // https://w3c.github.io/user-timing/#performancemark
107
+ declare class PerformanceMark extends PerformanceEntry {
108
+ constructor(name: string, markOptions?: PerformanceMarkOptions): void;
109
+ +detail: mixed;
110
+ }
111
+
112
+ // https://w3c.github.io/user-timing/#performancemeasure
113
+ declare class PerformanceMeasure extends PerformanceEntry {
114
+ +detail: mixed;
115
+ }
116
+
117
+ // https://w3c.github.io/server-timing/#the-performanceservertiming-interface
118
+ declare class PerformanceServerTiming {
119
+ description: string;
120
+ duration: DOMHighResTimeStamp;
121
+ name: string;
122
+ toJSON(): string;
123
+ }
124
+
125
+ // https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming
126
+ // https://w3c.github.io/server-timing/#extension-to-the-performanceresourcetiming-interface
127
+ declare class PerformanceResourceTiming extends PerformanceEntry {
128
+ connectEnd: number;
129
+ connectStart: number;
130
+ decodedBodySize: number;
131
+ domainLookupEnd: number;
132
+ domainLookupStart: number;
133
+ encodedBodySize: number;
134
+ fetchStart: number;
135
+ initiatorType: string;
136
+ nextHopProtocol: string;
137
+ redirectEnd: number;
138
+ redirectStart: number;
139
+ requestStart: number;
140
+ responseEnd: number;
141
+ responseStart: number;
142
+ secureConnectionStart: number;
143
+ serverTiming: Array<PerformanceServerTiming>;
144
+ transferSize: number;
145
+ workerStart: number;
146
+ }
147
+
148
+ // https://w3c.github.io/event-timing/#sec-performance-event-timing
149
+ declare class PerformanceEventTiming extends PerformanceEntry {
150
+ cancelable: boolean;
151
+ interactionId: number;
152
+ processingEnd: number;
153
+ processingStart: number;
154
+ target: ?Node;
155
+ }
156
+
157
+ // https://w3c.github.io/longtasks/#taskattributiontiming
158
+ declare class TaskAttributionTiming extends PerformanceEntry {
159
+ containerId: string;
160
+ containerName: string;
161
+ containerSrc: string;
162
+ containerType: string;
163
+ }
164
+
165
+ // https://w3c.github.io/longtasks/#sec-PerformanceLongTaskTiming
166
+ declare class PerformanceLongTaskTiming extends PerformanceEntry {
167
+ attribution: $ReadOnlyArray<TaskAttributionTiming>;
168
+ }
169
+
170
+ // https://www.w3.org/TR/user-timing/#extensions-performance-interface
171
+ declare type PerformanceMarkOptions = {
172
+ detail?: mixed,
173
+ startTime?: number,
174
+ };
175
+
176
+ declare type PerformanceMeasureOptions = {
177
+ detail?: mixed,
178
+ duration?: number,
179
+ end?: number | string,
180
+ start?: number | string,
181
+ };
182
+
183
+ type EventCountsForEachCallbackType =
184
+ | (() => void)
185
+ | ((value: number) => void)
186
+ | ((value: number, key: string) => void)
187
+ | ((value: number, key: string, map: Map<string, number>) => void);
188
+
189
+ // https://www.w3.org/TR/event-timing/#eventcounts
190
+ declare interface EventCounts {
191
+ entries(): Iterator<[string, number]>;
192
+
193
+ forEach(callback: EventCountsForEachCallbackType): void;
194
+ get(key: string): ?number;
195
+ has(key: string): boolean;
196
+ keys(): Iterator<string>;
197
+ size: number;
198
+ values(): Iterator<number>;
199
+ }
200
+
91
201
  declare class Performance {
202
+ clearMarks(name?: string): void;
203
+
204
+ clearMeasures(name?: string): void;
205
+
206
+ eventCounts: EventCounts;
207
+ getEntries: (
208
+ options?: PerformanceEntryFilterOptions,
209
+ ) => Array<PerformanceEntry>;
210
+ getEntriesByName: (name: string, type?: string) => Array<PerformanceEntry>;
211
+ getEntriesByType: (type: string) => Array<PerformanceEntry>;
212
+ mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
213
+ measure(
214
+ name: string,
215
+ startMarkOrOptions?: string | PerformanceMeasureOptions,
216
+ endMark?: string,
217
+ ): PerformanceMeasure;
92
218
  now: () => DOMHighResTimeStamp;
219
+ toJSON(): string;
93
220
  }
94
221
 
95
222
  declare var performance: Performance;
96
223
 
224
+ type PerformanceEntryList = Array<PerformanceEntry>;
225
+
226
+ declare interface PerformanceObserverEntryList {
227
+ getEntries(): PerformanceEntryList;
228
+ getEntriesByName(name: string, type: ?string): PerformanceEntryList;
229
+ getEntriesByType(type: string): PerformanceEntryList;
230
+ }
231
+
232
+ type PerformanceObserverInit = {
233
+ buffered?: boolean,
234
+ entryTypes?: Array<string>,
235
+ type?: string,
236
+ ...
237
+ };
238
+
239
+ declare class PerformanceObserver {
240
+ constructor(
241
+ callback: (
242
+ entries: PerformanceObserverEntryList,
243
+ observer: PerformanceObserver,
244
+ ) => mixed,
245
+ ): void;
246
+
247
+ disconnect(): void;
248
+ observe(options: ?PerformanceObserverInit): void;
249
+ static supportedEntryTypes: Array<string>;
250
+
251
+ takeRecords(): PerformanceEntryList;
252
+ }
253
+
97
254
  type FormDataEntryValue = string | File;
98
255
 
99
256
  declare class FormData {