Giter VIP home page Giter VIP logo

Comments (10)

sindresorhus avatar sindresorhus commented on May 22, 2024 40

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 😎

from ky.

sindresorhus avatar sindresorhus commented on May 22, 2024 21

@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.

from ky.

sindresorhus avatar sindresorhus commented on May 22, 2024 15

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

from ky.

borisrorsvort avatar borisrorsvort commented on May 22, 2024 13

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.

from ky.

borisrorsvort avatar borisrorsvort commented on May 22, 2024 7

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.

from ky.

szmarczak avatar szmarczak commented on May 22, 2024

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

from ky.

szmarczak avatar szmarczak commented on May 22, 2024

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

from ky.

sindresorhus avatar sindresorhus commented on May 22, 2024

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

from ky.

sindresorhus avatar sindresorhus commented on May 22, 2024

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.

from ky.

joseluisq avatar joseluisq commented on May 22, 2024

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

from ky.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.