Skip to content

Standardize how we make HTTP requests? #423

@matei-radu

Description

@matei-radu

During the review of #268, we noticed that we are using multiple fetch implementations across the CLI. These are:

  1. fetch function from cli/src/tools/fetch.js . This is a very, very minimalistic GET-only wrapper around the standard https module.
  2. httpsGet function from cli/src/tools/releaseChecker/getLatestRelease.js. This is, again, a GET-only wrapper around https that exists because the above mentioned fetch does not satisfies the requirements (see discussion).
  3. node-fetch in tools/src/isPackagerRunning.js.

Should we standardize the way we make HTTP requests in this project?

I propose to discuss and decide on one implementation to use across the entire CLI to keep things consistent. Of course, it doesn't have to be one of the above implementations if you want to suggest a different one (e.g. axios or the standard https Node module) 😃

I'll start! I believe we can stick with node-fetch and replace the other implementations with it. We should also mention somewhere in the Contributing doc to use node-fetch when making network request so that we avoid this inconsistency happening again in the future.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions