request is in maintenance mode now so we should check what we have to do to migrate away from it.
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
requestonce in our code base
I thought there were more places where we still use request.
There's no specific rush to do this as
requestisn'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
gota try, I think you could simply replacerequest(withgot.stream(in the referenced code.See: https://github.com/sindresorhus/got/blob/master/migration-guides.md#more-about-streams
Broken link... :(
@armchairdeity see https://github.com/sindresorhus/got/blob/master/documentation/migration-guides.md
Thanks! 👍🏻
Most helpful comment
If you're willing to give
gota try, I think you could simply replacerequest(withgot.stream(in the referenced code.See: https://github.com/sindresorhus/got/blob/master/migration-guides.md#more-about-streams