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

Axios #208

Merged
merged 58 commits into from
Nov 3, 2020
Merged

Axios #208

merged 58 commits into from
Nov 3, 2020

Conversation

glynnbird
Copy link
Contributor

@glynnbird glynnbird commented Feb 28, 2020

Overview

The request module is deprecated. This pull request will aim to replace request with axios. I tried to do this work inside of the "relax" function so that all the callers of the relax function stay the same. Only the db.copy had to be removed because the COPY method is not supported by axios.

As this project's dependency "cloudant-follow" is also a user of request (and is becoming deprecated itself), the 'follow*' functions of this library are also deprecated and replaced with new 'changesReader' functions which I wrote myself and have plumbed into the library.

I also took the opportunity of removing extraneous dependencies (Nano now only has 2 dependencies), fixed up the logging module and improved the README.

Note it looks like a lot of commits, but the first bunch are from a previous branch that were 'squashed' into master. All of this change will get squashed when merged.

Testing recommendations

npm run test

GitHub issue number

#196

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

@fynnlyte
Copy link

Hi, how is the status of this branch? I've run my tests against it and noticed that errors aren't forwarded from CouchDB as they have been before. For example, the response for db.get on a deleted document used to include:

  name: 'Error',
  error: 'not_found',
  reason: 'deleted',

but that's currently missing.

@glynnbird
Copy link
Contributor Author

@LyteFM Good point. I've added quick change to ensure that the Error object thrown during errors contains attributes received in the response.

@fynnlyte
Copy link

Great, works for me now - but the error response for HEAD doesn't seem to be as expected.

@glynnbird
Copy link
Contributor Author

Thanks @LyteFM. Another commit (or two) to correct what happens when there is no response body (as with a HEAD /db/id request).

YC and others added 3 commits September 17, 2020 09:22
* fix(nano.d.ts): add opts and callback for nano.request

* fix(nano.d.ts): add opts and callback for relax and dinosaur
@ksathyanm
Copy link

I have been waiting for this PR to be merged/released, to consume nano in my projects. Any updates on this PR?

Copy link
Member

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

This is a massive effort. Great work Glynn.

@glynnbird glynnbird changed the base branch from master to main November 2, 2020 15:32
@glynnbird
Copy link
Contributor Author

Just some extra housekeeping because of the master/main switchover.

@glynnbird glynnbird merged commit 8655d40 into main Nov 3, 2020
@glynnbird glynnbird deleted the axios branch November 3, 2020 16:12
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.

None yet

9 participants