react-native 0.83.0-rc.0 → 0.83.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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +16 -0
- package/React/Runtime/React-RCTRuntime.podspec +1 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +8 -4
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +5 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
- package/ReactCommon/React-Fabric.podspec +8 -2
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -0
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +33 -0
- package/ReactCommon/jsinspector-modern/HostAgent.h +6 -0
- package/ReactCommon/jsinspector-modern/HostTarget.h +5 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +6 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +7 -0
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.cpp +37 -0
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.h +12 -1
- package/ReactCommon/jsinspector-modern/TracingAgent.cpp +11 -1
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +4 -0
- package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +90 -54
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +12 -4
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +1 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +7 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +5 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
- package/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h +4 -0
- package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +66 -0
- package/ReactCommon/react/utils/React-utils.podspec +3 -1
- package/package.json +9 -8
- package/scripts/cocoapods/rncore.rb +3 -2
- package/scripts/react_native_pods.rb +1 -0
- package/sdks/.hermesv1version +1 -0
- package/sdks/hermes-engine/version.properties +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +14 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
|
@@ -79,6 +79,12 @@ class HostAgent final {
|
|
|
79
79
|
*/
|
|
80
80
|
void emitExternalTraceRecording(tracing::TraceRecordingState traceRecording) const;
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Emits a system state changed event when the number of ReactHost instances
|
|
84
|
+
* changes.
|
|
85
|
+
*/
|
|
86
|
+
void emitSystemStateChanged(bool isSingleHost) const;
|
|
87
|
+
|
|
82
88
|
private:
|
|
83
89
|
// We use the private implementation idiom to ensure this class has the same
|
|
84
90
|
// layout regardless of whether REACT_NATIVE_DEBUGGER_ENABLED is defined. The
|
|
@@ -320,6 +320,11 @@ class JSINSPECTOR_EXPORT HostTarget : public EnableExecutorFromThis<HostTarget>
|
|
|
320
320
|
*/
|
|
321
321
|
void emitTraceRecordingForFirstFuseboxClient(tracing::TraceRecordingState traceRecording) const;
|
|
322
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Emits a system state changed event to all active sessions.
|
|
325
|
+
*/
|
|
326
|
+
void emitSystemStateChanged(bool isSingleHost) const;
|
|
327
|
+
|
|
323
328
|
private:
|
|
324
329
|
/**
|
|
325
330
|
* Constructs a new HostTarget.
|
|
@@ -17,6 +17,10 @@ InspectorFlags& InspectorFlags::getInstance() {
|
|
|
17
17
|
return instance;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
bool InspectorFlags::getAssertSingleHostState() const {
|
|
21
|
+
return loadFlagsAndAssertUnchanged().assertSingleHostState;
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
bool InspectorFlags::getFuseboxEnabled() const {
|
|
21
25
|
if (fuseboxDisabledForTest_) {
|
|
22
26
|
return false;
|
|
@@ -48,6 +52,8 @@ void InspectorFlags::dangerouslyDisableFuseboxForTest() {
|
|
|
48
52
|
const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged()
|
|
49
53
|
const {
|
|
50
54
|
InspectorFlags::Values newValues = {
|
|
55
|
+
.assertSingleHostState =
|
|
56
|
+
ReactNativeFeatureFlags::fuseboxAssertSingleHostState(),
|
|
51
57
|
.fuseboxEnabled =
|
|
52
58
|
#if defined(REACT_NATIVE_DEBUGGER_ENABLED)
|
|
53
59
|
true,
|
|
@@ -19,6 +19,12 @@ class InspectorFlags {
|
|
|
19
19
|
public:
|
|
20
20
|
static InspectorFlags &getInstance();
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Flag determining if the inspector backend should strictly assert that only
|
|
24
|
+
* a single host is registered.
|
|
25
|
+
*/
|
|
26
|
+
bool getAssertSingleHostState() const;
|
|
27
|
+
|
|
22
28
|
/**
|
|
23
29
|
* Flag determining if the modern CDP backend should be enabled.
|
|
24
30
|
*/
|
|
@@ -54,6 +60,7 @@ class InspectorFlags {
|
|
|
54
60
|
|
|
55
61
|
private:
|
|
56
62
|
struct Values {
|
|
63
|
+
bool assertSingleHostState;
|
|
57
64
|
bool fuseboxEnabled;
|
|
58
65
|
bool isProfilingBuild;
|
|
59
66
|
bool networkInspectionEnabled;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#include "InspectorInterfaces.h"
|
|
9
9
|
|
|
10
|
+
#include "InspectorFlags.h"
|
|
11
|
+
|
|
10
12
|
#include <cassert>
|
|
11
13
|
#include <list>
|
|
12
14
|
#include <mutex>
|
|
@@ -35,6 +37,14 @@ namespace {
|
|
|
35
37
|
|
|
36
38
|
class InspectorImpl : public IInspector {
|
|
37
39
|
public:
|
|
40
|
+
InspectorImpl() {
|
|
41
|
+
systemStateListener_ = std::make_shared<SystemStateListener>(systemState_);
|
|
42
|
+
auto& inspectorFlags = InspectorFlags::getInstance();
|
|
43
|
+
if (inspectorFlags.getAssertSingleHostState()) {
|
|
44
|
+
registerPageStatusListener(systemStateListener_);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
int addPage(
|
|
39
49
|
const std::string& description,
|
|
40
50
|
const std::string& vm,
|
|
@@ -50,7 +60,21 @@ class InspectorImpl : public IInspector {
|
|
|
50
60
|
void registerPageStatusListener(
|
|
51
61
|
std::weak_ptr<IPageStatusListener> listener) override;
|
|
52
62
|
|
|
63
|
+
InspectorSystemState getSystemState() const override;
|
|
64
|
+
|
|
53
65
|
private:
|
|
66
|
+
class SystemStateListener : public IPageStatusListener {
|
|
67
|
+
public:
|
|
68
|
+
explicit SystemStateListener(InspectorSystemState& state) : state_(state) {}
|
|
69
|
+
|
|
70
|
+
void onPageAdded(int /*pageId*/) override {
|
|
71
|
+
state_.registeredPagesCount++;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private:
|
|
75
|
+
InspectorSystemState& state_;
|
|
76
|
+
};
|
|
77
|
+
|
|
54
78
|
class Page {
|
|
55
79
|
public:
|
|
56
80
|
Page(
|
|
@@ -74,6 +98,8 @@ class InspectorImpl : public IInspector {
|
|
|
74
98
|
int nextPageId_{1};
|
|
75
99
|
std::map<int, Page> pages_;
|
|
76
100
|
std::list<std::weak_ptr<IPageStatusListener>> listeners_;
|
|
101
|
+
InspectorSystemState systemState_{0};
|
|
102
|
+
std::shared_ptr<SystemStateListener> systemStateListener_;
|
|
77
103
|
};
|
|
78
104
|
|
|
79
105
|
InspectorImpl::Page::Page(
|
|
@@ -116,6 +142,12 @@ int InspectorImpl::addPage(
|
|
|
116
142
|
pageId,
|
|
117
143
|
Page{pageId, description, vm, std::move(connectFunc), capabilities});
|
|
118
144
|
|
|
145
|
+
for (const auto& listenerWeak : listeners_) {
|
|
146
|
+
if (auto listener = listenerWeak.lock()) {
|
|
147
|
+
listener->onPageAdded(pageId);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
119
151
|
return pageId;
|
|
120
152
|
}
|
|
121
153
|
|
|
@@ -175,6 +207,11 @@ void InspectorImpl::registerPageStatusListener(
|
|
|
175
207
|
}
|
|
176
208
|
listeners_.push_back(listener);
|
|
177
209
|
}
|
|
210
|
+
|
|
211
|
+
InspectorSystemState InspectorImpl::getSystemState() const {
|
|
212
|
+
std::scoped_lock lock(mutex_);
|
|
213
|
+
return systemState_;
|
|
214
|
+
}
|
|
178
215
|
} // namespace
|
|
179
216
|
|
|
180
217
|
IInspector& getInspectorInstance() {
|
|
@@ -51,6 +51,11 @@ struct InspectorPageDescription {
|
|
|
51
51
|
// Alias for backwards compatibility.
|
|
52
52
|
using InspectorPage = InspectorPageDescription;
|
|
53
53
|
|
|
54
|
+
struct InspectorSystemState {
|
|
55
|
+
/** The total count of pages registered during the app lifetime. */
|
|
56
|
+
int registeredPagesCount;
|
|
57
|
+
};
|
|
58
|
+
|
|
54
59
|
/// IRemoteConnection allows the VM to send debugger messages to the client.
|
|
55
60
|
/// IRemoteConnection's methods are safe to call from any thread *if*
|
|
56
61
|
/// InspectorPackagerConnection.cpp is in use.
|
|
@@ -78,7 +83,8 @@ class JSINSPECTOR_EXPORT ILocalConnection : public IDestructible {
|
|
|
78
83
|
class JSINSPECTOR_EXPORT IPageStatusListener : public IDestructible {
|
|
79
84
|
public:
|
|
80
85
|
virtual ~IPageStatusListener() = 0;
|
|
81
|
-
virtual void
|
|
86
|
+
virtual void onPageAdded(int /*pageId*/) {}
|
|
87
|
+
virtual void onPageRemoved(int /*pageId*/) {}
|
|
82
88
|
};
|
|
83
89
|
|
|
84
90
|
/// IInspector tracks debuggable JavaScript targets (pages).
|
|
@@ -127,6 +133,11 @@ class JSINSPECTOR_EXPORT IInspector : public IDestructible {
|
|
|
127
133
|
* when pages are removed.
|
|
128
134
|
*/
|
|
129
135
|
virtual void registerPageStatusListener(std::weak_ptr<IPageStatusListener> listener) = 0;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get the current \c InspectorSystemState object.
|
|
139
|
+
*/
|
|
140
|
+
virtual InspectorSystemState getSystemState() const = 0;
|
|
130
141
|
};
|
|
131
142
|
|
|
132
143
|
class NotImplementedException : public std::exception {
|
|
@@ -53,7 +53,17 @@ TracingAgent::~TracingAgent() {
|
|
|
53
53
|
|
|
54
54
|
bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) {
|
|
55
55
|
if (req.method == "Tracing.start") {
|
|
56
|
-
|
|
56
|
+
auto& inspector = getInspectorInstance();
|
|
57
|
+
if (inspector.getSystemState().registeredPagesCount > 1) {
|
|
58
|
+
frontendChannel_(
|
|
59
|
+
cdp::jsonError(
|
|
60
|
+
req.id,
|
|
61
|
+
cdp::ErrorCode::InternalError,
|
|
62
|
+
"The Tracing domain is unavailable when multiple React Native hosts are registered."));
|
|
63
|
+
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
57
67
|
if (sessionState_.isDebuggerDomainEnabled) {
|
|
58
68
|
frontendChannel_(
|
|
59
69
|
cdp::jsonError(
|
|
@@ -42,6 +42,7 @@ Pod::Spec.new do |s|
|
|
|
42
42
|
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
|
|
43
43
|
add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp')
|
|
44
44
|
add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
|
|
45
|
+
add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"])
|
|
45
46
|
|
|
46
47
|
add_rn_third_party_dependencies(s)
|
|
47
48
|
add_rncore_dependency(s)
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<6728f8cada1d0d9d21800b4fefe76b77>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -146,6 +146,10 @@ bool ReactNativeFeatureFlags::enableInteropViewManagerClassLookUpOptimizationIOS
|
|
|
146
146
|
return getAccessor().enableInteropViewManagerClassLookUpOptimizationIOS();
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
bool ReactNativeFeatureFlags::enableIntersectionObserverByDefault() {
|
|
150
|
+
return getAccessor().enableIntersectionObserverByDefault();
|
|
151
|
+
}
|
|
152
|
+
|
|
149
153
|
bool ReactNativeFeatureFlags::enableKeyEvents() {
|
|
150
154
|
return getAccessor().enableKeyEvents();
|
|
151
155
|
}
|
|
@@ -242,6 +246,10 @@ bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact()
|
|
|
242
246
|
return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
|
243
247
|
}
|
|
244
248
|
|
|
249
|
+
bool ReactNativeFeatureFlags::fuseboxAssertSingleHostState() {
|
|
250
|
+
return getAccessor().fuseboxAssertSingleHostState();
|
|
251
|
+
}
|
|
252
|
+
|
|
245
253
|
bool ReactNativeFeatureFlags::fuseboxEnabledRelease() {
|
|
246
254
|
return getAccessor().fuseboxEnabledRelease();
|
|
247
255
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<4b8574d0682b5e9644affc89559393ac>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -189,6 +189,11 @@ class ReactNativeFeatureFlags {
|
|
|
189
189
|
*/
|
|
190
190
|
RN_EXPORT static bool enableInteropViewManagerClassLookUpOptimizationIOS();
|
|
191
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Enables the IntersectionObserver Web API in React Native.
|
|
194
|
+
*/
|
|
195
|
+
RN_EXPORT static bool enableIntersectionObserverByDefault();
|
|
196
|
+
|
|
192
197
|
/**
|
|
193
198
|
* Enables key up/down/press events to be sent to JS from components
|
|
194
199
|
*/
|
|
@@ -309,6 +314,11 @@ class ReactNativeFeatureFlags {
|
|
|
309
314
|
*/
|
|
310
315
|
RN_EXPORT static bool fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
|
311
316
|
|
|
317
|
+
/**
|
|
318
|
+
* Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`.
|
|
319
|
+
*/
|
|
320
|
+
RN_EXPORT static bool fuseboxAssertSingleHostState();
|
|
321
|
+
|
|
312
322
|
/**
|
|
313
323
|
* Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.
|
|
314
324
|
*/
|