Skip to content

Technical planning and discussion #4

Open
@acostalima

Description

@acostalima

@cpojer I'm reaching out to follow up on a previous discussion about coming up with a custom Fetch API implementation for React Native at https://github.com/react-native-community/fetch with support for streaming (facebook/react-native#27741). We, MOXY and Protocol Labs, are planning to start this effort shortly and we'd like to know your thoughts on the matter.

In short, what we currently have in mind is as follows:

  • Rewrite whatwg-fetch in modern JS.
  • Remove XHR out of the equation and implement fetch directly on top of RN's JavaScript Network API exactly for the same reasons outlined at Support for server-sent events (EventSource) discussions-and-proposals#99.
  • Assume ReadableStream is available in RN's environment which can be polyfilled with web-streams-polyfill. If ReadableStream is expected to only be used in the context of Fetch, we can probably bundle them together.
  • Have tests in place running in an actual RN app on GitHub's CI.

Even if Facebook has no plans to add support for streaming to Fetch for the time being, app developers can easily swap out whatwg-fetch for @react-native-community/fetch manually. Even better would be React Native to do this automatically via some sort of extension or plugin API.

Are there any guidelines which React Native Community packages should conform to? e.g. linter and linting config, CI process config, etc.

CC @satazor @hugomrdias

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions