react-native 0.83.0-nightly-20251008-31bff4e09 → 0.83.0-nightly-20251009-24d0d4414
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Network/RCTInspectorNetworkReporter.h +8 -8
- package/Libraries/Network/RCTInspectorNetworkReporter.mm +18 -20
- package/Libraries/Network/RCTNetworkTask.h +5 -1
- package/Libraries/Network/RCTNetworkTask.mm +13 -0
- package/Libraries/Network/RCTNetworking+Internal.h +21 -0
- package/Libraries/Network/RCTNetworking.h +3 -0
- package/Libraries/Network/RCTNetworking.ios.js +3 -0
- package/Libraries/Network/RCTNetworking.mm +81 -34
- package/React/Base/RCTVersion.m +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +6 -0
- package/ReactAndroid/api/ReactAndroid.api +1 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/InterpolationAnimatedNode.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +68 -1
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +142 -0
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +62 -0
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.cpp +54 -0
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h +3 -0
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +37 -0
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +41 -0
- package/ReactCommon/jsinspector-modern/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/EnumArray.h +45 -0
- package/ReactCommon/jsinspector-modern/FallbackRuntimeTargetDelegate.cpp +6 -0
- package/ReactCommon/jsinspector-modern/FallbackRuntimeTargetDelegate.h +3 -0
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +46 -17
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +64 -18
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +67 -9
- package/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +10 -28
- package/ReactCommon/jsinspector-modern/RuntimeTargetNetwork.cpp +98 -0
- package/ReactCommon/jsinspector-modern/ScopedExecutor.h +29 -0
- package/ReactCommon/jsinspector-modern/network/NetworkHandler.cpp +33 -3
- package/ReactCommon/jsinspector-modern/network/NetworkHandler.h +12 -1
- package/ReactCommon/jsinspector-modern/tests/DebuggerSessionObserverTest.cpp +44 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +5 -0
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +82 -0
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.h +54 -0
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +126 -0
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +8 -3
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +3 -2
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.h +1 -1
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +4 -3
- package/ReactCommon/react/renderer/graphics/Transform.h +2 -3
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/PlatformColorParser.h +59 -23
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/configurePlatformColorCacheInvalidationHook.cpp +27 -0
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/configurePlatformColorCacheInvalidationHook.h +12 -0
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +3 -2
- package/ReactCommon/react/renderer/uimanager/UIManager.h +8 -4
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +24 -0
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +89 -0
- package/ReactCommon/react/utils/CMakeLists.txt +1 -1
- package/ReactCommon/react/utils/Uuid.cpp +69 -0
- package/ReactCommon/react/utils/Uuid.h +20 -0
- package/ReactCommon/react/utils/tests/UuidTest.cpp +28 -0
- package/package.json +8 -8
- package/sdks/hermes-engine/hermes-engine.podspec +14 -0
- package/sdks/hermes-engine/utils/build-apple-framework.sh +12 -0
- 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/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
|
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
|
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 83;
|
|
31
31
|
static patch: number = 0;
|
|
32
|
-
static prerelease: string | null = 'nightly-
|
|
32
|
+
static prerelease: string | null = 'nightly-20251009-24d0d4414';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* - Corresponds to `PerformanceResourceTiming.requestStart` (specifically,
|
|
28
28
|
* marking when the native request was initiated).
|
|
29
29
|
*/
|
|
30
|
-
+ (void)reportRequestStart:(
|
|
30
|
+
+ (void)reportRequestStart:(NSString *)requestId
|
|
31
31
|
request:(NSURLRequest *)request
|
|
32
32
|
encodedDataLength:(int)encodedDataLength;
|
|
33
33
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* `PerformanceResourceTiming.connectStart`. Defined as "immediately before
|
|
41
41
|
* the browser starts to establish the connection to the server".
|
|
42
42
|
*/
|
|
43
|
-
+ (void)reportConnectionTiming:(
|
|
43
|
+
+ (void)reportConnectionTiming:(NSString *)requestId request:(NSURLRequest *)request;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Report when HTTP response headers have been received, corresponding to
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* - Corresponds to `Network.responseReceived` in CDP.
|
|
50
50
|
* - Corresponds to `PerformanceResourceTiming.responseStart`.
|
|
51
51
|
*/
|
|
52
|
-
+ (void)reportResponseStart:(
|
|
52
|
+
+ (void)reportResponseStart:(NSString *)requestId
|
|
53
53
|
response:(NSURLResponse *)response
|
|
54
54
|
statusCode:(int)statusCode
|
|
55
55
|
headers:(NSDictionary<NSString *, NSString *> *)headers;
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
*
|
|
60
60
|
* Corresponds to `Network.dataReceived` in CDP.
|
|
61
61
|
*/
|
|
62
|
-
+ (void)reportDataReceived:(
|
|
62
|
+
+ (void)reportDataReceived:(NSString *)requestId data:(NSData *)data;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Report when a network request is complete and we are no longer receiving
|
|
@@ -68,20 +68,20 @@
|
|
|
68
68
|
* - Corresponds to `Network.loadingFinished` in CDP.
|
|
69
69
|
* - Corresponds to `PerformanceResourceTiming.responseEnd`.
|
|
70
70
|
*/
|
|
71
|
-
+ (void)reportResponseEnd:(
|
|
71
|
+
+ (void)reportResponseEnd:(NSString *)requestId encodedDataLength:(int)encodedDataLength;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Report when a network request has failed.
|
|
75
75
|
*
|
|
76
76
|
* - Corresponds to `Network.loadingFailed` in CDP.
|
|
77
77
|
*/
|
|
78
|
-
+ (void)reportRequestFailed:(
|
|
78
|
+
+ (void)reportRequestFailed:(NSString *)requestId cancelled:(BOOL)cancelled;
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* Store response body preview. This is an optional reporting method, and is a
|
|
82
82
|
* no-op if CDP debugging is disabled.
|
|
83
83
|
*/
|
|
84
|
-
+ (void)maybeStoreResponseBody:(
|
|
84
|
+
+ (void)maybeStoreResponseBody:(NSString *)requestId data:(NSData *)data base64Encoded:(bool)base64Encoded;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Incrementally store a response body preview, when a string response is
|
|
@@ -91,6 +91,6 @@
|
|
|
91
91
|
* As with `maybeStoreResponseBody`, calling this method is optional and a
|
|
92
92
|
* no-op if CDP debugging is disabled.
|
|
93
93
|
*/
|
|
94
|
-
+ (void)maybeStoreResponseBodyIncremental:(
|
|
94
|
+
+ (void)maybeStoreResponseBodyIncremental:(NSString *)requestId data:(NSString *)data;
|
|
95
95
|
|
|
96
96
|
@end
|
|
@@ -48,14 +48,14 @@ std::string convertRequestBodyToStringTruncated(NSURLRequest *request)
|
|
|
48
48
|
#ifdef REACT_NATIVE_DEBUGGER_ENABLED
|
|
49
49
|
|
|
50
50
|
// Dictionary to buffer incremental response bodies (CDP debugging active only)
|
|
51
|
-
static const NSMutableDictionary<
|
|
51
|
+
static const NSMutableDictionary<NSString *, NSMutableString *> *responseBuffers = nil;
|
|
52
52
|
|
|
53
53
|
#endif
|
|
54
54
|
|
|
55
55
|
@implementation RCTInspectorNetworkReporter {
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
+ (void)reportRequestStart:(
|
|
58
|
+
+ (void)reportRequestStart:(NSString *)requestId
|
|
59
59
|
request:(NSURLRequest *)request
|
|
60
60
|
encodedDataLength:(int)encodedDataLength
|
|
61
61
|
{
|
|
@@ -68,11 +68,10 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
68
68
|
requestInfo.httpBody = convertRequestBodyToStringTruncated(request);
|
|
69
69
|
#endif
|
|
70
70
|
|
|
71
|
-
NetworkReporter::getInstance().reportRequestStart(
|
|
72
|
-
requestId.stringValue.UTF8String, requestInfo, encodedDataLength, std::nullopt);
|
|
71
|
+
NetworkReporter::getInstance().reportRequestStart(requestId.UTF8String, requestInfo, encodedDataLength, std::nullopt);
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
+ (void)reportConnectionTiming:(
|
|
74
|
+
+ (void)reportConnectionTiming:(NSString *)requestId request:(NSURLRequest *)request
|
|
76
75
|
{
|
|
77
76
|
Headers headersMap;
|
|
78
77
|
|
|
@@ -81,10 +80,10 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
81
80
|
headersMap = convertNSDictionaryToHeaders(request.allHTTPHeaderFields);
|
|
82
81
|
#endif
|
|
83
82
|
|
|
84
|
-
NetworkReporter::getInstance().reportConnectionTiming(requestId.
|
|
83
|
+
NetworkReporter::getInstance().reportConnectionTiming(requestId.UTF8String, headersMap);
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
+ (void)reportResponseStart:(
|
|
86
|
+
+ (void)reportResponseStart:(NSString *)requestId
|
|
88
87
|
response:(NSURLResponse *)response
|
|
89
88
|
statusCode:(int)statusCode
|
|
90
89
|
headers:(NSDictionary<NSString *, NSString *> *)headers
|
|
@@ -99,17 +98,17 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
99
98
|
#endif
|
|
100
99
|
|
|
101
100
|
NetworkReporter::getInstance().reportResponseStart(
|
|
102
|
-
requestId.
|
|
101
|
+
requestId.UTF8String, responseInfo, response.expectedContentLength);
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
+ (void)reportDataReceived:(
|
|
104
|
+
+ (void)reportDataReceived:(NSString *)requestId data:(NSData *)data
|
|
106
105
|
{
|
|
107
|
-
NetworkReporter::getInstance().reportDataReceived(requestId.
|
|
106
|
+
NetworkReporter::getInstance().reportDataReceived(requestId.UTF8String, (int)data.length, std::nullopt);
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
+ (void)reportResponseEnd:(
|
|
109
|
+
+ (void)reportResponseEnd:(NSString *)requestId encodedDataLength:(int)encodedDataLength
|
|
111
110
|
{
|
|
112
|
-
NetworkReporter::getInstance().reportResponseEnd(requestId.
|
|
111
|
+
NetworkReporter::getInstance().reportResponseEnd(requestId.UTF8String, encodedDataLength);
|
|
113
112
|
|
|
114
113
|
#ifdef REACT_NATIVE_DEBUGGER_ENABLED
|
|
115
114
|
// Debug build: Check for buffered response body and flush to NetworkReporter
|
|
@@ -118,7 +117,7 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
118
117
|
if (buffer != nullptr) {
|
|
119
118
|
if (buffer.length > 0) {
|
|
120
119
|
NetworkReporter::getInstance().storeResponseBody(
|
|
121
|
-
requestId.
|
|
120
|
+
requestId.UTF8String, RCTStringViewFromNSString(buffer), false);
|
|
122
121
|
}
|
|
123
122
|
[responseBuffers removeObjectForKey:requestId];
|
|
124
123
|
}
|
|
@@ -126,9 +125,9 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
126
125
|
#endif
|
|
127
126
|
}
|
|
128
127
|
|
|
129
|
-
+ (void)reportRequestFailed:(
|
|
128
|
+
+ (void)reportRequestFailed:(NSString *)requestId cancelled:(bool)cancelled
|
|
130
129
|
{
|
|
131
|
-
NetworkReporter::getInstance().reportRequestFailed(requestId.
|
|
130
|
+
NetworkReporter::getInstance().reportRequestFailed(requestId.UTF8String, cancelled);
|
|
132
131
|
|
|
133
132
|
#ifdef REACT_NATIVE_DEBUGGER_ENABLED
|
|
134
133
|
// Debug build: Clear buffer for request
|
|
@@ -138,7 +137,7 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
138
137
|
#endif
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
+ (void)maybeStoreResponseBody:(
|
|
140
|
+
+ (void)maybeStoreResponseBody:(NSString *)requestId data:(id)data base64Encoded:(bool)base64Encoded
|
|
142
141
|
{
|
|
143
142
|
#ifdef REACT_NATIVE_DEBUGGER_ENABLED
|
|
144
143
|
// Debug build: Process response body and report to NetworkReporter
|
|
@@ -152,7 +151,7 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
152
151
|
NSString *encodedString = [(NSData *)data base64EncodedStringWithOptions:0];
|
|
153
152
|
if (encodedString != nullptr) {
|
|
154
153
|
networkReporter.storeResponseBody(
|
|
155
|
-
requestId.
|
|
154
|
+
requestId.UTF8String, RCTStringViewFromNSString(encodedString), base64Encoded);
|
|
156
155
|
} else {
|
|
157
156
|
RCTLogWarn(@"Failed to encode response data for request %@", requestId);
|
|
158
157
|
}
|
|
@@ -160,13 +159,12 @@ static const NSMutableDictionary<NSNumber *, NSMutableString *> *responseBuffers
|
|
|
160
159
|
RCTLogWarn(@"Exception while encoding response data: %@", exception.reason);
|
|
161
160
|
}
|
|
162
161
|
} else if ([data isKindOfClass:[NSString class]] && [(NSString *)data length] > 0) {
|
|
163
|
-
networkReporter.storeResponseBody(
|
|
164
|
-
requestId.stringValue.UTF8String, RCTStringViewFromNSString((NSString *)data), base64Encoded);
|
|
162
|
+
networkReporter.storeResponseBody(requestId.UTF8String, RCTStringViewFromNSString((NSString *)data), base64Encoded);
|
|
165
163
|
}
|
|
166
164
|
#endif
|
|
167
165
|
}
|
|
168
166
|
|
|
169
|
-
+ (void)maybeStoreResponseBodyIncremental:(
|
|
167
|
+
+ (void)maybeStoreResponseBodyIncremental:(NSString *)requestId data:(NSString *)data
|
|
170
168
|
{
|
|
171
169
|
#ifdef REACT_NATIVE_DEBUGGER_ENABLED
|
|
172
170
|
// Debug build: Buffer incremental response body contents
|
|
@@ -28,6 +28,7 @@ typedef NS_ENUM(NSInteger, RCTNetworkTaskStatus) {
|
|
|
28
28
|
@property (nonatomic, readonly) NSNumber *requestID;
|
|
29
29
|
@property (nonatomic, readonly, weak) id requestToken;
|
|
30
30
|
@property (nonatomic, readonly) NSURLResponse *response;
|
|
31
|
+
@property (nonatomic, readonly) NSString *devToolsRequestId;
|
|
31
32
|
|
|
32
33
|
@property (nonatomic, copy) RCTURLRequestCompletionBlock completionBlock;
|
|
33
34
|
@property (nonatomic, copy) RCTURLRequestProgressBlock downloadProgressBlock;
|
|
@@ -40,7 +41,10 @@ typedef NS_ENUM(NSInteger, RCTNetworkTaskStatus) {
|
|
|
40
41
|
- (instancetype)initWithRequest:(NSURLRequest *)request
|
|
41
42
|
handler:(id<RCTURLRequestHandler>)handler
|
|
42
43
|
callbackQueue:(dispatch_queue_t)callbackQueue NS_DESIGNATED_INITIALIZER;
|
|
43
|
-
|
|
44
|
+
- (instancetype)initWithDevToolsRequestId:(NSString *)devToolsRequestId
|
|
45
|
+
request:(NSURLRequest *)request
|
|
46
|
+
handler:(id<RCTURLRequestHandler>)handler
|
|
47
|
+
callbackQueue:(dispatch_queue_t)callbackQueue;
|
|
44
48
|
- (void)start;
|
|
45
49
|
- (void)cancel;
|
|
46
50
|
|
|
@@ -26,6 +26,15 @@ static auto currentRequestId = std::atomic<NSUInteger>(0);
|
|
|
26
26
|
- (instancetype)initWithRequest:(NSURLRequest *)request
|
|
27
27
|
handler:(id<RCTURLRequestHandler>)handler
|
|
28
28
|
callbackQueue:(dispatch_queue_t)callbackQueue
|
|
29
|
+
{
|
|
30
|
+
self = [self initWithDevToolsRequestId:nil request:request handler:handler callbackQueue:callbackQueue];
|
|
31
|
+
return self;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
- (instancetype)initWithDevToolsRequestId:(NSString *)devToolsRequestId
|
|
35
|
+
request:(NSURLRequest *)request
|
|
36
|
+
handler:(id<RCTURLRequestHandler>)handler
|
|
37
|
+
callbackQueue:(dispatch_queue_t)callbackQueue
|
|
29
38
|
{
|
|
30
39
|
RCTAssertParam(request);
|
|
31
40
|
RCTAssertParam(handler);
|
|
@@ -33,6 +42,10 @@ static auto currentRequestId = std::atomic<NSUInteger>(0);
|
|
|
33
42
|
|
|
34
43
|
if ((self = [super init])) {
|
|
35
44
|
_requestID = @(currentRequestId++);
|
|
45
|
+
_devToolsRequestId = devToolsRequestId;
|
|
46
|
+
if (_devToolsRequestId == nil) {
|
|
47
|
+
_devToolsRequestId = [[NSUUID UUID] UUIDString];
|
|
48
|
+
}
|
|
36
49
|
_request = request;
|
|
37
50
|
_handler = handler;
|
|
38
51
|
_callbackQueue = callbackQueue;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTNetworking.h"
|
|
9
|
+
|
|
10
|
+
@protocol RCTNetworkingTextResponseHandler <NSObject>
|
|
11
|
+
|
|
12
|
+
- (BOOL)canHandleNetworkingTextResponseForRequest:(NSURLRequest *)request;
|
|
13
|
+
- (void)handleNetworkingResponseText:(NSString *)responseText request:(NSURLRequest *)request;
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
@interface RCTNetworking (Internal)
|
|
18
|
+
|
|
19
|
+
- (void)addTextResponseHandler:(id<RCTNetworkingTextResponseHandler>)handler;
|
|
20
|
+
|
|
21
|
+
@end
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
*/
|
|
48
48
|
- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request
|
|
49
49
|
completionBlock:(RCTURLRequestCompletionBlock)completionBlock;
|
|
50
|
+
- (RCTNetworkTask *)networkTaskWithDevToolsRequestId:(NSString *)devToolsRequestId
|
|
51
|
+
request:(NSURLRequest *)request
|
|
52
|
+
completionBlock:(RCTURLRequestCompletionBlock)completionBlock;
|
|
50
53
|
|
|
51
54
|
- (void)addRequestHandler:(id<RCTNetworkingRequestHandler>)handler;
|
|
52
55
|
|
|
@@ -40,6 +40,8 @@ const RCTNetworking = {
|
|
|
40
40
|
withCredentials: boolean,
|
|
41
41
|
) {
|
|
42
42
|
const body = convertRequestBody(data);
|
|
43
|
+
const devToolsRequestId =
|
|
44
|
+
global.__NETWORK_REPORTER__?.createDevToolsRequestId();
|
|
43
45
|
NativeNetworkingIOS.sendRequest(
|
|
44
46
|
{
|
|
45
47
|
method,
|
|
@@ -50,6 +52,7 @@ const RCTNetworking = {
|
|
|
50
52
|
incrementalUpdates,
|
|
51
53
|
timeout,
|
|
52
54
|
withCredentials,
|
|
55
|
+
unstable_devToolsRequestId: devToolsRequestId,
|
|
53
56
|
},
|
|
54
57
|
callback,
|
|
55
58
|
);
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
#import <React/RCTConvert.h>
|
|
13
13
|
#import <React/RCTLog.h>
|
|
14
14
|
#import <React/RCTNetworkTask.h>
|
|
15
|
-
#import <React/RCTNetworking.h>
|
|
16
15
|
#import <React/RCTUtils.h>
|
|
17
16
|
|
|
18
17
|
#import <React/RCTHTTPRequestHandler.h>
|
|
@@ -20,6 +19,8 @@
|
|
|
20
19
|
|
|
21
20
|
#import "RCTInspectorNetworkReporter.h"
|
|
22
21
|
#import "RCTNetworkPlugins.h"
|
|
22
|
+
#import "RCTNetworking+Internal.h"
|
|
23
|
+
#import "RCTNetworking.h"
|
|
23
24
|
|
|
24
25
|
typedef RCTURLRequestCancellationBlock (^RCTHTTPQueryResult)(NSError *error, NSDictionary<NSString *, id> *result);
|
|
25
26
|
|
|
@@ -28,6 +29,7 @@ NSString *const RCTNetworkingPHUploadHackScheme = @"ph-upload";
|
|
|
28
29
|
@interface RCTNetworking () <NativeNetworkingIOSSpec>
|
|
29
30
|
|
|
30
31
|
- (RCTURLRequestCancellationBlock)processDataForHTTPQuery:(NSDictionary<NSString *, id> *)data
|
|
32
|
+
devToolsRequestId:(NSString *)devToolsRequestId
|
|
31
33
|
callback:(RCTHTTPQueryResult)callback;
|
|
32
34
|
@end
|
|
33
35
|
|
|
@@ -69,7 +71,9 @@ static NSString *RCTGenerateFormBoundary()
|
|
|
69
71
|
freeWhenDone:YES];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
- (RCTURLRequestCancellationBlock)process:(NSArray<NSDictionary *> *)formData
|
|
74
|
+
- (RCTURLRequestCancellationBlock)process:(NSArray<NSDictionary *> *)formData
|
|
75
|
+
devToolsRequestId:(NSString *)devToolsRequestId
|
|
76
|
+
callback:(RCTHTTPQueryResult)callback
|
|
73
77
|
{
|
|
74
78
|
RCTAssertThread(_networker.methodQueue, @"process: must be called on request queue");
|
|
75
79
|
|
|
@@ -93,12 +97,15 @@ static NSString *RCTGenerateFormBoundary()
|
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
return [_networker processDataForHTTPQuery:_parts[0]
|
|
100
|
+
devToolsRequestId:devToolsRequestId
|
|
96
101
|
callback:^(NSError *error, NSDictionary<NSString *, id> *result) {
|
|
97
|
-
return [self handleResult:result error:error];
|
|
102
|
+
return [self handleResult:result error:error devToolsRequestId:devToolsRequestId];
|
|
98
103
|
}];
|
|
99
104
|
}
|
|
100
105
|
|
|
101
|
-
- (RCTURLRequestCancellationBlock)handleResult:(NSDictionary<NSString *, id> *)result
|
|
106
|
+
- (RCTURLRequestCancellationBlock)handleResult:(NSDictionary<NSString *, id> *)result
|
|
107
|
+
error:(NSError *)error
|
|
108
|
+
devToolsRequestId:(NSString *)devToolsRequestId
|
|
102
109
|
{
|
|
103
110
|
RCTAssertThread(_networker.methodQueue, @"handleResult: must be called on request queue");
|
|
104
111
|
|
|
@@ -129,8 +136,9 @@ static NSString *RCTGenerateFormBoundary()
|
|
|
129
136
|
[_parts removeObjectAtIndex:0];
|
|
130
137
|
if (_parts.count) {
|
|
131
138
|
return [_networker processDataForHTTPQuery:_parts[0]
|
|
139
|
+
devToolsRequestId:devToolsRequestId
|
|
132
140
|
callback:^(NSError *err, NSDictionary<NSString *, id> *res) {
|
|
133
|
-
return [self handleResult:res error:err];
|
|
141
|
+
return [self handleResult:res error:err devToolsRequestId:devToolsRequestId];
|
|
134
142
|
}];
|
|
135
143
|
}
|
|
136
144
|
|
|
@@ -153,6 +161,7 @@ static NSString *RCTGenerateFormBoundary()
|
|
|
153
161
|
NSArray<id<RCTURLRequestHandler>> * (^_handlersProvider)(RCTModuleRegistry *);
|
|
154
162
|
NSMutableArray<id<RCTNetworkingRequestHandler>> *_requestHandlers;
|
|
155
163
|
NSMutableArray<id<RCTNetworkingResponseHandler>> *_responseHandlers;
|
|
164
|
+
NSMutableArray<id<RCTNetworkingTextResponseHandler>> *_textResponseHandlers;
|
|
156
165
|
dispatch_queue_t _requestQueue;
|
|
157
166
|
}
|
|
158
167
|
|
|
@@ -300,6 +309,7 @@ RCT_EXPORT_MODULE()
|
|
|
300
309
|
}
|
|
301
310
|
|
|
302
311
|
- (RCTURLRequestCancellationBlock)buildRequest:(NSDictionary<NSString *, id> *)query
|
|
312
|
+
devToolsRequestId:(NSString *)devToolsRequestId
|
|
303
313
|
completionBlock:(void (^)(NSURLRequest *request))block
|
|
304
314
|
{
|
|
305
315
|
RCTAssertThread(_methodQueue, @"buildRequest: must be called on request queue");
|
|
@@ -330,6 +340,7 @@ RCT_EXPORT_MODULE()
|
|
|
330
340
|
[NSURLProtocol setProperty:trackingName forKey:@"trackingName" inRequest:request];
|
|
331
341
|
}
|
|
332
342
|
return [self processDataForHTTPQuery:data
|
|
343
|
+
devToolsRequestId:devToolsRequestId
|
|
333
344
|
callback:^(NSError *error, NSDictionary<NSString *, id> *result) {
|
|
334
345
|
if (error) {
|
|
335
346
|
RCTLogError(@"Error processing request body: %@", error);
|
|
@@ -396,6 +407,7 @@ RCT_EXPORT_MODULE()
|
|
|
396
407
|
*/
|
|
397
408
|
- (RCTURLRequestCancellationBlock)
|
|
398
409
|
processDataForHTTPQuery:(nullable NSDictionary<NSString *, id> *)query
|
|
410
|
+
devToolsRequestId:(NSString *)devToolsRequestId
|
|
399
411
|
callback:(RCTURLRequestCancellationBlock (^)(NSError *error, NSDictionary<NSString *, id> *result))
|
|
400
412
|
callback
|
|
401
413
|
{
|
|
@@ -425,23 +437,24 @@ RCT_EXPORT_MODULE()
|
|
|
425
437
|
NSURLRequest *request = [RCTConvert NSURLRequest:query[@"uri"]];
|
|
426
438
|
if (request) {
|
|
427
439
|
__block RCTURLRequestCancellationBlock cancellationBlock = nil;
|
|
428
|
-
RCTNetworkTask *task =
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
440
|
+
RCTNetworkTask *task = [self
|
|
441
|
+
networkTaskWithDevToolsRequestId:devToolsRequestId
|
|
442
|
+
request:request
|
|
443
|
+
completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {
|
|
444
|
+
dispatch_async(self->_methodQueue, ^{
|
|
445
|
+
cancellationBlock = callback(
|
|
446
|
+
error,
|
|
447
|
+
data ? @{@"body" : data, @"contentType" : RCTNullIfNil(response.MIMEType)} : nil);
|
|
448
|
+
});
|
|
449
|
+
}];
|
|
436
450
|
|
|
437
451
|
[task start];
|
|
438
452
|
|
|
439
453
|
__weak RCTNetworkTask *weakTask = task;
|
|
440
|
-
NSNumber *requestId = [task.requestID copy];
|
|
441
454
|
return ^{
|
|
442
455
|
[weakTask cancel];
|
|
443
456
|
if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) {
|
|
444
|
-
[RCTInspectorNetworkReporter reportRequestFailed:
|
|
457
|
+
[RCTInspectorNetworkReporter reportRequestFailed:devToolsRequestId cancelled:YES];
|
|
445
458
|
}
|
|
446
459
|
if (cancellationBlock) {
|
|
447
460
|
cancellationBlock();
|
|
@@ -452,7 +465,7 @@ RCT_EXPORT_MODULE()
|
|
|
452
465
|
if (formData) {
|
|
453
466
|
RCTHTTPFormDataHelper *formDataHelper = [RCTHTTPFormDataHelper new];
|
|
454
467
|
formDataHelper.networker = self;
|
|
455
|
-
return [formDataHelper process:formData callback:callback];
|
|
468
|
+
return [formDataHelper process:formData devToolsRequestId:devToolsRequestId callback:callback];
|
|
456
469
|
}
|
|
457
470
|
// Nothing in the data payload, at least nothing we could understand anyway.
|
|
458
471
|
// Ignore and treat it as if it were null.
|
|
@@ -571,7 +584,7 @@ RCT_EXPORT_MODULE()
|
|
|
571
584
|
}
|
|
572
585
|
bool base64Encoded = [responseType isEqualToString:@"base64"] || [responseType isEqualToString:@"blob"];
|
|
573
586
|
|
|
574
|
-
[RCTInspectorNetworkReporter maybeStoreResponseBody:task.
|
|
587
|
+
[RCTInspectorNetworkReporter maybeStoreResponseBody:task.devToolsRequestId
|
|
575
588
|
data:responseDataForPreview
|
|
576
589
|
base64Encoded:base64Encoded];
|
|
577
590
|
}
|
|
@@ -583,6 +596,7 @@ RCT_EXPORT_MODULE()
|
|
|
583
596
|
responseType:(NSString *)responseType
|
|
584
597
|
incrementalUpdates:(BOOL)incrementalUpdates
|
|
585
598
|
responseSender:(RCTResponseSenderBlock)responseSender
|
|
599
|
+
devToolsRequestId:(NSString *)devToolsRequestId
|
|
586
600
|
{
|
|
587
601
|
RCTAssertThread(_methodQueue, @"sendRequest: must be called on request queue");
|
|
588
602
|
__weak __typeof(self) weakSelf = self;
|
|
@@ -608,7 +622,7 @@ RCT_EXPORT_MODULE()
|
|
|
608
622
|
NSArray<id> *responseJSON = @[ task.requestID, @(status), headers, responseURL ];
|
|
609
623
|
|
|
610
624
|
if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) {
|
|
611
|
-
[RCTInspectorNetworkReporter reportResponseStart:task.
|
|
625
|
+
[RCTInspectorNetworkReporter reportResponseStart:task.devToolsRequestId
|
|
612
626
|
response:response
|
|
613
627
|
statusCode:status
|
|
614
628
|
headers:headers];
|
|
@@ -648,8 +662,8 @@ RCT_EXPORT_MODULE()
|
|
|
648
662
|
];
|
|
649
663
|
|
|
650
664
|
if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) {
|
|
651
|
-
[RCTInspectorNetworkReporter reportDataReceived:task.
|
|
652
|
-
[RCTInspectorNetworkReporter maybeStoreResponseBodyIncremental:task.
|
|
665
|
+
[RCTInspectorNetworkReporter reportDataReceived:task.devToolsRequestId data:data];
|
|
666
|
+
[RCTInspectorNetworkReporter maybeStoreResponseBodyIncremental:task.devToolsRequestId data:responseString];
|
|
653
667
|
}
|
|
654
668
|
[weakSelf sendEventWithName:@"didReceiveNetworkIncrementalData" body:responseJSON];
|
|
655
669
|
};
|
|
@@ -672,21 +686,33 @@ RCT_EXPORT_MODULE()
|
|
|
672
686
|
if (!(incrementalUpdates && [responseType isEqualToString:@"text"])) {
|
|
673
687
|
[strongSelf sendData:data responseType:responseType response:response forTask:task];
|
|
674
688
|
}
|
|
689
|
+
|
|
690
|
+
if ([responseType isEqualToString:@"text"]) {
|
|
691
|
+
for (id<RCTNetworkingTextResponseHandler> handler in strongSelf->_textResponseHandlers) {
|
|
692
|
+
if ([handler canHandleNetworkingTextResponseForRequest:task.request]) {
|
|
693
|
+
NSString *responseString = [RCTNetworking decodeTextData:data
|
|
694
|
+
fromResponse:task.response
|
|
695
|
+
withCarryData:[NSMutableData new]];
|
|
696
|
+
[handler handleNetworkingResponseText:responseString request:task.request];
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
675
701
|
NSArray *responseJSON =
|
|
676
702
|
@[ task.requestID, RCTNullIfNil(error.localizedDescription), error.code == kCFURLErrorTimedOut ? @YES : @NO ];
|
|
677
703
|
|
|
678
704
|
if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) {
|
|
679
705
|
if (error != nullptr) {
|
|
680
|
-
[RCTInspectorNetworkReporter reportRequestFailed:task.
|
|
706
|
+
[RCTInspectorNetworkReporter reportRequestFailed:task.devToolsRequestId cancelled:NO];
|
|
681
707
|
} else {
|
|
682
|
-
[RCTInspectorNetworkReporter reportResponseEnd:task.
|
|
708
|
+
[RCTInspectorNetworkReporter reportResponseEnd:task.devToolsRequestId encodedDataLength:data.length];
|
|
683
709
|
}
|
|
684
710
|
}
|
|
685
711
|
[strongSelf sendEventWithName:@"didCompleteNetworkResponse" body:responseJSON];
|
|
686
712
|
[strongSelf->_tasksByRequestID removeObjectForKey:task.requestID];
|
|
687
713
|
};
|
|
688
714
|
|
|
689
|
-
task = [self
|
|
715
|
+
task = [self networkTaskWithDevToolsRequestId:devToolsRequestId request:request completionBlock:completionBlock];
|
|
690
716
|
task.downloadProgressBlock = downloadProgressBlock;
|
|
691
717
|
task.incrementalDataBlock = incrementalDataBlock;
|
|
692
718
|
task.responseBlock = responseBlock;
|
|
@@ -699,10 +725,10 @@ RCT_EXPORT_MODULE()
|
|
|
699
725
|
_tasksByRequestID[task.requestID] = task;
|
|
700
726
|
responseSender(@[ task.requestID ]);
|
|
701
727
|
if (facebook::react::ReactNativeFeatureFlags::enableNetworkEventReporting()) {
|
|
702
|
-
[RCTInspectorNetworkReporter reportRequestStart:task.
|
|
728
|
+
[RCTInspectorNetworkReporter reportRequestStart:task.devToolsRequestId
|
|
703
729
|
request:request
|
|
704
730
|
encodedDataLength:task.response.expectedContentLength];
|
|
705
|
-
[RCTInspectorNetworkReporter reportConnectionTiming:task.
|
|
731
|
+
[RCTInspectorNetworkReporter reportConnectionTiming:task.devToolsRequestId request:task.request];
|
|
706
732
|
}
|
|
707
733
|
}
|
|
708
734
|
|
|
@@ -727,6 +753,14 @@ RCT_EXPORT_MODULE()
|
|
|
727
753
|
[_responseHandlers addObject:handler];
|
|
728
754
|
}
|
|
729
755
|
|
|
756
|
+
- (void)addTextResponseHandler:(id<RCTNetworkingTextResponseHandler>)handler
|
|
757
|
+
{
|
|
758
|
+
if (!_textResponseHandlers) {
|
|
759
|
+
_textResponseHandlers = [NSMutableArray new];
|
|
760
|
+
}
|
|
761
|
+
[_textResponseHandlers addObject:handler];
|
|
762
|
+
}
|
|
763
|
+
|
|
730
764
|
- (void)removeRequestHandler:(id<RCTNetworkingRequestHandler>)handler
|
|
731
765
|
{
|
|
732
766
|
[_requestHandlers removeObject:handler];
|
|
@@ -739,6 +773,13 @@ RCT_EXPORT_MODULE()
|
|
|
739
773
|
|
|
740
774
|
- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request
|
|
741
775
|
completionBlock:(RCTURLRequestCompletionBlock)completionBlock
|
|
776
|
+
{
|
|
777
|
+
return [self networkTaskWithDevToolsRequestId:nil request:request completionBlock:completionBlock];
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
- (RCTNetworkTask *)networkTaskWithDevToolsRequestId:(NSString *)devToolsRequestId
|
|
781
|
+
request:(NSURLRequest *)request
|
|
782
|
+
completionBlock:(RCTURLRequestCompletionBlock)completionBlock
|
|
742
783
|
{
|
|
743
784
|
id<RCTURLRequestHandler> handler = [self handlerForRequest:request];
|
|
744
785
|
if (!handler) {
|
|
@@ -746,7 +787,10 @@ RCT_EXPORT_MODULE()
|
|
|
746
787
|
return nil;
|
|
747
788
|
}
|
|
748
789
|
|
|
749
|
-
RCTNetworkTask *task = [[RCTNetworkTask alloc]
|
|
790
|
+
RCTNetworkTask *task = [[RCTNetworkTask alloc] initWithDevToolsRequestId:devToolsRequestId
|
|
791
|
+
request:request
|
|
792
|
+
handler:handler
|
|
793
|
+
callbackQueue:_methodQueue];
|
|
750
794
|
task.completionBlock = completionBlock;
|
|
751
795
|
return task;
|
|
752
796
|
}
|
|
@@ -765,6 +809,7 @@ RCT_EXPORT_METHOD(sendRequest
|
|
|
765
809
|
bool queryIncrementalUpdates = query.incrementalUpdates();
|
|
766
810
|
double timeout = query.timeout();
|
|
767
811
|
bool withCredentials = query.withCredentials();
|
|
812
|
+
NSString *devToolsRequestId = query.unstable_devToolsRequestId();
|
|
768
813
|
|
|
769
814
|
dispatch_async(_methodQueue, ^{
|
|
770
815
|
NSDictionary *queryDict = @{
|
|
@@ -782,14 +827,16 @@ RCT_EXPORT_METHOD(sendRequest
|
|
|
782
827
|
// no way to invoke it, if, for example the request is cancelled while
|
|
783
828
|
// loading a large file to build the request body
|
|
784
829
|
[self buildRequest:queryDict
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
830
|
+
devToolsRequestId:devToolsRequestId
|
|
831
|
+
completionBlock:^(NSURLRequest *request) {
|
|
832
|
+
NSString *responseType = [RCTConvert NSString:queryDict[@"responseType"]];
|
|
833
|
+
BOOL incrementalUpdates = [RCTConvert BOOL:queryDict[@"incrementalUpdates"]];
|
|
834
|
+
[self sendRequest:request
|
|
835
|
+
responseType:responseType
|
|
836
|
+
incrementalUpdates:incrementalUpdates
|
|
837
|
+
responseSender:responseSender
|
|
838
|
+
devToolsRequestId:devToolsRequestId];
|
|
839
|
+
}];
|
|
793
840
|
});
|
|
794
841
|
}
|
|
795
842
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(83),
|
|
26
26
|
RCTVersionPatch: @(0),
|
|
27
|
-
RCTVersionPrerelease: @"nightly-
|
|
27
|
+
RCTVersionPrerelease: @"nightly-20251009-24d0d4414",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -1418,6 +1418,7 @@ namespace JS {
|
|
|
1418
1418
|
bool incrementalUpdates() const;
|
|
1419
1419
|
double timeout() const;
|
|
1420
1420
|
bool withCredentials() const;
|
|
1421
|
+
NSString *unstable_devToolsRequestId() const;
|
|
1421
1422
|
|
|
1422
1423
|
SpecSendRequestQuery(NSDictionary *const v) : _v(v) {}
|
|
1423
1424
|
private:
|
|
@@ -2610,6 +2611,11 @@ inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::withCredentials() con
|
|
|
2610
2611
|
id const p = _v[@"withCredentials"];
|
|
2611
2612
|
return RCTBridgingToBool(p);
|
|
2612
2613
|
}
|
|
2614
|
+
inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::unstable_devToolsRequestId() const
|
|
2615
|
+
{
|
|
2616
|
+
id const p = _v[@"unstable_devToolsRequestId"];
|
|
2617
|
+
return RCTBridgingToOptionalString(p);
|
|
2618
|
+
}
|
|
2613
2619
|
inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(const Input i) : _factory(^{
|
|
2614
2620
|
NSMutableDictionary *d = [NSMutableDictionary new];
|
|
2615
2621
|
auto major = i.major.get();
|
|
@@ -2478,6 +2478,7 @@ public final class com/facebook/react/modules/appearance/AppearanceModule : com/
|
|
|
2478
2478
|
public fun addListener (Ljava/lang/String;)V
|
|
2479
2479
|
public final fun emitAppearanceChanged (Ljava/lang/String;)V
|
|
2480
2480
|
public fun getColorScheme ()Ljava/lang/String;
|
|
2481
|
+
public final fun invalidatePlatformColorCache ()V
|
|
2481
2482
|
public final fun onConfigurationChanged (Landroid/content/Context;)V
|
|
2482
2483
|
public fun removeListeners (D)V
|
|
2483
2484
|
public fun setColorScheme (Ljava/lang/String;)V
|
|
@@ -132,7 +132,7 @@ internal class InterpolationAnimatedNode(config: ReadableMap) : ValueAnimatedNod
|
|
|
132
132
|
val outputRange = arrayOfNulls<DoubleArray>(size)
|
|
133
133
|
|
|
134
134
|
// Match the first pattern into a List, since we don't know its length yet
|
|
135
|
-
var m = numericPattern.matcher(array.getString(0)
|
|
135
|
+
var m = numericPattern.matcher(array.getString(0).orEmpty())
|
|
136
136
|
val firstOutputRange: MutableList<Double> = ArrayList()
|
|
137
137
|
while (m.find()) {
|
|
138
138
|
firstOutputRange.add(m.group().toDouble())
|
|
@@ -145,7 +145,7 @@ internal class InterpolationAnimatedNode(config: ReadableMap) : ValueAnimatedNod
|
|
|
145
145
|
for (i in 1 until size) {
|
|
146
146
|
val outputArr = DoubleArray(firstOutputRangeArr.size)
|
|
147
147
|
var j = 0
|
|
148
|
-
m = numericPattern.matcher(array.getString(i)
|
|
148
|
+
m = numericPattern.matcher(array.getString(i).orEmpty())
|
|
149
149
|
while (m.find() && j < firstOutputRangeArr.size) {
|
|
150
150
|
outputArr[j++] = m.group().toDouble()
|
|
151
151
|
}
|