Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RCTInspectorNetworkReporteris the integration point for networking stacks that replaceRCTNetworking, but it has no typed way to store a complete text response preview.maybeStoreResponseBody:data:base64Encoded:declaresNSData, though its implementation also accepts anNSString, so Swift callers cannot reach that branch.Motivation
Expo is moving
expo/fetch,expo-imageandexpo-assetontoRCTInspectorNetworkReporter, in place of its own CDP relay in Expo CLI. Its reporter is written in Swift and holds each response body in full once loading finishes, so for text it needs to store a decoded string. It currently routes through a small Objective-C helper that passes the string asid(expo/expo#53160).maybeStoreResponseBodyIncrementalaccepts a string, but it is built for chunked delivery, keeping a second copy in a process-wide buffer untilreportResponseEnd.Changes
maybeStoreResponseBody:body:, which stores a decoded text body, and is a no-op when CDP debugging is disabled.maybeStoreResponseBody:data:base64Encoded:unchanged, sinceRCTNetworkingrelies on itsNSStringbranch for base64 strings.Changelog:
[iOS][Added] - React Native DevTools:
RCTInspectorNetworkReportermaybeStoreResponseBody:body:method, to store text response previews from SwiftTest Plan
Built Expo's
bare-expoapp from source against React Native 0.89.0-rc.2, whose copy of these files is identical tomain, with this change applied and Expo's Swift reporter calling the new method in place of its Objective-C helper:maybeStoreResponseBody(_:body:).expo/fetchrequest for a JSON response returned its full body fromNetwork.getResponseBody, as text (base64Encoded: false).ℹ️ Adds the method to the four
ReactApplesnapshots. TheReactAndroidviews failed locally on an unrelated Doxygen parse error infmt's headers.