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

What's different form r2? ⚡️👐 #10

Closed
antonmedv opened this issue Sep 5, 2018 · 10 comments
Closed

What's different form r2? ⚡️👐 #10

antonmedv opened this issue Sep 5, 2018 · 10 comments

Comments

@antonmedv
Copy link

https://www.npmjs.com/package/r2

@szmarczak
Copy link
Collaborator

It's an early release. There's no major difference yet, but soon there'll be many useful features which r2 doesn't provide.

@sindresorhus
Copy link
Owner

sindresorhus commented Sep 5, 2018

From a quick glance at r2, the main benefits of ky are:

  • Built for the browser only. r2 targets Node.js too, which means it has to target the lowest common denominator. node-fetch is missing a lot of functionality.
  • Treats non-200 status codes as errors.
  • Retries failed requests.
  • Timeout support.
  • Instances with custom defaults.
  • Uses functions instead of properties for the body methods. .json() is clearer than .json. See: Consider using functions instead of getter properties mikeal/r2#22
  • Better docs.
  • Actively maintained (Although it's early, I do intend to actively maintain it). The last commit of r2 was in May.
  • Many cool things planned for the future 😎

@sindresorhus
Copy link
Owner

We'll add a comparison table later on when Ky is more mature.

sindresorhus added a commit that referenced this issue Sep 5, 2018
@szmarczak
Copy link
Collaborator

@sindresorhus r2 is built for browsers too. It uses node-fetch as a polyfill.

@sindresorhus
Copy link
Owner

@szmarczak You're right. I only read the first part of the text. Updated.

@danielbayerlein danielbayerlein mentioned this issue Sep 8, 2018
@borisrorsvort
Copy link

Aside from comparaison table, if you think these differences are better, why not discussing them between library makers and choose one existing one and make it stronger & reliable lib. So that everybody can commit and improve without fearing it gets abandonned next year? Some libs are much older and their makers dont have @sindresorhus exposure, though this lib is heavily inspired by them.

@sindresorhus
Copy link
Owner

@borisrorsvort I first started this project more than a year ago as an experiment to see how I could reimagine Got if it were built for the browser and based on Fetch. It's solely inspired by Got and Fetch. I only just recently had the time to finish it up and publish it.

It's not clear what libs you're referring to, but if you can share, I can elaborate more. If you mean r2, I had not seen it before it was mentioned here, but it's also clearly not maintained anymore, so trying to contribute to it would not be very productive.


without fearing it gets abandonned next year?

I have 1K+ npm packages and I actively maintain them all. I've been doing open source for many years and I don't see that changing. I'm in for the long haul. I'm supported by the community to work on open source full-time. I created Got in early 2014 and it's still actively maintained. Ky also has another maintainer and hopefully even more additional maintainers in the future. I hope this addresses your concerns.

@borisrorsvort
Copy link

There is https://github.com/elbywan/wretch for instance .
My comment wasn't in no way intended to question the quality of your work which I deeply respect but more as a general remark about the js ecosystem.

@sindresorhus
Copy link
Owner

sindresorhus commented Sep 11, 2018

There is elbywan/wretch for instance.

Its overly chainable API would be a dealbreaker for me personally. I don't see anyway they would change that.

My comment wasn't in no way intended to question the quality of your work which I deeply respect but more as a general remark about the js ecosystem.

I did not take it as that :) I just wanted to elaborate on why Ky will not end up being abandoned like a lot of projects in the JS ecosystem, which I totally agree is a big problem.

@joseluisq
Copy link

One of the most significant differences is latest browsers support by default.

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

No branches or pull requests

5 participants