Gatsby: Roadmap to migrate away from request

Created on 1 Apr 2019  ·  11Comments  ·  Source: gatsbyjs/gatsby

Summary

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

Relevant information

https://github.com/request/request/issues/3142

good first issue help wanted maintenance

Most helpful comment

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

All 11 comments

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 — https://github.com/gatsbyjs/gatsby/blob/a43288d15831926c6c92192e1c0f50878b6fd798/packages/gatsby/src/commands/develop.js#L193

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

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.

👍

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

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

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.

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).

Closed by #13434.

Published in [email protected]

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... :(

Was this page helpful?
0 / 5 - 0 ratings