react-native 0.74.0 → 0.74.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.
- package/Libraries/AppDelegate/RCTAppDelegate+Protected.h +16 -0
- package/Libraries/AppDelegate/RCTAppDelegate.mm +32 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTUtils.m +28 -8
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -3
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm +22 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +5 -1
- package/React/Fabric/RCTScheduler.h +2 -0
- package/React/Fabric/RCTScheduler.mm +6 -0
- package/React/Fabric/RCTSurfacePresenter.mm +5 -0
- package/React/Modules/RCTUIManager.m +8 -9
- package/React/Views/RCTComponentData.m +14 -1
- package/ReactAndroid/api/ReactAndroid.api +1 -2
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +24 -9
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +19 -7
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +31 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +34 -12
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +11 -18
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +10 -0
- package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +38 -3
- package/ReactAndroid/src/main/jni/react/fabric/Binding.h +8 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +43 -15
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +10 -4
- package/ReactCommon/ReactCommon.podspec +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsc/JSCRuntime.cpp +2 -0
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +13 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +16 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +62 -26
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +8 -4
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +13 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +4 -2
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +16 -6
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +7 -3
- package/ReactCommon/react/renderer/mounting/MountingTransaction.cpp +13 -0
- package/ReactCommon/react/renderer/mounting/MountingTransaction.h +9 -0
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +7 -2
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +11 -0
- package/package.json +11 -11
- package/scripts/cocoapods/privacy_manifest_utils.rb +172 -0
- package/scripts/cocoapods/utils.rb +1 -38
- package/scripts/react_native_pods.rb +12 -3
- package/sdks/.hermesversion +1 -1
- 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 +4 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +16 -6
- package/template/package.json +5 -5
- package/third-party-podspecs/RCT-Folly.podspec +1 -0
|
@@ -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<<5311a007bec258c79bf1ca3e2355101c>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -47,8 +47,8 @@ bool ReactNativeFeatureFlagsAccessor::commonTestFlag() {
|
|
|
47
47
|
return flagValue.value();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
bool ReactNativeFeatureFlagsAccessor::
|
|
51
|
-
auto flagValue =
|
|
50
|
+
bool ReactNativeFeatureFlagsAccessor::androidEnablePendingFabricTransactions() {
|
|
51
|
+
auto flagValue = androidEnablePendingFabricTransactions_.load();
|
|
52
52
|
|
|
53
53
|
if (!flagValue.has_value()) {
|
|
54
54
|
// This block is not exclusive but it is not necessary.
|
|
@@ -56,17 +56,17 @@ bool ReactNativeFeatureFlagsAccessor::enableBackgroundExecutor() {
|
|
|
56
56
|
// be accessing the provider multiple times but the end state of this
|
|
57
57
|
// instance and the returned flag value would be the same.
|
|
58
58
|
|
|
59
|
-
markFlagAsAccessed(1, "
|
|
59
|
+
markFlagAsAccessed(1, "androidEnablePendingFabricTransactions");
|
|
60
60
|
|
|
61
|
-
flagValue = currentProvider_->
|
|
62
|
-
|
|
61
|
+
flagValue = currentProvider_->androidEnablePendingFabricTransactions();
|
|
62
|
+
androidEnablePendingFabricTransactions_ = flagValue;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return flagValue.value();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
bool ReactNativeFeatureFlagsAccessor::
|
|
69
|
-
auto flagValue =
|
|
68
|
+
bool ReactNativeFeatureFlagsAccessor::batchRenderingUpdatesInEventLoop() {
|
|
69
|
+
auto flagValue = batchRenderingUpdatesInEventLoop_.load();
|
|
70
70
|
|
|
71
71
|
if (!flagValue.has_value()) {
|
|
72
72
|
// This block is not exclusive but it is not necessary.
|
|
@@ -74,17 +74,17 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
|
|
|
74
74
|
// be accessing the provider multiple times but the end state of this
|
|
75
75
|
// instance and the returned flag value would be the same.
|
|
76
76
|
|
|
77
|
-
markFlagAsAccessed(2, "
|
|
77
|
+
markFlagAsAccessed(2, "batchRenderingUpdatesInEventLoop");
|
|
78
78
|
|
|
79
|
-
flagValue = currentProvider_->
|
|
80
|
-
|
|
79
|
+
flagValue = currentProvider_->batchRenderingUpdatesInEventLoop();
|
|
80
|
+
batchRenderingUpdatesInEventLoop_ = flagValue;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
return flagValue.value();
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
bool ReactNativeFeatureFlagsAccessor::
|
|
87
|
-
auto flagValue =
|
|
86
|
+
bool ReactNativeFeatureFlagsAccessor::destroyFabricSurfacesInReactInstanceManager() {
|
|
87
|
+
auto flagValue = destroyFabricSurfacesInReactInstanceManager_.load();
|
|
88
88
|
|
|
89
89
|
if (!flagValue.has_value()) {
|
|
90
90
|
// This block is not exclusive but it is not necessary.
|
|
@@ -92,17 +92,17 @@ bool ReactNativeFeatureFlagsAccessor::enableMicrotasks() {
|
|
|
92
92
|
// be accessing the provider multiple times but the end state of this
|
|
93
93
|
// instance and the returned flag value would be the same.
|
|
94
94
|
|
|
95
|
-
markFlagAsAccessed(3, "
|
|
95
|
+
markFlagAsAccessed(3, "destroyFabricSurfacesInReactInstanceManager");
|
|
96
96
|
|
|
97
|
-
flagValue = currentProvider_->
|
|
98
|
-
|
|
97
|
+
flagValue = currentProvider_->destroyFabricSurfacesInReactInstanceManager();
|
|
98
|
+
destroyFabricSurfacesInReactInstanceManager_ = flagValue;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
return flagValue.value();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
bool ReactNativeFeatureFlagsAccessor::
|
|
105
|
-
auto flagValue =
|
|
104
|
+
bool ReactNativeFeatureFlagsAccessor::enableBackgroundExecutor() {
|
|
105
|
+
auto flagValue = enableBackgroundExecutor_.load();
|
|
106
106
|
|
|
107
107
|
if (!flagValue.has_value()) {
|
|
108
108
|
// This block is not exclusive but it is not necessary.
|
|
@@ -110,10 +110,46 @@ bool ReactNativeFeatureFlagsAccessor::batchRenderingUpdatesInEventLoop() {
|
|
|
110
110
|
// be accessing the provider multiple times but the end state of this
|
|
111
111
|
// instance and the returned flag value would be the same.
|
|
112
112
|
|
|
113
|
-
markFlagAsAccessed(4, "
|
|
113
|
+
markFlagAsAccessed(4, "enableBackgroundExecutor");
|
|
114
114
|
|
|
115
|
-
flagValue = currentProvider_->
|
|
116
|
-
|
|
115
|
+
flagValue = currentProvider_->enableBackgroundExecutor();
|
|
116
|
+
enableBackgroundExecutor_ = flagValue;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return flagValue.value();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
|
|
123
|
+
auto flagValue = useModernRuntimeScheduler_.load();
|
|
124
|
+
|
|
125
|
+
if (!flagValue.has_value()) {
|
|
126
|
+
// This block is not exclusive but it is not necessary.
|
|
127
|
+
// If multiple threads try to initialize the feature flag, we would only
|
|
128
|
+
// be accessing the provider multiple times but the end state of this
|
|
129
|
+
// instance and the returned flag value would be the same.
|
|
130
|
+
|
|
131
|
+
markFlagAsAccessed(5, "useModernRuntimeScheduler");
|
|
132
|
+
|
|
133
|
+
flagValue = currentProvider_->useModernRuntimeScheduler();
|
|
134
|
+
useModernRuntimeScheduler_ = flagValue;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return flagValue.value();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
bool ReactNativeFeatureFlagsAccessor::enableMicrotasks() {
|
|
141
|
+
auto flagValue = enableMicrotasks_.load();
|
|
142
|
+
|
|
143
|
+
if (!flagValue.has_value()) {
|
|
144
|
+
// This block is not exclusive but it is not necessary.
|
|
145
|
+
// If multiple threads try to initialize the feature flag, we would only
|
|
146
|
+
// be accessing the provider multiple times but the end state of this
|
|
147
|
+
// instance and the returned flag value would be the same.
|
|
148
|
+
|
|
149
|
+
markFlagAsAccessed(6, "enableMicrotasks");
|
|
150
|
+
|
|
151
|
+
flagValue = currentProvider_->enableMicrotasks();
|
|
152
|
+
enableMicrotasks_ = flagValue;
|
|
117
153
|
}
|
|
118
154
|
|
|
119
155
|
return flagValue.value();
|
|
@@ -128,7 +164,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSpannableBuildingUnification() {
|
|
|
128
164
|
// be accessing the provider multiple times but the end state of this
|
|
129
165
|
// instance and the returned flag value would be the same.
|
|
130
166
|
|
|
131
|
-
markFlagAsAccessed(
|
|
167
|
+
markFlagAsAccessed(7, "enableSpannableBuildingUnification");
|
|
132
168
|
|
|
133
169
|
flagValue = currentProvider_->enableSpannableBuildingUnification();
|
|
134
170
|
enableSpannableBuildingUnification_ = flagValue;
|
|
@@ -146,7 +182,7 @@ bool ReactNativeFeatureFlagsAccessor::enableCustomDrawOrderFabric() {
|
|
|
146
182
|
// be accessing the provider multiple times but the end state of this
|
|
147
183
|
// instance and the returned flag value would be the same.
|
|
148
184
|
|
|
149
|
-
markFlagAsAccessed(
|
|
185
|
+
markFlagAsAccessed(8, "enableCustomDrawOrderFabric");
|
|
150
186
|
|
|
151
187
|
flagValue = currentProvider_->enableCustomDrawOrderFabric();
|
|
152
188
|
enableCustomDrawOrderFabric_ = flagValue;
|
|
@@ -164,7 +200,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFixForClippedSubviewsCrash() {
|
|
|
164
200
|
// be accessing the provider multiple times but the end state of this
|
|
165
201
|
// instance and the returned flag value would be the same.
|
|
166
202
|
|
|
167
|
-
markFlagAsAccessed(
|
|
203
|
+
markFlagAsAccessed(9, "enableFixForClippedSubviewsCrash");
|
|
168
204
|
|
|
169
205
|
flagValue = currentProvider_->enableFixForClippedSubviewsCrash();
|
|
170
206
|
enableFixForClippedSubviewsCrash_ = flagValue;
|
|
@@ -182,7 +218,7 @@ bool ReactNativeFeatureFlagsAccessor::inspectorEnableCxxInspectorPackagerConnect
|
|
|
182
218
|
// be accessing the provider multiple times but the end state of this
|
|
183
219
|
// instance and the returned flag value would be the same.
|
|
184
220
|
|
|
185
|
-
markFlagAsAccessed(
|
|
221
|
+
markFlagAsAccessed(10, "inspectorEnableCxxInspectorPackagerConnection");
|
|
186
222
|
|
|
187
223
|
flagValue = currentProvider_->inspectorEnableCxxInspectorPackagerConnection();
|
|
188
224
|
inspectorEnableCxxInspectorPackagerConnection_ = flagValue;
|
|
@@ -200,7 +236,7 @@ bool ReactNativeFeatureFlagsAccessor::inspectorEnableModernCDPRegistry() {
|
|
|
200
236
|
// be accessing the provider multiple times but the end state of this
|
|
201
237
|
// instance and the returned flag value would be the same.
|
|
202
238
|
|
|
203
|
-
markFlagAsAccessed(
|
|
239
|
+
markFlagAsAccessed(11, "inspectorEnableModernCDPRegistry");
|
|
204
240
|
|
|
205
241
|
flagValue = currentProvider_->inspectorEnableModernCDPRegistry();
|
|
206
242
|
inspectorEnableModernCDPRegistry_ = flagValue;
|
|
@@ -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<<e67096a87dc73576add98d1d3ea6909b>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -32,10 +32,12 @@ class ReactNativeFeatureFlagsAccessor {
|
|
|
32
32
|
ReactNativeFeatureFlagsAccessor();
|
|
33
33
|
|
|
34
34
|
bool commonTestFlag();
|
|
35
|
+
bool androidEnablePendingFabricTransactions();
|
|
36
|
+
bool batchRenderingUpdatesInEventLoop();
|
|
37
|
+
bool destroyFabricSurfacesInReactInstanceManager();
|
|
35
38
|
bool enableBackgroundExecutor();
|
|
36
39
|
bool useModernRuntimeScheduler();
|
|
37
40
|
bool enableMicrotasks();
|
|
38
|
-
bool batchRenderingUpdatesInEventLoop();
|
|
39
41
|
bool enableSpannableBuildingUnification();
|
|
40
42
|
bool enableCustomDrawOrderFabric();
|
|
41
43
|
bool enableFixForClippedSubviewsCrash();
|
|
@@ -51,13 +53,15 @@ class ReactNativeFeatureFlagsAccessor {
|
|
|
51
53
|
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
|
52
54
|
bool wasOverridden_;
|
|
53
55
|
|
|
54
|
-
std::array<std::atomic<const char*>,
|
|
56
|
+
std::array<std::atomic<const char*>, 12> accessedFeatureFlags_;
|
|
55
57
|
|
|
56
58
|
std::atomic<std::optional<bool>> commonTestFlag_;
|
|
59
|
+
std::atomic<std::optional<bool>> androidEnablePendingFabricTransactions_;
|
|
60
|
+
std::atomic<std::optional<bool>> batchRenderingUpdatesInEventLoop_;
|
|
61
|
+
std::atomic<std::optional<bool>> destroyFabricSurfacesInReactInstanceManager_;
|
|
57
62
|
std::atomic<std::optional<bool>> enableBackgroundExecutor_;
|
|
58
63
|
std::atomic<std::optional<bool>> useModernRuntimeScheduler_;
|
|
59
64
|
std::atomic<std::optional<bool>> enableMicrotasks_;
|
|
60
|
-
std::atomic<std::optional<bool>> batchRenderingUpdatesInEventLoop_;
|
|
61
65
|
std::atomic<std::optional<bool>> enableSpannableBuildingUnification_;
|
|
62
66
|
std::atomic<std::optional<bool>> enableCustomDrawOrderFabric_;
|
|
63
67
|
std::atomic<std::optional<bool>> enableFixForClippedSubviewsCrash_;
|
|
@@ -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<<8a0f2e61752ae83a7a3032939f4a59fa>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -31,19 +31,27 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
bool
|
|
34
|
+
bool androidEnablePendingFabricTransactions() override {
|
|
35
35
|
return false;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
bool
|
|
38
|
+
bool batchRenderingUpdatesInEventLoop() override {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
bool
|
|
42
|
+
bool destroyFabricSurfacesInReactInstanceManager() override {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
bool
|
|
46
|
+
bool enableBackgroundExecutor() override {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
bool useModernRuntimeScheduler() override {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
bool enableMicrotasks() override {
|
|
47
55
|
return false;
|
|
48
56
|
}
|
|
49
57
|
|
|
@@ -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<<9194d576893a97a6d9b88f5a32c71197>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -26,10 +26,12 @@ class ReactNativeFeatureFlagsProvider {
|
|
|
26
26
|
virtual ~ReactNativeFeatureFlagsProvider() = default;
|
|
27
27
|
|
|
28
28
|
virtual bool commonTestFlag() = 0;
|
|
29
|
+
virtual bool androidEnablePendingFabricTransactions() = 0;
|
|
30
|
+
virtual bool batchRenderingUpdatesInEventLoop() = 0;
|
|
31
|
+
virtual bool destroyFabricSurfacesInReactInstanceManager() = 0;
|
|
29
32
|
virtual bool enableBackgroundExecutor() = 0;
|
|
30
33
|
virtual bool useModernRuntimeScheduler() = 0;
|
|
31
34
|
virtual bool enableMicrotasks() = 0;
|
|
32
|
-
virtual bool batchRenderingUpdatesInEventLoop() = 0;
|
|
33
35
|
virtual bool enableSpannableBuildingUnification() = 0;
|
|
34
36
|
virtual bool enableCustomDrawOrderFabric() = 0;
|
|
35
37
|
virtual bool enableFixForClippedSubviewsCrash() = 0;
|
|
@@ -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<<6d0bae7c1b0d126e58c8b9bdeaf9247e>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -40,6 +40,21 @@ bool NativeReactNativeFeatureFlags::commonTestFlag(
|
|
|
40
40
|
return ReactNativeFeatureFlags::commonTestFlag();
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
bool NativeReactNativeFeatureFlags::androidEnablePendingFabricTransactions(
|
|
44
|
+
jsi::Runtime& /*runtime*/) {
|
|
45
|
+
return ReactNativeFeatureFlags::androidEnablePendingFabricTransactions();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
bool NativeReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop(
|
|
49
|
+
jsi::Runtime& /*runtime*/) {
|
|
50
|
+
return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
bool NativeReactNativeFeatureFlags::destroyFabricSurfacesInReactInstanceManager(
|
|
54
|
+
jsi::Runtime& /*runtime*/) {
|
|
55
|
+
return ReactNativeFeatureFlags::destroyFabricSurfacesInReactInstanceManager();
|
|
56
|
+
}
|
|
57
|
+
|
|
43
58
|
bool NativeReactNativeFeatureFlags::enableBackgroundExecutor(
|
|
44
59
|
jsi::Runtime& /*runtime*/) {
|
|
45
60
|
return ReactNativeFeatureFlags::enableBackgroundExecutor();
|
|
@@ -55,11 +70,6 @@ bool NativeReactNativeFeatureFlags::enableMicrotasks(
|
|
|
55
70
|
return ReactNativeFeatureFlags::enableMicrotasks();
|
|
56
71
|
}
|
|
57
72
|
|
|
58
|
-
bool NativeReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop(
|
|
59
|
-
jsi::Runtime& /*runtime*/) {
|
|
60
|
-
return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
73
|
bool NativeReactNativeFeatureFlags::enableSpannableBuildingUnification(
|
|
64
74
|
jsi::Runtime& /*runtime*/) {
|
|
65
75
|
return ReactNativeFeatureFlags::enableSpannableBuildingUnification();
|
|
@@ -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<<a62e65429512894e2d7c6ea696cebcba>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -32,14 +32,18 @@ class NativeReactNativeFeatureFlags
|
|
|
32
32
|
|
|
33
33
|
bool commonTestFlag(jsi::Runtime& runtime);
|
|
34
34
|
|
|
35
|
+
bool androidEnablePendingFabricTransactions(jsi::Runtime& runtime);
|
|
36
|
+
|
|
37
|
+
bool batchRenderingUpdatesInEventLoop(jsi::Runtime& runtime);
|
|
38
|
+
|
|
39
|
+
bool destroyFabricSurfacesInReactInstanceManager(jsi::Runtime& runtime);
|
|
40
|
+
|
|
35
41
|
bool enableBackgroundExecutor(jsi::Runtime& runtime);
|
|
36
42
|
|
|
37
43
|
bool useModernRuntimeScheduler(jsi::Runtime& runtime);
|
|
38
44
|
|
|
39
45
|
bool enableMicrotasks(jsi::Runtime& runtime);
|
|
40
46
|
|
|
41
|
-
bool batchRenderingUpdatesInEventLoop(jsi::Runtime& runtime);
|
|
42
|
-
|
|
43
47
|
bool enableSpannableBuildingUnification(jsi::Runtime& runtime);
|
|
44
48
|
|
|
45
49
|
bool enableCustomDrawOrderFabric(jsi::Runtime& runtime);
|
|
@@ -41,4 +41,17 @@ Number MountingTransaction::getNumber() const {
|
|
|
41
41
|
return number_;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
void MountingTransaction::mergeWith(MountingTransaction&& transaction) {
|
|
45
|
+
react_native_assert(transaction.getSurfaceId() == surfaceId_);
|
|
46
|
+
number_ = transaction.getNumber();
|
|
47
|
+
mutations_.insert(
|
|
48
|
+
mutations_.end(),
|
|
49
|
+
std::make_move_iterator(transaction.mutations_.begin()),
|
|
50
|
+
std::make_move_iterator(transaction.mutations_.end()));
|
|
51
|
+
|
|
52
|
+
// TODO T186641819: Telemetry for merged transactions is not supported, use
|
|
53
|
+
// the latest instance
|
|
54
|
+
telemetry_ = std::move(transaction.telemetry_);
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
} // namespace facebook::react
|
|
@@ -76,6 +76,15 @@ class MountingTransaction final {
|
|
|
76
76
|
*/
|
|
77
77
|
Number getNumber() const;
|
|
78
78
|
|
|
79
|
+
/*
|
|
80
|
+
* Merges the given transaction in the current transaction, so they
|
|
81
|
+
* can be executed atomatically as a single transaction.
|
|
82
|
+
*
|
|
83
|
+
* This is required for Android UI, which needs to separately apply
|
|
84
|
+
* each ShadowTree mutation due to differences in props representation.
|
|
85
|
+
*/
|
|
86
|
+
void mergeWith(MountingTransaction&& transaction);
|
|
87
|
+
|
|
79
88
|
private:
|
|
80
89
|
SurfaceId surfaceId_;
|
|
81
90
|
Number number_;
|
|
@@ -273,6 +273,10 @@ void Scheduler::uiManagerDidFinishTransaction(
|
|
|
273
273
|
SystraceSection s("Scheduler::uiManagerDidFinishTransaction");
|
|
274
274
|
|
|
275
275
|
if (delegate_ != nullptr) {
|
|
276
|
+
// This is no-op on all platforms except for Android where we need to
|
|
277
|
+
// observe each transaction to be able to mount correctly.
|
|
278
|
+
delegate_->schedulerDidFinishTransaction(mountingCoordinator);
|
|
279
|
+
|
|
276
280
|
auto weakRuntimeScheduler =
|
|
277
281
|
contextContainer_->find<std::weak_ptr<RuntimeScheduler>>(
|
|
278
282
|
"RuntimeScheduler");
|
|
@@ -283,13 +287,14 @@ void Scheduler::uiManagerDidFinishTransaction(
|
|
|
283
287
|
runtimeScheduler->scheduleRenderingUpdate(
|
|
284
288
|
[delegate = delegate_,
|
|
285
289
|
mountingCoordinator = std::move(mountingCoordinator)]() {
|
|
286
|
-
delegate->
|
|
290
|
+
delegate->schedulerShouldRenderTransactions(mountingCoordinator);
|
|
287
291
|
});
|
|
288
292
|
} else {
|
|
289
|
-
delegate_->
|
|
293
|
+
delegate_->schedulerShouldRenderTransactions(mountingCoordinator);
|
|
290
294
|
}
|
|
291
295
|
}
|
|
292
296
|
}
|
|
297
|
+
|
|
293
298
|
void Scheduler::uiManagerDidCreateShadowNode(const ShadowNode& shadowNode) {
|
|
294
299
|
SystraceSection s("Scheduler::uiManagerDidCreateShadowNode");
|
|
295
300
|
|
|
@@ -28,6 +28,17 @@ class SchedulerDelegate {
|
|
|
28
28
|
virtual void schedulerDidFinishTransaction(
|
|
29
29
|
const MountingCoordinator::Shared& mountingCoordinator) = 0;
|
|
30
30
|
|
|
31
|
+
/*
|
|
32
|
+
* Called when the runtime scheduler decides that one-or-more previously
|
|
33
|
+
* finished transactions should now be flushed to the screen (atomically).
|
|
34
|
+
*
|
|
35
|
+
* This is a separate callback from didFinishTransaction as the Android UI
|
|
36
|
+
* mounting layer needs to be able toobserve each created ShadowTree to
|
|
37
|
+
* correctly apply changes, due to changes in Props representation.
|
|
38
|
+
*/
|
|
39
|
+
virtual void schedulerShouldRenderTransactions(
|
|
40
|
+
const MountingCoordinator::Shared& mountingCoordinator) = 0;
|
|
41
|
+
|
|
31
42
|
/*
|
|
32
43
|
* Called right after a new ShadowNode was created.
|
|
33
44
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.1",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -107,16 +107,16 @@
|
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
109
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
110
|
-
"@react-native-community/cli": "13.6.
|
|
111
|
-
"@react-native-community/cli-platform-android": "13.6.
|
|
112
|
-
"@react-native-community/cli-platform-ios": "13.6.
|
|
113
|
-
"@react-native/assets-registry": "0.74.
|
|
114
|
-
"@react-native/codegen": "0.74.
|
|
115
|
-
"@react-native/community-cli-plugin": "0.74.
|
|
116
|
-
"@react-native/gradle-plugin": "0.74.
|
|
117
|
-
"@react-native/js-polyfills": "0.74.
|
|
118
|
-
"@react-native/normalize-colors": "0.74.
|
|
119
|
-
"@react-native/virtualized-lists": "0.74.
|
|
110
|
+
"@react-native-community/cli": "13.6.6",
|
|
111
|
+
"@react-native-community/cli-platform-android": "13.6.6",
|
|
112
|
+
"@react-native-community/cli-platform-ios": "13.6.6",
|
|
113
|
+
"@react-native/assets-registry": "0.74.83",
|
|
114
|
+
"@react-native/codegen": "0.74.83",
|
|
115
|
+
"@react-native/community-cli-plugin": "0.74.83",
|
|
116
|
+
"@react-native/gradle-plugin": "0.74.83",
|
|
117
|
+
"@react-native/js-polyfills": "0.74.83",
|
|
118
|
+
"@react-native/normalize-colors": "0.74.83",
|
|
119
|
+
"@react-native/virtualized-lists": "0.74.83",
|
|
120
120
|
"abort-controller": "^3.0.0",
|
|
121
121
|
"anser": "^1.4.9",
|
|
122
122
|
"ansi-regex": "^5.0.0",
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
module PrivacyManifestUtils
|
|
7
|
+
def self.add_aggregated_privacy_manifest(installer)
|
|
8
|
+
user_project = get_user_project_from(installer)
|
|
9
|
+
targets = get_application_targets(user_project)
|
|
10
|
+
file_path = get_privacyinfo_file_path(user_project, targets)
|
|
11
|
+
|
|
12
|
+
privacy_info = read_privacyinfo_file(file_path) || {
|
|
13
|
+
"NSPrivacyCollectedDataTypes" => [],
|
|
14
|
+
"NSPrivacyTracking" => false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Get all required reason APIs defined in current pods
|
|
18
|
+
required_reason_apis = get_used_required_reason_apis(installer)
|
|
19
|
+
|
|
20
|
+
# Add the Required Reason APIs from React Native core
|
|
21
|
+
get_core_accessed_apis.each do |accessed_api|
|
|
22
|
+
api_type = accessed_api["NSPrivacyAccessedAPIType"]
|
|
23
|
+
reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
|
|
24
|
+
required_reason_apis[api_type] ||= []
|
|
25
|
+
required_reason_apis[api_type] += reasons
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Merge the Required Reason APIs from pods with the ones from the existing PrivacyInfo file
|
|
29
|
+
(privacy_info["NSPrivacyAccessedAPITypes"] || []).each do |accessed_api|
|
|
30
|
+
api_type = accessed_api["NSPrivacyAccessedAPIType"]
|
|
31
|
+
reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
|
|
32
|
+
# Add reasons from existing PrivacyInfo file to the ones from pods
|
|
33
|
+
required_reason_apis[api_type] ||= []
|
|
34
|
+
required_reason_apis[api_type] += reasons
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Update the existing PrivacyInfo file with the new aggregated data
|
|
38
|
+
privacy_info["NSPrivacyAccessedAPITypes"] = required_reason_apis.map { |api_type, reasons|
|
|
39
|
+
{
|
|
40
|
+
"NSPrivacyAccessedAPIType" => api_type,
|
|
41
|
+
"NSPrivacyAccessedAPITypeReasons" => reasons.uniq
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Xcodeproj::Plist.write_to_path(privacy_info, file_path)
|
|
46
|
+
|
|
47
|
+
targets.each do |target|
|
|
48
|
+
ensure_reference(file_path, user_project, target)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.get_application_targets(user_project)
|
|
53
|
+
return user_project.targets.filter { |t| t.symbol_type == :application }
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def self.read_privacyinfo_file(file_path)
|
|
57
|
+
# Maybe add missing default NSPrivacyTracking, NSPrivacyTrackingDomains, NSPrivacyCollectedDataTypes, but this works without those keys
|
|
58
|
+
source_data = nil
|
|
59
|
+
# Try to read an existing PrivacyInfo.xcprivacy file
|
|
60
|
+
begin
|
|
61
|
+
source_data = Xcodeproj::Plist.read_from_path(file_path)
|
|
62
|
+
Pod::UI.puts "[Privacy Manifest Aggregation] Appending aggregated reasons to existing PrivacyInfo.xcprivacy file."
|
|
63
|
+
rescue => e
|
|
64
|
+
Pod::UI.puts "[Privacy Manifest Aggregation] No existing PrivacyInfo.xcprivacy file found, creating a new one."
|
|
65
|
+
end
|
|
66
|
+
return source_data
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.ensure_reference(file_path, user_project, target)
|
|
70
|
+
reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref.path.end_with? "PrivacyInfo.xcprivacy" }
|
|
71
|
+
unless reference_exists
|
|
72
|
+
# We try to find the main group, but if it doesn't exist, we default to adding the file to the project root – both work
|
|
73
|
+
file_root = user_project.root_object.main_group.children.find { |group|
|
|
74
|
+
group.class == Xcodeproj::Project::Object::PBXGroup && (group.name == target.name || group.path == target.name)
|
|
75
|
+
} || user_project
|
|
76
|
+
file_ref = file_root.new_file(file_path)
|
|
77
|
+
build_file = target.resources_build_phase.add_file_reference(file_ref, true)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.get_privacyinfo_file_path(user_project, targets)
|
|
82
|
+
file_refs = targets.flat_map { |target| target.resources_build_phase.files_references }
|
|
83
|
+
existing_file = file_refs.find { |file_ref| file_ref.path.end_with? "PrivacyInfo.xcprivacy" }
|
|
84
|
+
if existing_file
|
|
85
|
+
return existing_file.real_path
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# We try to find a file we know exists in the project to get the path to the main group directory
|
|
89
|
+
info_plist_path = user_project.files.find { |file_ref| file_ref.name == "Info.plist" }
|
|
90
|
+
if info_plist_path.nil?
|
|
91
|
+
# return path that is sibling to .xcodeproj
|
|
92
|
+
path = user_project.path
|
|
93
|
+
return File.join(File.dirname(path), "PrivacyInfo.xcprivacy")
|
|
94
|
+
end
|
|
95
|
+
return File.join(File.dirname(info_plist_path.real_path),"PrivacyInfo.xcprivacy")
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.get_used_required_reason_apis(installer)
|
|
99
|
+
# A dictionary with keys of type string (NSPrivacyAccessedAPIType) and values of type string[] (NSPrivacyAccessedAPITypeReasons[])
|
|
100
|
+
used_apis = {}
|
|
101
|
+
Pod::UI.puts "[Privacy Manifest Aggregation] Reading .xcprivacy files to aggregate all used Required Reason APIs."
|
|
102
|
+
installer.pod_targets.each do |pod_target|
|
|
103
|
+
# puts pod_target
|
|
104
|
+
pod_target.file_accessors.each do |file_accessor|
|
|
105
|
+
file_accessor.resource_bundles.each do |bundle_name, bundle_files|
|
|
106
|
+
bundle_files.each do |file_path|
|
|
107
|
+
# This needs to be named like that due to apple requirements
|
|
108
|
+
if File.basename(file_path) == 'PrivacyInfo.xcprivacy'
|
|
109
|
+
content = Xcodeproj::Plist.read_from_path(file_path)
|
|
110
|
+
accessed_api_types = content["NSPrivacyAccessedAPITypes"]
|
|
111
|
+
accessed_api_types.each do |accessed_api|
|
|
112
|
+
api_type = accessed_api["NSPrivacyAccessedAPIType"]
|
|
113
|
+
reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"]
|
|
114
|
+
used_apis[api_type] ||= []
|
|
115
|
+
used_apis[api_type] += reasons
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
return used_apis
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def self.get_privacy_manifest_paths_from(user_project)
|
|
126
|
+
privacy_manifests = user_project
|
|
127
|
+
.files
|
|
128
|
+
.select { |p|
|
|
129
|
+
p.path&.end_with?('PrivacyInfo.xcprivacy')
|
|
130
|
+
}
|
|
131
|
+
return privacy_manifests
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def self.get_core_accessed_apis()
|
|
135
|
+
file_timestamp_accessed_api = {
|
|
136
|
+
"NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryFileTimestamp",
|
|
137
|
+
"NSPrivacyAccessedAPITypeReasons" => ["C617.1"],
|
|
138
|
+
}
|
|
139
|
+
user_defaults_accessed_api = {
|
|
140
|
+
"NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategoryUserDefaults",
|
|
141
|
+
"NSPrivacyAccessedAPITypeReasons" => ["CA92.1"],
|
|
142
|
+
}
|
|
143
|
+
boot_time_accessed_api = {
|
|
144
|
+
"NSPrivacyAccessedAPIType" => "NSPrivacyAccessedAPICategorySystemBootTime",
|
|
145
|
+
"NSPrivacyAccessedAPITypeReasons" => ["35F9.1"],
|
|
146
|
+
}
|
|
147
|
+
return [file_timestamp_accessed_api, user_defaults_accessed_api, boot_time_accessed_api]
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def self.get_user_project_from(installer)
|
|
152
|
+
user_project = installer.aggregate_targets
|
|
153
|
+
.map{ |t| t.user_project }
|
|
154
|
+
.first
|
|
155
|
+
return user_project
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def self.add_privacy_manifest_if_needed(installer)
|
|
159
|
+
user_project = get_user_project_from(installer)
|
|
160
|
+
privacy_manifest = self.get_privacy_manifest_paths_from(user_project).first
|
|
161
|
+
if privacy_manifest.nil?
|
|
162
|
+
privacy_manifest = {
|
|
163
|
+
"NSPrivacyCollectedDataTypes" => [],
|
|
164
|
+
"NSPrivacyTracking" => false,
|
|
165
|
+
"NSPrivacyAccessedAPITypes" => get_core_accessed_apis
|
|
166
|
+
}
|
|
167
|
+
path = File.join(user_project.path.parent, "PrivacyInfo.xcprivacy")
|
|
168
|
+
Xcodeproj::Plist.write_to_path(privacy_manifest, path)
|
|
169
|
+
Pod::UI.puts "Your app does not have a privacy manifest! A template has been generated containing Required Reasons API usage in the core React Native library. Please add the PrivacyInfo.xcprivacy file to your project and complete data use, tracking and any additional required reasons your app is using according to Apple's guidance: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files. Then, you will need to manually add this file to your project in Xcode.".red
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|