Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap to migrate away from request #13003

Closed
DanielRuf opened this issue Apr 1, 2019 · 12 comments
Closed

Roadmap to migrate away from request #13003

DanielRuf opened this issue Apr 1, 2019 · 12 comments
Assignees
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@DanielRuf
Copy link
Contributor

Summary

request is in maintenance mode now so we should check what we have to do to migrate away from it.

Relevant information

request/request#3142

@KyleAMathews
Copy link
Contributor

There's no specific rush to do this as request isn't going to stop working :-)

I did a quick look and we only use request once in our code base — 

request(proxiedUrl).on(`error`, err => {

If someone wants to PR moving to a different library, that seems reasonable.

@DanielRuf
Copy link
Contributor Author

I did a quick look and we only use request once in our code base

I thought there were more places where we still use request.

There's no specific rush to do this as request isn't going to stop working :-)

Sure but let's keep an eye on this.

If someone wants to PR moving to a different library, that seems reasonable.

👍

@sindresorhus
Copy link

If you're willing to give got a try, I think you could simply replace request( with got.stream( in the referenced code.

See: https://github.com/sindresorhus/got/blob/master/migration-guides.md#more-about-streams

@wardpeet
Copy link
Contributor

sweet! we're open for PRs but this isn't really urgent.

@wardpeet wardpeet added good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change labels Apr 15, 2019
@ryandrew14
Copy link
Contributor

Looked into it a little more, and I think @sindresorhus is right -- got seems like the best option. They have a great comparison on their website of how it stacks up against other Node libraries for making requests. I will make a PR for this tonight.

@pieh
Copy link
Contributor

pieh commented Apr 18, 2019

Just note on got - we still do support node 6 :( and got@^9 seems to require node: ">=8.6", so if we would switch we would need to use got@<=8 (which works on node: ">=4").

The node 6 support is super problematic for us, but we can't drop it in the middle of gatsby@2 (even if node 6 end of life is generally coming pretty soon - I think end of April 2019).

@ryandrew14
Copy link
Contributor

Closed by #13434.

@sidharthachatterjee
Copy link
Contributor

Published in gatsby@2.3.25

@armchairdeity
Copy link

If you're willing to give got a try, I think you could simply replace request( with got.stream( in the referenced code.

See: https://github.com/sindresorhus/got/blob/master/migration-guides.md#more-about-streams

Broken link... :(

@DanielRuf
Copy link
Contributor Author

@armchairdeity
Copy link

@tomconder
Copy link

@armchairdeity see https://github.com/sindresorhus/got/blob/master/documentation/migration-guides.md

They renamed the master branch to main. Now the url is: https://github.com/sindresorhus/got/blob/main/documentation/migration-guides/request.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

No branches or pull requests

9 participants