react-native-tvos 0.82.0-0rc0 → 0.82.0-0rc1
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.
- package/Libraries/BatchedBridge/BatchedBridge.js +1 -0
- package/Libraries/BatchedBridge/MessageQueue.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +1 -0
- package/Libraries/Core/Timers/NativeTiming.js +1 -0
- package/Libraries/Core/Timers/immediateShim.js +1 -0
- package/Libraries/Core/setUpPerformance.js +3 -5
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTAlertController.mm +6 -1
- package/ReactAndroid/build.gradle.kts +7 -0
- package/ReactAndroid/gradle.properties +3 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +28 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +2 -0
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/CMakeLists.txt +4 -0
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/CMakeLists.txt +4 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/CMakeLists.txt +4 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/executor/CMakeLists.txt +4 -0
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +8 -5
- package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +4 -0
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +2 -2
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +2 -2
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +2 -2
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +2 -2
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -0
- package/ReactCommon/react/runtime/CMakeLists.txt +4 -0
- package/ReactCommon/react/runtime/hermes/CMakeLists.txt +4 -0
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +7 -3
- package/flow/bom.js.flow +157 -0
- package/package.json +8 -8
- package/scripts/cocoapods/autolinking.rb +6 -0
- package/scripts/cocoapods/codegen_utils.rb +1 -1
- package/scripts/cocoapods/jsengine.rb +2 -1
- package/scripts/cocoapods/utils.rb +8 -2
- package/scripts/codegen/generate-artifacts-executor/index.js +5 -1
- package/scripts/codegen/generate-artifacts-executor/utils.js +41 -10
- package/scripts/replace-rncore-version.js +4 -2
- package/sdks/hermes-engine/hermes-engine.podspec +30 -12
- package/sdks/hermes-engine/hermes-utils.rb +41 -10
- package/sdks/hermes-engine/utils/build-apple-framework.sh +7 -1
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -1
- package/sdks/hermes-engine/utils/build-hermesc-xcode.sh +1 -1
- package/sdks/hermes-engine/utils/replace_hermes_version.js +4 -2
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/settings.gradle.kts +9 -0
- package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -0
- package/src/private/webapis/performance/EventTiming.js +34 -15
- package/src/private/webapis/performance/LongTasks.js +35 -2
- package/src/private/webapis/performance/Performance.js +23 -6
- package/src/private/webapis/performance/PerformanceEntry.js +21 -8
- package/src/private/webapis/performance/PerformanceObserver.js +30 -1
- package/src/private/webapis/performance/ResourceTiming.js +29 -18
- package/src/private/webapis/performance/UserTiming.js +33 -28
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
- package/third-party-podspecs/replace_dependencies_version.js +4 -2
|
@@ -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 = '
|
|
32
|
+
static prerelease: string | null = '0rc1';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -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
|
-
|
|
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]
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -20,7 +20,12 @@
|
|
|
20
20
|
- (UIWindow *)alertWindow
|
|
21
21
|
{
|
|
22
22
|
if (_alertWindow == nil) {
|
|
23
|
-
|
|
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];
|
|
@@ -41,6 +41,9 @@ val downloadsDir =
|
|
|
41
41
|
val thirdPartyNdkDir = File("$buildDir/third-party-ndk")
|
|
42
42
|
val reactNativeRootDir = projectDir.parent
|
|
43
43
|
|
|
44
|
+
val hermesV1Enabled =
|
|
45
|
+
rootProject.extensions.getByType(PrivateReactExtension::class.java).hermesV1Enabled.get()
|
|
46
|
+
|
|
44
47
|
// We put the publishing version from gradle.properties inside ext. so other
|
|
45
48
|
// subprojects can access it as well.
|
|
46
49
|
extra["publishing_version"] = project.findProperty("VERSION_NAME")?.toString()!!
|
|
@@ -567,6 +570,10 @@ android {
|
|
|
567
570
|
"-DCMAKE_POLICY_DEFAULT_CMP0069=NEW",
|
|
568
571
|
)
|
|
569
572
|
|
|
573
|
+
if (hermesV1Enabled) {
|
|
574
|
+
arguments("-DHERMES_V1_ENABLED=1")
|
|
575
|
+
}
|
|
576
|
+
|
|
570
577
|
targets(
|
|
571
578
|
"reactnative",
|
|
572
579
|
"jsi",
|
|
@@ -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
|
|
@@ -52,6 +53,8 @@ fun getSDKManagerPath(): String {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
val hermesV1Enabled =
|
|
57
|
+
rootProject.extensions.getByType(PrivateReactExtension::class.java).hermesV1Enabled.get()
|
|
55
58
|
val reactNativeRootDir = project(":packages:react-native:ReactAndroid").projectDir.parent
|
|
56
59
|
val customDownloadDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR")
|
|
57
60
|
val downloadsDir =
|
|
@@ -81,12 +84,21 @@ val hermesBuildOutputFileTree =
|
|
|
81
84
|
fileTree(hermesBuildDir.toString())
|
|
82
85
|
.include("**/*.cmake", "**/*.marks", "**/compiler_depends.ts", "**/Makefile", "**/link.txt")
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
val hermesVersionProvider: Provider<String> =
|
|
88
|
+
providers.provider {
|
|
89
|
+
var hermesVersion = if (hermesV1Enabled) "250829098.0.0-stable" else "main"
|
|
90
|
+
val hermesVersionFile =
|
|
91
|
+
File(
|
|
92
|
+
reactNativeRootDir,
|
|
93
|
+
if (hermesV1Enabled) "sdks/.hermesv1version" else "sdks/.hermesversion",
|
|
94
|
+
)
|
|
86
95
|
|
|
87
|
-
if (hermesVersionFile.exists()) {
|
|
88
|
-
|
|
89
|
-
}
|
|
96
|
+
if (hermesVersionFile.exists()) {
|
|
97
|
+
hermesVersion = hermesVersionFile.readText()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
hermesVersion
|
|
101
|
+
}
|
|
90
102
|
|
|
91
103
|
val ndkBuildJobs = Runtime.getRuntime().availableProcessors().toString()
|
|
92
104
|
val prefabHeadersDir = File("$buildDir/prefab-headers")
|
|
@@ -97,7 +109,11 @@ val jsiDir = File(reactNativeRootDir, "ReactCommon/jsi")
|
|
|
97
109
|
val downloadHermesDest = File(downloadsDir, "hermes.tar.gz")
|
|
98
110
|
val downloadHermes by
|
|
99
111
|
tasks.registering(Download::class) {
|
|
100
|
-
src(
|
|
112
|
+
src(
|
|
113
|
+
providers.provider {
|
|
114
|
+
"https://github.com/facebook/hermes/tarball/${hermesVersionProvider.get()}"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
101
117
|
onlyIfModified(true)
|
|
102
118
|
overwrite(true)
|
|
103
119
|
quiet(true)
|
|
@@ -153,6 +169,7 @@ val configureBuildForHermes by
|
|
|
153
169
|
"-B",
|
|
154
170
|
hermesBuildDir.toString(),
|
|
155
171
|
"-DJSI_DIR=" + jsiDir.absolutePath,
|
|
172
|
+
"-DCMAKE_BUILD_TYPE=Release",
|
|
156
173
|
)
|
|
157
174
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
158
175
|
cmakeCommandLine = cmakeCommandLine + "-GNMake Makefiles"
|
|
@@ -297,7 +314,11 @@ android {
|
|
|
297
314
|
// Therefore we're passing as build type Release, to provide a faster build.
|
|
298
315
|
// This has the (unlucky) side effect of letting AGP call the build
|
|
299
316
|
// tasks `configureCMakeRelease` while is actually building the debug flavor.
|
|
300
|
-
arguments(
|
|
317
|
+
arguments(
|
|
318
|
+
"-DCMAKE_BUILD_TYPE=Release",
|
|
319
|
+
// For debug builds, explicitly enable the Hermes Debugger.
|
|
320
|
+
"-DHERMES_ENABLE_DEBUGGER=True",
|
|
321
|
+
)
|
|
301
322
|
}
|
|
302
323
|
}
|
|
303
324
|
}
|
|
@@ -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)
|
|
@@ -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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
|
|
@@ -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
|
-
#
|
|
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
|
-
#
|
|
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 {
|