react-native 0.84.0-nightly-20251216-c16eb23a1 → 0.84.0-nightly-20251218-c7f433a41
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/nodes/AnimatedObject.js +9 -4
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Settings/RCTSettingsManager.mm +1 -1
- package/Libraries/TypeSafety/RCTTypedModuleConstants.h +36 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +1 -1
- package/React/CoreModules/RCTAppState.mm +1 -1
- package/React/CoreModules/RCTStatusBarManager.mm +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +52 -16
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +11 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressRequestBody.kt +2 -17
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +11 -4
- package/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +22 -0
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +38 -0
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +15 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +2 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -4
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -0
- package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +24 -3
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +76 -13
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +74 -64
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +17 -13
- package/ReactCommon/react/networking/NetworkReporter.cpp +7 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +113 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedProps.h +64 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h +29 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +35 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +2 -1
- package/package.json +8 -8
- package/scripts/cocoapods/new_architecture.rb +5 -1
- package/scripts/react_native_pods.rb +8 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +2 -2
|
@@ -24,12 +24,17 @@ export function isPlainObject(
|
|
|
24
24
|
/* $FlowFixMe[incompatible-type-guard] - Flow does not know that the prototype
|
|
25
25
|
and ReactElement checks preserve the type refinement of `value`. */
|
|
26
26
|
): value is $ReadOnly<{[string]: mixed}> {
|
|
27
|
+
const proto =
|
|
28
|
+
value !== null && typeof value === 'object'
|
|
29
|
+
? Object.getPrototypeOf(value)
|
|
30
|
+
: undefined;
|
|
31
|
+
if (proto === undefined) {
|
|
32
|
+
// $FlowFixMe[incompatible-type-guard]
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
27
35
|
return (
|
|
28
36
|
// $FlowFixMe[incompatible-type-guard]
|
|
29
|
-
|
|
30
|
-
typeof value === 'object' &&
|
|
31
|
-
Object.getPrototypeOf(value).isPrototypeOf(Object) &&
|
|
32
|
-
!isValidElement(value)
|
|
37
|
+
(proto == null || proto.isPrototypeOf(Object)) && !isValidElement(value)
|
|
33
38
|
);
|
|
34
39
|
}
|
|
35
40
|
|
|
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
|
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 84;
|
|
31
31
|
static patch: number = 0;
|
|
32
|
-
static prerelease: string | null = 'nightly-
|
|
32
|
+
static prerelease: string | null = 'nightly-20251218-c7f433a41';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -52,7 +52,7 @@ RCT_EXPORT_MODULE()
|
|
|
52
52
|
|
|
53
53
|
- (facebook::react::ModuleConstants<JS::NativeSettingsManager::Constants>)constantsToExport
|
|
54
54
|
{
|
|
55
|
-
return
|
|
55
|
+
return [self getConstants];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
- (facebook::react::ModuleConstants<JS::NativeSettingsManager::Constants>)getConstants
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
#include <type_traits>
|
|
8
9
|
#include <utility>
|
|
9
10
|
|
|
10
11
|
#import <Foundation/Foundation.h>
|
|
@@ -32,10 +33,44 @@
|
|
|
32
33
|
|
|
33
34
|
namespace facebook::react {
|
|
34
35
|
|
|
36
|
+
namespace detail {
|
|
37
|
+
|
|
38
|
+
// Helper to detect if T is a Builder type.
|
|
39
|
+
// Builder types have: nested Input struct and buildUnsafeRawValue() method.
|
|
40
|
+
template <typename T, typename = void>
|
|
41
|
+
struct IsBuilder : std::false_type {};
|
|
42
|
+
|
|
43
|
+
template <typename T>
|
|
44
|
+
struct IsBuilder<T, std::void_t<typename T::Input, decltype(std::declval<T>().buildUnsafeRawValue())>>
|
|
45
|
+
: std::true_type {};
|
|
46
|
+
|
|
47
|
+
// Resolve Builder to its parent Constants type.
|
|
48
|
+
// For backwards compatibility: if T is a Builder type (e.g., JS::X::Constants::Builder),
|
|
49
|
+
// we resolve to the parent Constants type (JS::X::Constants).
|
|
50
|
+
//
|
|
51
|
+
// This requires Builder to have a type alias `using ResultT = Constants;` defined by codegen.
|
|
52
|
+
template <typename T, bool = IsBuilder<T>::value>
|
|
53
|
+
struct ResolveConstantsType {
|
|
54
|
+
// Not a Builder, use T as-is
|
|
55
|
+
using type = T;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Specialization for Builder types that have ResultT defined
|
|
59
|
+
template <typename T>
|
|
60
|
+
struct ResolveConstantsType<T, true> {
|
|
61
|
+
// Use T::ResultT which points to the parent Constants type (added by codegen)
|
|
62
|
+
using type = typename T::ResultT;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace detail
|
|
66
|
+
|
|
35
67
|
// Objective-C doesn't allow arbitrary types in its lightweight generics, only object and block types. We can work
|
|
36
68
|
// around that by having the struct type we care about be a block-argument. The block never exists at runtime.
|
|
69
|
+
//
|
|
70
|
+
// For backwards compatibility: if T is a Builder type (e.g., JS::Module::Constants::Builder),
|
|
71
|
+
// ModuleConstants<Builder> resolves to the same type as ModuleConstants<Constants>.
|
|
37
72
|
template <typename T>
|
|
38
|
-
using ModuleConstants = _RCTTypedModuleConstants<void (^)(T)> *;
|
|
73
|
+
using ModuleConstants = _RCTTypedModuleConstants<void (^)(typename detail::ResolveConstantsType<T>::type)> *;
|
|
39
74
|
|
|
40
75
|
template <typename T>
|
|
41
76
|
ModuleConstants<T> typedConstants(typename T::Builder::Input &&value)
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(84),
|
|
26
26
|
RCTVersionPatch: @(0),
|
|
27
|
-
RCTVersionPrerelease: @"nightly-
|
|
27
|
+
RCTVersionPrerelease: @"nightly-20251218-c7f433a41",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -35,7 +35,7 @@ RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible : (BOOL)visible) {}
|
|
|
35
35
|
|
|
36
36
|
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)constantsToExport
|
|
37
37
|
{
|
|
38
|
-
return
|
|
38
|
+
return [self getConstants];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
@@ -64,7 +64,7 @@ RCT_EXPORT_MODULE()
|
|
|
64
64
|
|
|
65
65
|
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants>)constantsToExport
|
|
66
66
|
{
|
|
67
|
-
return
|
|
67
|
+
return [self getConstants];
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants>)getConstants
|
|
@@ -193,7 +193,7 @@ RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible : (BOOL)visible)
|
|
|
193
193
|
|
|
194
194
|
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)constantsToExport
|
|
195
195
|
{
|
|
196
|
-
return
|
|
196
|
+
return [self getConstants];
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
@@ -443,6 +443,9 @@ namespace JS {
|
|
|
443
443
|
struct Constants {
|
|
444
444
|
|
|
445
445
|
struct Builder {
|
|
446
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
447
|
+
using ResultT = Constants;
|
|
448
|
+
|
|
446
449
|
struct Input {
|
|
447
450
|
RCTRequired<NSString *> initialAppState;
|
|
448
451
|
};
|
|
@@ -471,8 +474,8 @@ namespace JS {
|
|
|
471
474
|
error:(RCTResponseSenderBlock)error;
|
|
472
475
|
- (void)addListener:(NSString *)eventName;
|
|
473
476
|
- (void)removeListeners:(double)count;
|
|
474
|
-
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants
|
|
475
|
-
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants
|
|
477
|
+
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants>)constantsToExport;
|
|
478
|
+
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants>)getConstants;
|
|
476
479
|
|
|
477
480
|
@end
|
|
478
481
|
|
|
@@ -527,6 +530,9 @@ namespace JS {
|
|
|
527
530
|
struct Constants {
|
|
528
531
|
|
|
529
532
|
struct Builder {
|
|
533
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
534
|
+
using ResultT = Constants;
|
|
535
|
+
|
|
530
536
|
struct Input {
|
|
531
537
|
RCTRequired<NSString *> BLOB_URI_SCHEME;
|
|
532
538
|
RCTRequired<NSString *> BLOB_URI_HOST;
|
|
@@ -560,8 +566,8 @@ namespace JS {
|
|
|
560
566
|
- (void)createFromParts:(NSArray *)parts
|
|
561
567
|
withId:(NSString *)withId;
|
|
562
568
|
- (void)release:(NSString *)blobId;
|
|
563
|
-
- (facebook::react::ModuleConstants<JS::NativeBlobModule::Constants
|
|
564
|
-
- (facebook::react::ModuleConstants<JS::NativeBlobModule::Constants
|
|
569
|
+
- (facebook::react::ModuleConstants<JS::NativeBlobModule::Constants>)constantsToExport;
|
|
570
|
+
- (facebook::react::ModuleConstants<JS::NativeBlobModule::Constants>)getConstants;
|
|
565
571
|
|
|
566
572
|
@end
|
|
567
573
|
|
|
@@ -732,6 +738,9 @@ namespace JS {
|
|
|
732
738
|
struct DisplayMetrics {
|
|
733
739
|
|
|
734
740
|
struct Builder {
|
|
741
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
742
|
+
using ResultT = DisplayMetrics;
|
|
743
|
+
|
|
735
744
|
struct Input {
|
|
736
745
|
RCTRequired<double> width;
|
|
737
746
|
RCTRequired<double> height;
|
|
@@ -762,6 +771,9 @@ namespace JS {
|
|
|
762
771
|
struct DisplayMetricsAndroid {
|
|
763
772
|
|
|
764
773
|
struct Builder {
|
|
774
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
775
|
+
using ResultT = DisplayMetricsAndroid;
|
|
776
|
+
|
|
765
777
|
struct Input {
|
|
766
778
|
RCTRequired<double> width;
|
|
767
779
|
RCTRequired<double> height;
|
|
@@ -793,6 +805,9 @@ namespace JS {
|
|
|
793
805
|
struct DimensionsPayload {
|
|
794
806
|
|
|
795
807
|
struct Builder {
|
|
808
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
809
|
+
using ResultT = DimensionsPayload;
|
|
810
|
+
|
|
796
811
|
struct Input {
|
|
797
812
|
std::optional<JS::NativeDeviceInfo::DisplayMetrics::Builder> window;
|
|
798
813
|
std::optional<JS::NativeDeviceInfo::DisplayMetrics::Builder> screen;
|
|
@@ -823,6 +838,9 @@ namespace JS {
|
|
|
823
838
|
struct Constants {
|
|
824
839
|
|
|
825
840
|
struct Builder {
|
|
841
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
842
|
+
using ResultT = Constants;
|
|
843
|
+
|
|
826
844
|
struct Input {
|
|
827
845
|
RCTRequired<JS::NativeDeviceInfo::DimensionsPayload::Builder> Dimensions;
|
|
828
846
|
std::optional<bool> isEdgeToEdge;
|
|
@@ -849,8 +867,8 @@ namespace JS {
|
|
|
849
867
|
}
|
|
850
868
|
@protocol NativeDeviceInfoSpec <RCTBridgeModule, RCTTurboModule>
|
|
851
869
|
|
|
852
|
-
- (facebook::react::ModuleConstants<JS::NativeDeviceInfo::Constants
|
|
853
|
-
- (facebook::react::ModuleConstants<JS::NativeDeviceInfo::Constants
|
|
870
|
+
- (facebook::react::ModuleConstants<JS::NativeDeviceInfo::Constants>)constantsToExport;
|
|
871
|
+
- (facebook::react::ModuleConstants<JS::NativeDeviceInfo::Constants>)getConstants;
|
|
854
872
|
|
|
855
873
|
@end
|
|
856
874
|
|
|
@@ -1050,6 +1068,9 @@ namespace JS {
|
|
|
1050
1068
|
struct Constants {
|
|
1051
1069
|
|
|
1052
1070
|
struct Builder {
|
|
1071
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
1072
|
+
using ResultT = Constants;
|
|
1073
|
+
|
|
1053
1074
|
struct Input {
|
|
1054
1075
|
RCTRequired<bool> doLeftAndRightSwapInRTL;
|
|
1055
1076
|
RCTRequired<bool> isRTL;
|
|
@@ -1079,8 +1100,8 @@ namespace JS {
|
|
|
1079
1100
|
- (void)allowRTL:(BOOL)allowRTL;
|
|
1080
1101
|
- (void)forceRTL:(BOOL)forceRTL;
|
|
1081
1102
|
- (void)swapLeftAndRightInRTL:(BOOL)flipStyles;
|
|
1082
|
-
- (facebook::react::ModuleConstants<JS::NativeI18nManager::Constants
|
|
1083
|
-
- (facebook::react::ModuleConstants<JS::NativeI18nManager::Constants
|
|
1103
|
+
- (facebook::react::ModuleConstants<JS::NativeI18nManager::Constants>)constantsToExport;
|
|
1104
|
+
- (facebook::react::ModuleConstants<JS::NativeI18nManager::Constants>)getConstants;
|
|
1084
1105
|
|
|
1085
1106
|
@end
|
|
1086
1107
|
|
|
@@ -1468,6 +1489,9 @@ namespace JS {
|
|
|
1468
1489
|
struct ConstantsReactNativeVersion {
|
|
1469
1490
|
|
|
1470
1491
|
struct Builder {
|
|
1492
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
1493
|
+
using ResultT = ConstantsReactNativeVersion;
|
|
1494
|
+
|
|
1471
1495
|
struct Input {
|
|
1472
1496
|
RCTRequired<double> major;
|
|
1473
1497
|
RCTRequired<double> minor;
|
|
@@ -1498,6 +1522,9 @@ namespace JS {
|
|
|
1498
1522
|
struct Constants {
|
|
1499
1523
|
|
|
1500
1524
|
struct Builder {
|
|
1525
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
1526
|
+
using ResultT = Constants;
|
|
1527
|
+
|
|
1501
1528
|
struct Input {
|
|
1502
1529
|
RCTRequired<bool> isTesting;
|
|
1503
1530
|
std::optional<bool> isDisableAnimations;
|
|
@@ -1529,8 +1556,8 @@ namespace JS {
|
|
|
1529
1556
|
}
|
|
1530
1557
|
@protocol NativePlatformConstantsIOSSpec <RCTBridgeModule, RCTTurboModule>
|
|
1531
1558
|
|
|
1532
|
-
- (facebook::react::ModuleConstants<JS::NativePlatformConstantsIOS::Constants
|
|
1533
|
-
- (facebook::react::ModuleConstants<JS::NativePlatformConstantsIOS::Constants
|
|
1559
|
+
- (facebook::react::ModuleConstants<JS::NativePlatformConstantsIOS::Constants>)constantsToExport;
|
|
1560
|
+
- (facebook::react::ModuleConstants<JS::NativePlatformConstantsIOS::Constants>)getConstants;
|
|
1534
1561
|
|
|
1535
1562
|
@end
|
|
1536
1563
|
|
|
@@ -1766,6 +1793,9 @@ namespace JS {
|
|
|
1766
1793
|
struct Constants {
|
|
1767
1794
|
|
|
1768
1795
|
struct Builder {
|
|
1796
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
1797
|
+
using ResultT = Constants;
|
|
1798
|
+
|
|
1769
1799
|
struct Input {
|
|
1770
1800
|
RCTRequired<id<NSObject>> settings;
|
|
1771
1801
|
};
|
|
@@ -1792,8 +1822,8 @@ namespace JS {
|
|
|
1792
1822
|
|
|
1793
1823
|
- (void)setValues:(NSDictionary *)values;
|
|
1794
1824
|
- (void)deleteValues:(NSArray *)values;
|
|
1795
|
-
- (facebook::react::ModuleConstants<JS::NativeSettingsManager::Constants
|
|
1796
|
-
- (facebook::react::ModuleConstants<JS::NativeSettingsManager::Constants
|
|
1825
|
+
- (facebook::react::ModuleConstants<JS::NativeSettingsManager::Constants>)constantsToExport;
|
|
1826
|
+
- (facebook::react::ModuleConstants<JS::NativeSettingsManager::Constants>)getConstants;
|
|
1797
1827
|
|
|
1798
1828
|
@end
|
|
1799
1829
|
|
|
@@ -1888,6 +1918,9 @@ namespace JS {
|
|
|
1888
1918
|
struct Constants {
|
|
1889
1919
|
|
|
1890
1920
|
struct Builder {
|
|
1921
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
1922
|
+
using ResultT = Constants;
|
|
1923
|
+
|
|
1891
1924
|
struct Input {
|
|
1892
1925
|
RCTRequired<NSString *> scriptURL;
|
|
1893
1926
|
};
|
|
@@ -1912,8 +1945,8 @@ namespace JS {
|
|
|
1912
1945
|
}
|
|
1913
1946
|
@protocol NativeSourceCodeSpec <RCTBridgeModule, RCTTurboModule>
|
|
1914
1947
|
|
|
1915
|
-
- (facebook::react::ModuleConstants<JS::NativeSourceCode::Constants
|
|
1916
|
-
- (facebook::react::ModuleConstants<JS::NativeSourceCode::Constants
|
|
1948
|
+
- (facebook::react::ModuleConstants<JS::NativeSourceCode::Constants>)constantsToExport;
|
|
1949
|
+
- (facebook::react::ModuleConstants<JS::NativeSourceCode::Constants>)getConstants;
|
|
1917
1950
|
|
|
1918
1951
|
@end
|
|
1919
1952
|
|
|
@@ -1940,6 +1973,9 @@ namespace JS {
|
|
|
1940
1973
|
struct Constants {
|
|
1941
1974
|
|
|
1942
1975
|
struct Builder {
|
|
1976
|
+
// Backwards compat for RCTTypedModuleConstants
|
|
1977
|
+
using ResultT = Constants;
|
|
1978
|
+
|
|
1943
1979
|
struct Input {
|
|
1944
1980
|
RCTRequired<double> HEIGHT;
|
|
1945
1981
|
std::optional<double> DEFAULT_BACKGROUND_COLOR;
|
|
@@ -1973,8 +2009,8 @@ namespace JS {
|
|
|
1973
2009
|
animated:(BOOL)animated;
|
|
1974
2010
|
- (void)setHidden:(BOOL)hidden
|
|
1975
2011
|
withAnimation:(NSString *)withAnimation;
|
|
1976
|
-
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants
|
|
1977
|
-
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants
|
|
2012
|
+
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)constantsToExport;
|
|
2013
|
+
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)getConstants;
|
|
1978
2014
|
|
|
1979
2015
|
@end
|
|
1980
2016
|
|
|
@@ -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<<bb85527f5c9affa81a1ea33f2873a957>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -187,7 +187,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
187
187
|
|
|
188
188
|
override fun useRawPropsJsiValue(): Boolean = true
|
|
189
189
|
|
|
190
|
-
override fun useShadowNodeStateOnClone(): Boolean =
|
|
190
|
+
override fun useShadowNodeStateOnClone(): Boolean = true
|
|
191
191
|
|
|
192
192
|
override fun useSharedAnimatedBackend(): Boolean = false
|
|
193
193
|
|
|
@@ -15,6 +15,7 @@ import com.facebook.react.bridge.Arguments
|
|
|
15
15
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
16
16
|
import com.facebook.react.bridge.WritableMap
|
|
17
17
|
import com.facebook.react.bridge.buildReadableArray
|
|
18
|
+
import com.facebook.react.common.build.ReactBuildConfig
|
|
18
19
|
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
19
20
|
import java.net.SocketTimeoutException
|
|
20
21
|
import okhttp3.Headers
|
|
@@ -30,13 +31,21 @@ internal object NetworkEventUtil {
|
|
|
30
31
|
fun onCreateRequest(devToolsRequestId: String, request: Request) {
|
|
31
32
|
if (ReactNativeFeatureFlags.enableNetworkEventReporting()) {
|
|
32
33
|
val headersMap = okHttpHeadersToMap(request.headers())
|
|
34
|
+
var requestBody = ""
|
|
35
|
+
|
|
36
|
+
if (ReactBuildConfig.DEBUG) {
|
|
37
|
+
// Debug build: Process request body for preview (CDP only)
|
|
38
|
+
requestBody =
|
|
39
|
+
(request.body() as? ProgressRequestBody)?.getBodyPreview()
|
|
40
|
+
?: request.body()?.toString().orEmpty()
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
InspectorNetworkReporter.reportRequestStart(
|
|
34
44
|
devToolsRequestId,
|
|
35
45
|
request.url().toString(),
|
|
36
46
|
request.method(),
|
|
37
47
|
headersMap,
|
|
38
|
-
|
|
39
|
-
?: request.body()?.toString().orEmpty(),
|
|
48
|
+
requestBody,
|
|
40
49
|
request.body()?.contentLength() ?: 0,
|
|
41
50
|
)
|
|
42
51
|
InspectorNetworkReporter.reportConnectionTiming(devToolsRequestId, headersMap)
|
package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressRequestBody.kt
CHANGED
|
@@ -23,10 +23,6 @@ internal class ProgressRequestBody(
|
|
|
23
23
|
) : RequestBody() {
|
|
24
24
|
private var contentLength = 0L
|
|
25
25
|
|
|
26
|
-
companion object {
|
|
27
|
-
private const val MAX_BODY_PREVIEW_SIZE = 1024 * 1024 // 1MB
|
|
28
|
-
}
|
|
29
|
-
|
|
30
26
|
override fun contentType(): MediaType? {
|
|
31
27
|
return requestBody.contentType()
|
|
32
28
|
}
|
|
@@ -84,18 +80,7 @@ internal class ProgressRequestBody(
|
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
fun getBodyPreview(): String {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
requestBody.writeTo(buffer)
|
|
90
|
-
val size = buffer.size()
|
|
91
|
-
if (size <= MAX_BODY_PREVIEW_SIZE) {
|
|
92
|
-
buffer.readUtf8()
|
|
93
|
-
} else {
|
|
94
|
-
buffer.readUtf8(MAX_BODY_PREVIEW_SIZE.toLong()) +
|
|
95
|
-
"\n... [truncated, showing $MAX_BODY_PREVIEW_SIZE of $size bytes]"
|
|
96
|
-
}
|
|
97
|
-
} catch (e: Exception) {
|
|
98
|
-
""
|
|
99
|
-
}
|
|
83
|
+
// TODO: Safely implement request body previews
|
|
84
|
+
return "[Preview unavailable]"
|
|
100
85
|
}
|
|
101
86
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt
CHANGED
|
@@ -580,21 +580,28 @@ public object BackgroundStyleApplicator {
|
|
|
580
580
|
// Draw the content first
|
|
581
581
|
drawContent()
|
|
582
582
|
|
|
583
|
-
// Create the antialiased mask path with Porter-Duff DST_IN to clip
|
|
584
583
|
val maskPaint = Paint(Paint.ANTI_ALIAS_FLAG)
|
|
585
584
|
maskPaint.style = Paint.Style.FILL
|
|
586
|
-
maskPaint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_IN)
|
|
587
585
|
|
|
588
586
|
// Transparent pixels with INVERSE_WINDING only works on API 28
|
|
589
587
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
588
|
+
maskPaint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_IN)
|
|
590
589
|
maskPaint.color = Color.TRANSPARENT
|
|
591
590
|
paddingBoxPath.setFillType(Path.FillType.INVERSE_WINDING)
|
|
591
|
+
canvas.drawPath(paddingBoxPath, maskPaint)
|
|
592
592
|
} else {
|
|
593
|
+
// Create an inverse path: outer rect minus the rounded rect (using even-odd fill rule)
|
|
594
|
+
val inversePath = Path()
|
|
595
|
+
inversePath.addRect(0f, 0f, view.width.toFloat(), view.height.toFloat(), Path.Direction.CW)
|
|
596
|
+
inversePath.addPath(paddingBoxPath)
|
|
597
|
+
inversePath.setFillType(Path.FillType.EVEN_ODD)
|
|
598
|
+
|
|
599
|
+
// Use DST_OUT to remove content where the mask is drawn (outside the rounded rect)
|
|
600
|
+
maskPaint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT)
|
|
593
601
|
maskPaint.color = Color.BLACK
|
|
602
|
+
canvas.drawPath(inversePath, maskPaint)
|
|
594
603
|
}
|
|
595
604
|
|
|
596
|
-
canvas.drawPath(paddingBoxPath, maskPaint)
|
|
597
|
-
|
|
598
605
|
// Restore the layer
|
|
599
606
|
canvas.restoreToCount(saveCount)
|
|
600
607
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<string name="spinbutton_description" gender="unknown">स्पिन बटन</string>
|
|
16
16
|
<string name="rn_tab_description" gender="unknown">टयाब</string>
|
|
17
17
|
<string name="timer_description" gender="unknown">टाइमर</string>
|
|
18
|
+
<string name="toolbar_description" gender="unknown">टुल बार</string>
|
|
18
19
|
<string name="state_busy_description" gender="unknown">व्यस्त</string>
|
|
19
20
|
<string name="state_expanded_description" gender="unknown">विस्तार गरियो</string>
|
|
20
21
|
<string name="state_unselected_description" gender="unknown">चयन हटाइयो</string>
|
|
@@ -22,7 +22,7 @@ constexpr struct {
|
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 84;
|
|
24
24
|
int32_t Patch = 0;
|
|
25
|
-
std::string_view Prerelease = "nightly-
|
|
25
|
+
std::string_view Prerelease = "nightly-20251218-c7f433a41";
|
|
26
26
|
} ReactNativeVersion;
|
|
27
27
|
|
|
28
28
|
} // namespace facebook::react
|
|
@@ -653,6 +653,13 @@ TEST_P(
|
|
|
653
653
|
AtJsonPtr("/params/response/encodedDataLength", 1024),
|
|
654
654
|
AtJsonPtr("/params/hasExtraInfo", false))));
|
|
655
655
|
|
|
656
|
+
this->expectMessageFromPage(JsonParsed(AllOf(
|
|
657
|
+
AtJsonPtr("/method", "Network.dataReceived"),
|
|
658
|
+
AtJsonPtr("/params/requestId", "trace-events-request"),
|
|
659
|
+
AtJsonPtr("/params/timestamp", Gt(0)),
|
|
660
|
+
AtJsonPtr("/params/dataLength", 512),
|
|
661
|
+
AtJsonPtr("/params/encodedDataLength", 512))));
|
|
662
|
+
|
|
656
663
|
this->expectMessageFromPage(JsonParsed(AllOf(
|
|
657
664
|
AtJsonPtr("/method", "Network.loadingFinished"),
|
|
658
665
|
AtJsonPtr("/params/requestId", "trace-events-request"),
|
|
@@ -682,6 +689,9 @@ TEST_P(
|
|
|
682
689
|
},
|
|
683
690
|
1024);
|
|
684
691
|
|
|
692
|
+
NetworkReporter::getInstance().reportDataReceived(
|
|
693
|
+
"trace-events-request", 512, 512);
|
|
694
|
+
|
|
685
695
|
NetworkReporter::getInstance().reportResponseEnd(
|
|
686
696
|
"trace-events-request", 1024);
|
|
687
697
|
|
|
@@ -731,6 +741,18 @@ TEST_P(
|
|
|
731
741
|
AtJsonPtr("/receiveHeadersStart", Ge(0)),
|
|
732
742
|
AtJsonPtr("/receiveHeadersEnd", Ge(0)))))));
|
|
733
743
|
|
|
744
|
+
EXPECT_THAT(
|
|
745
|
+
allTraceEvents,
|
|
746
|
+
Contains(AllOf(
|
|
747
|
+
AtJsonPtr("/name", "ResourceReceivedData"),
|
|
748
|
+
AtJsonPtr("/cat", "devtools.timeline"),
|
|
749
|
+
AtJsonPtr("/ph", "I"),
|
|
750
|
+
AtJsonPtr("/s", "t"),
|
|
751
|
+
AtJsonPtr("/tid", oscompat::getCurrentThreadId()),
|
|
752
|
+
AtJsonPtr("/pid", oscompat::getCurrentProcessId()),
|
|
753
|
+
AtJsonPtr("/args/data/requestId", "trace-events-request"),
|
|
754
|
+
AtJsonPtr("/args/data/encodedDataLength", 512))));
|
|
755
|
+
|
|
734
756
|
EXPECT_THAT(
|
|
735
757
|
allTraceEvents,
|
|
736
758
|
Contains(AllOf(
|
|
@@ -312,6 +312,27 @@ void PerformanceTracer::reportResourceSendRequest(
|
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
void PerformanceTracer::reportResourceReceivedData(
|
|
316
|
+
const std::string& devtoolsRequestId,
|
|
317
|
+
HighResTimeStamp start,
|
|
318
|
+
int encodedDataLength) {
|
|
319
|
+
if (!tracingAtomic_) {
|
|
320
|
+
return;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
std::lock_guard<std::mutex> lock(mutex_);
|
|
324
|
+
if (!tracingAtomic_) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
enqueueEvent(
|
|
329
|
+
PerformanceTracerResourceReceivedData{
|
|
330
|
+
.requestId = devtoolsRequestId,
|
|
331
|
+
.start = start,
|
|
332
|
+
.encodedDataLength = encodedDataLength,
|
|
333
|
+
.threadId = getCurrentThreadId()});
|
|
334
|
+
}
|
|
335
|
+
|
|
315
336
|
void PerformanceTracer::reportResourceReceiveResponse(
|
|
316
337
|
const std::string& devtoolsRequestId,
|
|
317
338
|
HighResTimeStamp start,
|
|
@@ -706,6 +727,23 @@ void PerformanceTracer::enqueueTraceEventsFromPerformanceTracerEvent(
|
|
|
706
727
|
.args = folly::dynamic::object("data", std::move(data)),
|
|
707
728
|
});
|
|
708
729
|
},
|
|
730
|
+
[&](PerformanceTracerResourceReceivedData&& event) {
|
|
731
|
+
folly::dynamic data = folly::dynamic::object(
|
|
732
|
+
"encodedDataLength", event.encodedDataLength)(
|
|
733
|
+
"requestId", std::move(event.requestId));
|
|
734
|
+
|
|
735
|
+
events.emplace_back(
|
|
736
|
+
TraceEvent{
|
|
737
|
+
.name = "ResourceReceivedData",
|
|
738
|
+
.cat = {Category::Timeline},
|
|
739
|
+
.ph = 'I',
|
|
740
|
+
.ts = event.start,
|
|
741
|
+
.pid = processId_,
|
|
742
|
+
.s = 't',
|
|
743
|
+
.tid = event.threadId,
|
|
744
|
+
.args = folly::dynamic::object("data", std::move(data)),
|
|
745
|
+
});
|
|
746
|
+
},
|
|
709
747
|
[&](PerformanceTracerResourceReceiveResponse&& event) {
|
|
710
748
|
folly::dynamic headersEntries = folly::dynamic::array;
|
|
711
749
|
for (const auto& [key, value] : event.headers) {
|
|
@@ -136,6 +136,12 @@ class PerformanceTracer {
|
|
|
136
136
|
const std::string &requestMethod,
|
|
137
137
|
const Headers &headers);
|
|
138
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Record a "ResourceReceivedData" event.
|
|
141
|
+
* If not currently tracing, this is a no-op.
|
|
142
|
+
*/
|
|
143
|
+
void reportResourceReceivedData(const std::string &devtoolsRequestId, HighResTimeStamp start, int encodedDataLength);
|
|
144
|
+
|
|
139
145
|
/**
|
|
140
146
|
* Record a "ResourceReceiveResponse" event. Paired with other "Resource*"
|
|
141
147
|
* events, renders a network request timeline in the Performance panel Network
|
|
@@ -281,6 +287,14 @@ class PerformanceTracer {
|
|
|
281
287
|
HighResTimeStamp createdAt = HighResTimeStamp::now();
|
|
282
288
|
};
|
|
283
289
|
|
|
290
|
+
struct PerformanceTracerResourceReceivedData {
|
|
291
|
+
std::string requestId;
|
|
292
|
+
HighResTimeStamp start;
|
|
293
|
+
int encodedDataLength;
|
|
294
|
+
ThreadId threadId;
|
|
295
|
+
HighResTimeStamp createdAt = HighResTimeStamp::now();
|
|
296
|
+
};
|
|
297
|
+
|
|
284
298
|
struct PerformanceTracerResourceReceiveResponse {
|
|
285
299
|
std::string requestId;
|
|
286
300
|
HighResTimeStamp start;
|
|
@@ -302,6 +316,7 @@ class PerformanceTracer {
|
|
|
302
316
|
PerformanceTracerEventMeasure,
|
|
303
317
|
PerformanceTracerResourceSendRequest,
|
|
304
318
|
PerformanceTracerResourceReceiveResponse,
|
|
319
|
+
PerformanceTracerResourceReceivedData,
|
|
305
320
|
PerformanceTracerResourceFinish>;
|
|
306
321
|
|
|
307
322
|
#pragma mark - Private fields and methods
|
|
@@ -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<<33cacaaeb6994f78f5a2d9379618e2a0>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -356,7 +356,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
bool useShadowNodeStateOnClone() override {
|
|
359
|
-
return
|
|
359
|
+
return true;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
bool useSharedAnimatedBackend() override {
|