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

feat(http-caching-proxy): replace request package with axios #4637

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Feb 12, 2020

This is part 2 to fix #2672

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@raymondfeng raymondfeng changed the title Replace request package feat(http-caching-proxy): replace request package with axios Feb 12, 2020
'http://www.mocky.io/v2/5dade5e72d0000a542e4bd9c?mocky-delay=1000ms',
proxy: proxy.url,
resolveWithFullResponse: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolveWithFullResponse is request's counter-part of Axios' validateStatus. Have you considered configuring validateStatus on a per-test basis, as we are doing with resolveWithFullResponse now?

@bajtos
Copy link
Member

bajtos commented Feb 14, 2020

Based on the investigation I did today, I am happy to choose Axios as our replacement for request 🎉

Let's improve implementation details now.

Also, I am not confident that the switch from request to axios is fully backwards compatible in all edge cases, let's make this a semver-major change please.

@bajtos
Copy link
Member

bajtos commented Feb 14, 2020

coverage/coveralls — Coverage decreased (-0.01%) to 92.492%

I see quite few places in http-caching-proxy.ts not covered by our test suite, can you please check? I am mostly concerned about code supposed to handle error situations but not being verified to work as intended (see here and here).

@bajtos
Copy link
Member

bajtos commented Feb 14, 2020

FYI: I opened a feature request in Axios to make their API closer to request, see axios/axios#2741

@raymondfeng
Copy link
Contributor Author

@bajtos PTAL.

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with few tiny comments to consider.

@bajtos
Copy link
Member

bajtos commented Feb 18, 2020

@raymondfeng As I commented elsewhere of before, I'd like us to release this change as a semver-major release. axios may behave differently than request in edge cases, I'd rather make this change explicit in the release notes. Can you please add BREAKING CHANGE footer to the commit message?

… client

BREAKING CHANGE: [axios](https://github.com/axios/) is now used as the
http client package to replace [request](https://github.com/request/request)
which is now deprecated.
@raymondfeng raymondfeng merged commit cd89ad4 into master Feb 19, 2020
@raymondfeng raymondfeng deleted the replace-request-package branch February 19, 2020 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace "request" with something else
2 participants