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鈥檒l 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

Comments

@antonmedv
Copy link

commented Sep 5, 2018

@szmarczak

This comment has been minimized.

Copy link
Collaborator

commented Sep 5, 2018

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

@szmarczak szmarczak closed this Sep 5, 2018

@sindresorhus

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Owner

commented Sep 5, 2018

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

This comment has been minimized.

Copy link
Collaborator

commented Sep 5, 2018

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

@sindresorhus

This comment has been minimized.

Copy link
Owner

commented Sep 5, 2018

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

@danielbayerlein danielbayerlein referenced this issue Sep 8, 2018

Closed

Why Ky? #21

@borisrorsvort

This comment has been minimized.

Copy link

commented Sep 8, 2018

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

This comment has been minimized.

Copy link
Owner

commented Sep 11, 2018

@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

This comment has been minimized.

Copy link

commented Sep 11, 2018

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

commented Sep 12, 2018

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
Projects
None yet
5 participants
You can鈥檛 perform that action at this time.