react-native 0.74.0-nightly-20240128-cfc0ba04a → 1000.0.0
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/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -1
- package/Libraries/AppDelegate/RCTAppDelegate.mm +2 -1
- package/Libraries/Blob/React-RCTBlob.podspec +1 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +69 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +24 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +33 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +13 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -3
- package/Libraries/Core/ReactNativeVersionCheck.js +1 -1
- package/Libraries/Core/registerCallableModule.js +42 -0
- package/Libraries/Image/RCTImageLoader.mm +4 -11
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +31 -13
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -33
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +12 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +24543 -21110
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4104 -3058
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4352 -3273
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +25038 -21457
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3721 -2600
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4024 -2869
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +43 -4
- package/Libraries/WebPerformance/Performance.js +1 -1
- package/React/Base/RCTBridge+Private.h +14 -0
- package/React/Base/RCTBridge.mm +6 -0
- package/React/Base/RCTKeyCommands.m +12 -1
- package/React/Base/RCTVersion.m +3 -3
- package/React/CoreModules/RCTAlertController.mm +2 -3
- package/React/CoreModules/RCTAppearance.mm +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/CxxBridge/RCTCxxBridge.mm +21 -3
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +22 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -2
- package/React/Fabric/RCTConversions.h +2 -18
- package/React/React-RCTFabric.podspec +1 -0
- package/React-Core.podspec +1 -3
- package/ReactAndroid/api/ReactAndroid.api +53 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DecayAnimation.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ObjectAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +5 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +11 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +9 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ScaleTypeStartInside.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/PopupMenuSelectionEvent.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuContainer.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuManager.kt +54 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +2 -2
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +2 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +9 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
- package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.cpp +7 -1
- package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.h +2 -1
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +16 -10
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp +0 -3
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h +0 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +7 -6
- package/ReactCommon/cxxreact/Instance.cpp +34 -18
- package/ReactCommon/cxxreact/Instance.h +13 -2
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/jsinspector-modern/InstanceAgent.cpp +34 -0
- package/ReactCommon/jsinspector-modern/InstanceAgent.h +54 -0
- package/ReactCommon/jsinspector-modern/InstanceTarget.cpp +25 -0
- package/ReactCommon/jsinspector-modern/InstanceTarget.h +58 -0
- package/ReactCommon/jsinspector-modern/PageAgent.cpp +65 -0
- package/ReactCommon/jsinspector-modern/PageAgent.h +13 -0
- package/ReactCommon/jsinspector-modern/PageTarget.cpp +41 -0
- package/ReactCommon/jsinspector-modern/PageTarget.h +28 -1
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +12 -1
- package/ReactCommon/jsinspector-modern/ReactCdp.h +1 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +2 -0
- package/ReactCommon/jsinspector-modern/tests/PageTargetTest.cpp +164 -10
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +18 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +3 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
- package/ReactCommon/react/featureflags/tests/ReactNativeFeatureFlagsTest.cpp +4 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
- package/ReactCommon/react/renderer/attributedstring/primitives.h +0 -86
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +4 -1
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +0 -16
- package/ReactCommon/react/renderer/components/view/CSSTokenizer.cpp +187 -0
- package/ReactCommon/react/renderer/components/view/CSSTokenizer.h +101 -0
- package/ReactCommon/react/renderer/components/view/tests/CSSTokenizerTest.cpp +144 -0
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +0 -1
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +14 -6
- package/ReactCommon/react/renderer/core/LayoutPrimitives.h +0 -17
- package/ReactCommon/react/renderer/core/graphicsConversions.h +2 -23
- package/ReactCommon/react/renderer/core/propsConversions.h +0 -1
- package/ReactCommon/react/renderer/graphics/Color.h +7 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +6 -1
- package/ReactCommon/react/renderer/graphics/fromRawValueShared.h +50 -0
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/PlatformColorParser.h +18 -7
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/PlatformColorParser.h +16 -4
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +55 -15
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +132 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.h +15 -17
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.mm +73 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +8 -2
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm +14 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +4 -19
- package/ReactCommon/react/runtime/ReactInstance.cpp +15 -2
- package/ReactCommon/react/runtime/ReactInstance.h +13 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +5 -3
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +3 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +10 -2
- package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +5 -2
- package/ReactCommon/react/utils/hash_combine.h +8 -6
- package/gradle/libs.versions.toml +1 -1
- package/index.js +9 -0
- package/package.json +9 -9
- 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/src/private/featureflags/NativeReactNativeFeatureFlags.js +2 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +42 -1
- package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +47 -0
- package/template/Gemfile +3 -1
- package/template/package.json +5 -5
- package/Libraries/Performance/QuickPerformanceLogger.js +0 -155
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.h +0 -16
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <jsinspector-modern/InspectorInterfaces.h>
|
|
11
|
+
#include <jsinspector-modern/InstanceTarget.h>
|
|
11
12
|
|
|
12
13
|
#include <list>
|
|
13
14
|
#include <optional>
|
|
@@ -83,6 +84,8 @@ class PageTargetController {
|
|
|
83
84
|
|
|
84
85
|
PageTargetDelegate& getDelegate();
|
|
85
86
|
|
|
87
|
+
bool hasInstance() const;
|
|
88
|
+
|
|
86
89
|
private:
|
|
87
90
|
PageTarget& target_;
|
|
88
91
|
};
|
|
@@ -107,7 +110,7 @@ class JSINSPECTOR_EXPORT PageTarget {
|
|
|
107
110
|
explicit PageTarget(PageTargetDelegate& delegate);
|
|
108
111
|
|
|
109
112
|
PageTarget(const PageTarget&) = delete;
|
|
110
|
-
PageTarget(PageTarget&&) =
|
|
113
|
+
PageTarget(PageTarget&&) = delete;
|
|
111
114
|
PageTarget& operator=(const PageTarget&) = delete;
|
|
112
115
|
PageTarget& operator=(PageTarget&&) = delete;
|
|
113
116
|
~PageTarget();
|
|
@@ -123,11 +126,31 @@ class JSINSPECTOR_EXPORT PageTarget {
|
|
|
123
126
|
std::unique_ptr<IRemoteConnection> connectionToFrontend,
|
|
124
127
|
SessionMetadata sessionMetadata = {});
|
|
125
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Registers an instance with this PageTarget.
|
|
131
|
+
* \param delegate The InstanceTargetDelegate that will receive events from
|
|
132
|
+
* this InstanceTarget. The caller is responsible for ensuring that the
|
|
133
|
+
* InstanceTargetDelegate outlives this object.
|
|
134
|
+
* \return An InstanceTarget reference representing the newly created
|
|
135
|
+
* instance. This reference is only valid until unregisterInstance is called
|
|
136
|
+
* (or the PageTarget is destroyed). \pre There isn't currently an instance
|
|
137
|
+
* registered with this PageTarget.
|
|
138
|
+
*/
|
|
139
|
+
InstanceTarget& registerInstance(InstanceTargetDelegate& delegate);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Unregisters an instance from this PageTarget.
|
|
143
|
+
* \param instance The InstanceTarget reference previously returned by
|
|
144
|
+
* registerInstance.
|
|
145
|
+
*/
|
|
146
|
+
void unregisterInstance(InstanceTarget& instance);
|
|
147
|
+
|
|
126
148
|
private:
|
|
127
149
|
std::list<std::weak_ptr<PageTargetSession>> sessions_;
|
|
128
150
|
|
|
129
151
|
PageTargetDelegate& delegate_;
|
|
130
152
|
PageTargetController controller_{*this};
|
|
153
|
+
std::optional<InstanceTarget> currentInstance_{std::nullopt};
|
|
131
154
|
|
|
132
155
|
/**
|
|
133
156
|
* Call the given function for every active session, and clean up any
|
|
@@ -151,6 +174,10 @@ class JSINSPECTOR_EXPORT PageTarget {
|
|
|
151
174
|
return delegate_;
|
|
152
175
|
}
|
|
153
176
|
|
|
177
|
+
inline bool hasInstance() const {
|
|
178
|
+
return currentInstance_.has_value();
|
|
179
|
+
}
|
|
180
|
+
|
|
154
181
|
// Necessary to allow PageAgent to access PageTarget's internals in a
|
|
155
182
|
// controlled way (i.e. only PageTargetController gets friend access, while
|
|
156
183
|
// PageAgent itself doesn't).
|
|
@@ -20,6 +20,10 @@ folly_config = get_folly_config()
|
|
|
20
20
|
folly_compiler_flags = folly_config[:compiler_flags]
|
|
21
21
|
folly_version = folly_config[:version]
|
|
22
22
|
|
|
23
|
+
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
|
|
24
|
+
|
|
25
|
+
header_dir = 'jsinspector-modern'
|
|
26
|
+
module_name = "jsinspector_modern"
|
|
23
27
|
Pod::Spec.new do |s|
|
|
24
28
|
s.name = "React-jsinspector"
|
|
25
29
|
s.version = version
|
|
@@ -35,7 +39,14 @@ Pod::Spec.new do |s|
|
|
|
35
39
|
s.pod_target_xcconfig = {
|
|
36
40
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
|
|
37
41
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20"
|
|
38
|
-
|
|
42
|
+
}.merge!(use_frameworks ? {
|
|
43
|
+
"PUBLIC_HEADERS_FOLDER_PATH" => "#{module_name}.framework/Headers/#{header_dir}"
|
|
44
|
+
} : {})
|
|
45
|
+
|
|
46
|
+
if use_frameworks
|
|
47
|
+
s.module_name = module_name
|
|
48
|
+
end
|
|
49
|
+
|
|
39
50
|
s.dependency "glog"
|
|
40
51
|
s.dependency "RCT-Folly", folly_version
|
|
41
52
|
s.dependency "React-nativeconfig"
|
|
@@ -121,4 +121,6 @@ class MockPageTargetDelegate : public PageTargetDelegate {
|
|
|
121
121
|
MOCK_METHOD(void, onReload, (const PageReloadRequest& request), (override));
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
+
class MockInstanceTargetDelegate : public InstanceTargetDelegate {};
|
|
125
|
+
|
|
124
126
|
} // namespace facebook::react::jsinspector_modern
|
|
@@ -25,30 +25,29 @@ namespace facebook::react::jsinspector_modern {
|
|
|
25
25
|
|
|
26
26
|
namespace {
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
public:
|
|
33
|
-
PageTargetProtocolTest() {
|
|
28
|
+
class PageTargetTest : public Test {
|
|
29
|
+
protected:
|
|
30
|
+
void connect() {
|
|
31
|
+
ASSERT_FALSE(toPage_) << "Can only connect once in a PageTargetTest.";
|
|
34
32
|
toPage_ = page_.connect(
|
|
35
33
|
remoteConnections_.make_unique(),
|
|
36
|
-
{.integrationName = "
|
|
34
|
+
{.integrationName = "PageTargetTest"});
|
|
37
35
|
|
|
38
|
-
//
|
|
36
|
+
// We'll always get an onDisconnect call when we tear
|
|
39
37
|
// down the test. Expect it in order to satisfy the strict mock.
|
|
40
38
|
EXPECT_CALL(*remoteConnections_[0], onDisconnect());
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
protected:
|
|
44
41
|
MockPageTargetDelegate pageTargetDelegate_;
|
|
45
42
|
|
|
46
43
|
MockRemoteConnection& fromPage() {
|
|
44
|
+
assert(toPage_);
|
|
47
45
|
return *remoteConnections_[0];
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
private:
|
|
51
48
|
PageTarget page_{pageTargetDelegate_};
|
|
49
|
+
|
|
50
|
+
private:
|
|
52
51
|
UniquePtrFactory<StrictMock<MockRemoteConnection>> remoteConnections_;
|
|
53
52
|
|
|
54
53
|
protected:
|
|
@@ -56,6 +55,20 @@ class PageTargetProtocolTest : public Test {
|
|
|
56
55
|
std::unique_ptr<ILocalConnection> toPage_;
|
|
57
56
|
};
|
|
58
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Simplified test harness focused on sending messages to and from a PageTarget.
|
|
60
|
+
*/
|
|
61
|
+
class PageTargetProtocolTest : public PageTargetTest {
|
|
62
|
+
public:
|
|
63
|
+
PageTargetProtocolTest() {
|
|
64
|
+
connect();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private:
|
|
68
|
+
// Protocol tests shouldn't manually call connect()
|
|
69
|
+
using PageTargetTest::connect;
|
|
70
|
+
};
|
|
71
|
+
|
|
59
72
|
} // namespace
|
|
60
73
|
|
|
61
74
|
TEST_F(PageTargetProtocolTest, UnrecognizedMethod) {
|
|
@@ -169,4 +182,145 @@ TEST_F(PageTargetProtocolTest, PageReloadMethod) {
|
|
|
169
182
|
})");
|
|
170
183
|
}
|
|
171
184
|
|
|
185
|
+
TEST_F(PageTargetProtocolTest, RegisterUnregisterInstanceWithoutEvents) {
|
|
186
|
+
MockInstanceTargetDelegate instanceTargetDelegate;
|
|
187
|
+
|
|
188
|
+
auto& instanceTarget = page_.registerInstance(instanceTargetDelegate);
|
|
189
|
+
|
|
190
|
+
page_.unregisterInstance(instanceTarget);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
TEST_F(PageTargetTest, ConnectToAlreadyRegisteredInstanceWithoutEvents) {
|
|
194
|
+
MockInstanceTargetDelegate instanceTargetDelegate;
|
|
195
|
+
|
|
196
|
+
auto& instanceTarget = page_.registerInstance(instanceTargetDelegate);
|
|
197
|
+
|
|
198
|
+
connect();
|
|
199
|
+
|
|
200
|
+
page_.unregisterInstance(instanceTarget);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
TEST_F(PageTargetProtocolTest, RegisterUnregisterInstanceWithEvents) {
|
|
204
|
+
InSequence s;
|
|
205
|
+
|
|
206
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
207
|
+
"id": 1,
|
|
208
|
+
"result": {}
|
|
209
|
+
})")));
|
|
210
|
+
toPage_->sendMessage(R"({
|
|
211
|
+
"id": 1,
|
|
212
|
+
"method": "Runtime.enable"
|
|
213
|
+
})");
|
|
214
|
+
|
|
215
|
+
MockInstanceTargetDelegate instanceTargetDelegate;
|
|
216
|
+
|
|
217
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
218
|
+
"method": "Runtime.executionContextCreated",
|
|
219
|
+
"params": {
|
|
220
|
+
"context": {
|
|
221
|
+
"id": 1,
|
|
222
|
+
"origin": "",
|
|
223
|
+
"name": "React Native"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
})")));
|
|
227
|
+
auto& instanceTarget = page_.registerInstance(instanceTargetDelegate);
|
|
228
|
+
|
|
229
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
230
|
+
"method": "Runtime.executionContextDestroyed",
|
|
231
|
+
"params": {
|
|
232
|
+
"executionContextId": 1
|
|
233
|
+
}
|
|
234
|
+
})")));
|
|
235
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
236
|
+
"method": "Runtime.executionContextsCleared"
|
|
237
|
+
})")));
|
|
238
|
+
page_.unregisterInstance(instanceTarget);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
TEST_F(PageTargetTest, ConnectToAlreadyRegisteredInstanceWithEvents) {
|
|
242
|
+
MockInstanceTargetDelegate instanceTargetDelegate;
|
|
243
|
+
auto& instanceTarget = page_.registerInstance(instanceTargetDelegate);
|
|
244
|
+
|
|
245
|
+
connect();
|
|
246
|
+
|
|
247
|
+
InSequence s;
|
|
248
|
+
|
|
249
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
250
|
+
"id": 1,
|
|
251
|
+
"result": {}
|
|
252
|
+
})")));
|
|
253
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
254
|
+
"method": "Runtime.executionContextCreated",
|
|
255
|
+
"params": {
|
|
256
|
+
"context": {
|
|
257
|
+
"id": 1,
|
|
258
|
+
"origin": "",
|
|
259
|
+
"name": "React Native"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
})")));
|
|
263
|
+
|
|
264
|
+
toPage_->sendMessage(R"({
|
|
265
|
+
"id": 1,
|
|
266
|
+
"method": "Runtime.enable"
|
|
267
|
+
})");
|
|
268
|
+
|
|
269
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
270
|
+
"method": "Runtime.executionContextDestroyed",
|
|
271
|
+
"params": {
|
|
272
|
+
"executionContextId": 1
|
|
273
|
+
}
|
|
274
|
+
})")));
|
|
275
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
276
|
+
"method": "Runtime.executionContextsCleared"
|
|
277
|
+
})")));
|
|
278
|
+
page_.unregisterInstance(instanceTarget);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
TEST_F(PageTargetProtocolTest, RespondToHeapUsageMethodWhileInstanceExists) {
|
|
282
|
+
// NOTE: This test will be deleted once we add some real CDP method
|
|
283
|
+
// implementations to InstanceAgent.
|
|
284
|
+
|
|
285
|
+
EXPECT_CALL(
|
|
286
|
+
fromPage(),
|
|
287
|
+
onMessage(JsonParsed(AllOf(
|
|
288
|
+
AtJsonPtr("/error/code", Eq(-32601)), AtJsonPtr("/id", Eq(1))))))
|
|
289
|
+
.RetiresOnSaturation();
|
|
290
|
+
|
|
291
|
+
toPage_->sendMessage(R"({
|
|
292
|
+
"id": 1,
|
|
293
|
+
"method": "Runtime.getHeapUsage"
|
|
294
|
+
})");
|
|
295
|
+
|
|
296
|
+
MockInstanceTargetDelegate instanceTargetDelegate;
|
|
297
|
+
auto& instanceTarget = page_.registerInstance(instanceTargetDelegate);
|
|
298
|
+
|
|
299
|
+
EXPECT_CALL(fromPage(), onMessage(JsonEq(R"({
|
|
300
|
+
"id": 2,
|
|
301
|
+
"result": {
|
|
302
|
+
"usedSize": 0,
|
|
303
|
+
"totalSize": 0
|
|
304
|
+
}
|
|
305
|
+
})")));
|
|
306
|
+
|
|
307
|
+
toPage_->sendMessage(R"({
|
|
308
|
+
"id": 2,
|
|
309
|
+
"method": "Runtime.getHeapUsage"
|
|
310
|
+
})");
|
|
311
|
+
|
|
312
|
+
page_.unregisterInstance(instanceTarget);
|
|
313
|
+
|
|
314
|
+
EXPECT_CALL(
|
|
315
|
+
fromPage(),
|
|
316
|
+
onMessage(JsonParsed(AllOf(
|
|
317
|
+
AtJsonPtr("/error/code", Eq(-32601)), AtJsonPtr("/id", Eq(3))))))
|
|
318
|
+
.RetiresOnSaturation();
|
|
319
|
+
|
|
320
|
+
toPage_->sendMessage(R"({
|
|
321
|
+
"id": 3,
|
|
322
|
+
"method": "Runtime.getHeapUsage"
|
|
323
|
+
})");
|
|
324
|
+
}
|
|
325
|
+
|
|
172
326
|
} // namespace facebook::react::jsinspector_modern
|
|
@@ -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<<809c23db6d36e18d448554900e462aa0>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -37,6 +37,10 @@ bool ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop() {
|
|
|
37
37
|
return getAccessor().batchRenderingUpdatesInEventLoop();
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
bool ReactNativeFeatureFlags::enableSpannableBuildingUnification() {
|
|
41
|
+
return getAccessor().enableSpannableBuildingUnification();
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
void ReactNativeFeatureFlags::override(
|
|
41
45
|
std::unique_ptr<ReactNativeFeatureFlagsProvider> provider) {
|
|
42
46
|
getAccessor().override(std::move(provider));
|
|
@@ -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<<ea6c88fb2c3fcaa35b5886b8f8ceb769>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -52,6 +52,11 @@ class ReactNativeFeatureFlags {
|
|
|
52
52
|
*/
|
|
53
53
|
static bool batchRenderingUpdatesInEventLoop();
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Uses new, deduplicated logic for constructing Android Spannables from text fragments
|
|
57
|
+
*/
|
|
58
|
+
static bool enableSpannableBuildingUnification();
|
|
59
|
+
|
|
55
60
|
/**
|
|
56
61
|
* Overrides the feature flags with the ones provided by the given provider
|
|
57
62
|
* (generally one that extends `ReactNativeFeatureFlagsDefaults`).
|
|
@@ -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<<15858c6ab96e90350aa5f29eb108b051>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -96,6 +96,23 @@ bool ReactNativeFeatureFlagsAccessor::batchRenderingUpdatesInEventLoop() {
|
|
|
96
96
|
return batchRenderingUpdatesInEventLoop_.value();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
bool ReactNativeFeatureFlagsAccessor::enableSpannableBuildingUnification() {
|
|
100
|
+
if (!enableSpannableBuildingUnification_.has_value()) {
|
|
101
|
+
// Mark the flag as accessed.
|
|
102
|
+
static const char* flagName = "enableSpannableBuildingUnification";
|
|
103
|
+
if (std::find(
|
|
104
|
+
accessedFeatureFlags_.begin(),
|
|
105
|
+
accessedFeatureFlags_.end(),
|
|
106
|
+
flagName) == accessedFeatureFlags_.end()) {
|
|
107
|
+
accessedFeatureFlags_.push_back(flagName);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
enableSpannableBuildingUnification_.emplace(currentProvider_->enableSpannableBuildingUnification());
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return enableSpannableBuildingUnification_.value();
|
|
114
|
+
}
|
|
115
|
+
|
|
99
116
|
void ReactNativeFeatureFlagsAccessor::override(
|
|
100
117
|
std::unique_ptr<ReactNativeFeatureFlagsProvider> provider) {
|
|
101
118
|
if (!accessedFeatureFlags_.empty()) {
|
|
@@ -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<<938f1f3ad6aa3343beb3ad7707a49a87>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -34,6 +34,7 @@ class ReactNativeFeatureFlagsAccessor {
|
|
|
34
34
|
bool useModernRuntimeScheduler();
|
|
35
35
|
bool enableMicrotasks();
|
|
36
36
|
bool batchRenderingUpdatesInEventLoop();
|
|
37
|
+
bool enableSpannableBuildingUnification();
|
|
37
38
|
|
|
38
39
|
void override(std::unique_ptr<ReactNativeFeatureFlagsProvider> provider);
|
|
39
40
|
|
|
@@ -45,6 +46,7 @@ class ReactNativeFeatureFlagsAccessor {
|
|
|
45
46
|
std::optional<bool> useModernRuntimeScheduler_;
|
|
46
47
|
std::optional<bool> enableMicrotasks_;
|
|
47
48
|
std::optional<bool> batchRenderingUpdatesInEventLoop_;
|
|
49
|
+
std::optional<bool> enableSpannableBuildingUnification_;
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
} // namespace facebook::react
|
|
@@ -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<<18dc9a1aa23d156bc94e426ee1864359>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -42,6 +42,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
|
|
42
42
|
bool batchRenderingUpdatesInEventLoop() override {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
bool enableSpannableBuildingUnification() override {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
45
49
|
};
|
|
46
50
|
|
|
47
51
|
} // namespace facebook::react
|
|
@@ -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<<2828ad8eb7ea0a0ea9cb0240eadedeb8>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -29,6 +29,7 @@ class ReactNativeFeatureFlagsProvider {
|
|
|
29
29
|
virtual bool useModernRuntimeScheduler() = 0;
|
|
30
30
|
virtual bool enableMicrotasks() = 0;
|
|
31
31
|
virtual bool batchRenderingUpdatesInEventLoop() = 0;
|
|
32
|
+
virtual bool enableSpannableBuildingUnification() = 0;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
} // namespace facebook::react
|
|
@@ -28,6 +28,10 @@ class ReactNativeFeatureFlagsTest : public testing::Test {
|
|
|
28
28
|
void SetUp() override {
|
|
29
29
|
overrideAccessCount = 0;
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
void TearDown() override {
|
|
33
|
+
ReactNativeFeatureFlags::dangerouslyReset();
|
|
34
|
+
}
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
TEST_F(ReactNativeFeatureFlagsTest, providesDefaults) {
|
|
@@ -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<<de38e5abc0430aedc0fe94f0c73fee3d>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -55,4 +55,9 @@ bool NativeReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop(
|
|
|
55
55
|
return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop();
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
bool NativeReactNativeFeatureFlags::enableSpannableBuildingUnification(
|
|
59
|
+
jsi::Runtime& /*runtime*/) {
|
|
60
|
+
return ReactNativeFeatureFlags::enableSpannableBuildingUnification();
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
} // namespace facebook::react
|
|
@@ -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<<b6444bb426632dfb672312df3384127f>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -37,6 +37,8 @@ class NativeReactNativeFeatureFlags
|
|
|
37
37
|
bool enableMicrotasks(jsi::Runtime& runtime);
|
|
38
38
|
|
|
39
39
|
bool batchRenderingUpdatesInEventLoop(jsi::Runtime& runtime);
|
|
40
|
+
|
|
41
|
+
bool enableSpannableBuildingUnification(jsi::Runtime& runtime);
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
} // namespace facebook::react
|
|
@@ -120,89 +120,3 @@ enum class HyphenationFrequency {
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
} // namespace facebook::react
|
|
123
|
-
|
|
124
|
-
namespace std {
|
|
125
|
-
template <>
|
|
126
|
-
struct hash<facebook::react::FontVariant> {
|
|
127
|
-
size_t operator()(const facebook::react::FontVariant& v) const {
|
|
128
|
-
return hash<int>()(static_cast<int>(v));
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
template <>
|
|
133
|
-
struct hash<facebook::react::TextAlignment> {
|
|
134
|
-
size_t operator()(const facebook::react::TextAlignment& v) const {
|
|
135
|
-
return hash<int>()(static_cast<int>(v));
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
template <>
|
|
140
|
-
struct hash<facebook::react::FontStyle> {
|
|
141
|
-
size_t operator()(const facebook::react::FontStyle& v) const {
|
|
142
|
-
return hash<int>()(static_cast<int>(v));
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
template <>
|
|
147
|
-
struct hash<facebook::react::TextDecorationLineType> {
|
|
148
|
-
size_t operator()(const facebook::react::TextDecorationLineType& v) const {
|
|
149
|
-
return hash<int>()(static_cast<int>(v));
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
template <>
|
|
154
|
-
struct hash<facebook::react::WritingDirection> {
|
|
155
|
-
size_t operator()(const facebook::react::WritingDirection& v) const {
|
|
156
|
-
return hash<int>()(static_cast<int>(v));
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
template <>
|
|
161
|
-
struct hash<facebook::react::TextDecorationStyle> {
|
|
162
|
-
size_t operator()(const facebook::react::TextDecorationStyle& v) const {
|
|
163
|
-
return hash<int>()(static_cast<int>(v));
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
template <>
|
|
168
|
-
struct hash<facebook::react::FontWeight> {
|
|
169
|
-
size_t operator()(const facebook::react::FontWeight& v) const {
|
|
170
|
-
return hash<int>()(static_cast<int>(v));
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
template <>
|
|
175
|
-
struct hash<facebook::react::DynamicTypeRamp> {
|
|
176
|
-
size_t operator()(const facebook::react::DynamicTypeRamp& v) const {
|
|
177
|
-
return hash<int>()(static_cast<int>(v));
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
template <>
|
|
182
|
-
struct hash<facebook::react::EllipsizeMode> {
|
|
183
|
-
size_t operator()(const facebook::react::EllipsizeMode& v) const {
|
|
184
|
-
return hash<int>()(static_cast<int>(v));
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
template <>
|
|
189
|
-
struct hash<facebook::react::TextBreakStrategy> {
|
|
190
|
-
size_t operator()(const facebook::react::TextBreakStrategy& v) const {
|
|
191
|
-
return hash<int>()(static_cast<int>(v));
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
template <>
|
|
196
|
-
struct hash<facebook::react::TextTransform> {
|
|
197
|
-
size_t operator()(const facebook::react::TextTransform& v) const {
|
|
198
|
-
return hash<int>()(static_cast<int>(v));
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
template <>
|
|
203
|
-
struct hash<facebook::react::HyphenationFrequency> {
|
|
204
|
-
size_t operator()(const facebook::react::HyphenationFrequency& v) const {
|
|
205
|
-
return hash<int>()(static_cast<int>(v));
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
} // namespace std
|
|
@@ -30,7 +30,10 @@ ParagraphShadowNode::ParagraphShadowNode(
|
|
|
30
30
|
const ShadowNode& sourceShadowNode,
|
|
31
31
|
const ShadowNodeFragment& fragment)
|
|
32
32
|
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
|
|
33
|
-
|
|
33
|
+
auto& sourceParagraphShadowNode =
|
|
34
|
+
traitCast<ParagraphShadowNode const&>(sourceShadowNode);
|
|
35
|
+
if (!fragment.children && !fragment.props &&
|
|
36
|
+
sourceParagraphShadowNode.getIsLayoutClean()) {
|
|
34
37
|
// This ParagraphShadowNode was cloned but did not change
|
|
35
38
|
// in a way that affects its layout. Let's mark it clean
|
|
36
39
|
// to stop Yoga from traversing it.
|
|
@@ -248,19 +248,3 @@ enum class Role {
|
|
|
248
248
|
};
|
|
249
249
|
|
|
250
250
|
} // namespace facebook::react
|
|
251
|
-
|
|
252
|
-
namespace std {
|
|
253
|
-
template <>
|
|
254
|
-
struct hash<facebook::react::AccessibilityRole> {
|
|
255
|
-
size_t operator()(const facebook::react::AccessibilityRole& v) const {
|
|
256
|
-
return hash<int>()(static_cast<int>(v));
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
template <>
|
|
261
|
-
struct hash<facebook::react::Role> {
|
|
262
|
-
size_t operator()(const facebook::react::Role& v) const {
|
|
263
|
-
return hash<int>()(static_cast<int>(v));
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
} // namespace std
|