mikeal / r2

HTTP client. Spiritual successor to request.
Apache License 2.0
4.44k stars 117 forks source link

Document support browser versions #29

Open JamesMGreene opened 7 years ago

JamesMGreene commented 7 years ago

Please document the support browser and Node versions.

At least for the browsers, I believe this to be very limited given there isn't any employment of a browser-side polyfill here if the Fetch API is not available. I think many people would be surprised by that when coming to the "spiritual successor of request". Granted, that issue could be solved by incorporating something like #27 (using isomorphic-fetch rather than just node-fetch) if desired.

gr2m commented 6 years ago

For node it would be sufficient to add "The latest Node LTS version is supported" and link to https://github.com/nodejs/Release#lts-schedule.

For browsers I’d say it’s safe to say that all browsers are supported. IE 11 and Opera Mini need a fetch polyfill. Maybe link to https://caniuse.com/#feat=fetch and for the browser support (as well as react native) link to https://www.npmjs.com/package/whatwg-fetch for a polyfill

ljharb commented 6 years ago

If all browsers are supported, then why not all nodes?

gr2m commented 6 years ago

*All evergreen browsers are supported.

If all browsers are supported, then why not all nodes?

Read more about the motivation here: Stop supporting old releases

https://github.com/mikeal/r2/blob/0a93782fc1523e1c1ff2357499fcb42ab9cb7850/.travis.yml#L6-L8

It's not that I wouldn’t support all Node versions, but I wouldn’t do it ourselves. But we could add a way for others to sign up to support older Node versions and backport new features / fixes

ljharb commented 6 years ago

Yes, I’m familiar with that article and position, and think it’s hugely harmful to the ecosystem - but that philosophy also indeed means all evergreen browsers, which would mean no IE or Opera whatsoever. Why support those if not older nodes?

gr2m commented 6 years ago

Good point, thanks Jordan!

Let’s not officially support IE or Opera. It could work with a fetch polyfill, but no guarantees.

ljharb commented 6 years ago

At least that will be consistent :-)