Skip to content

feat: streaming-support#40

Draft
riteshshukla04 wants to merge 3 commits intomargelo:mainfrom
riteshshukla04:ritesh/streaming
Draft

feat: streaming-support#40
riteshshukla04 wants to merge 3 commits intomargelo:mainfrom
riteshshukla04:ritesh/streaming

Conversation

@riteshshukla04
Copy link
Collaborator

@riteshshukla04 riteshshukla04 commented Mar 13, 2026

Before:-

No Streaming support

After:-

async function streamFetch() {
  const response = await fetch("https://example.com/stream");

  const reader = response.body.getReader();
  const decoder = new TextDecoder();

  while (true) {
    const { done, value } = await reader.read();

    if (done) {
      console.log("Stream finished");
      break;
    }

    const chunk = decoder.decode(value, { stream: true });
    console.log("Chunk:", chunk);
  }
}

streamFetch();

"-DRCT_REMOVE_LEGACY_ARCH=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentional? maybe hoisted dependencies changed? monorepo setup

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we have to fix that

Comment on lines +18 to +37
fun cronet(
message: String,
internalErrorCode: Double
): RequestException {
return RequestException(
platform = ExceptionPlatform.ANDROID_PLATFORM,
message = message,
code = internalErrorCode,
errorType = ErrorType.CRONET,
internalErrorCode = internalErrorCode,
networkErrorCode = null,
quicErrorCode = null,
stackTrace = null,
errorDomain = null,
localizedDescription = null,
underlyingError = null,
failingURL = null,
causeMessage = null
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is purely subjective, but I would probably not make this a function, but instead a class- like CronetException, which inherits from RequestException

class HybridTextDecoder : public HybridNitroTextDecoderSpec {
public:
// Constructor with encoding, fatal flag, and ignoreBOM flag
explicit HybridTextDecoder(const std::string &encoding = "utf-8",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is encoding a string? Why not an enum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants