Unfetch Versions Save

🐕 Bare minimum 500b fetch polyfill.

isomorphic-4.0.2

1 year ago

5.0.0

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/developit/unfetch/compare/4.2.0...5.0.0

isomorphic-4.0.1

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/developit/unfetch/compare/isomorphic-3.1.0...isomorphic-4.0.1

4.2.0

3 years ago
  • Fix unintentional use of arrow functions in some 4.1.0 builds (#138, thanks @simon04!)
  • Fix usage in Web Workers (#109)
  • .json() parse errors return a rejected Promise instead of throwing (#112, thanks @sunsean!)
  • Improved TypeScript typings (#117 & #121, thanks @Andarist & @0x80!)
  • Add support for passing URL objects to fetch() (#141, thanks @Edorka for the tip!)

Please make sure to also update to [email protected], which includes a security fix for node-fetch. (thanks @sakito21)

4.1.0

5 years ago
  • Fix TypeScript definitions (#99 #105 - thanks @stephenmathieson & @Fnatte!)
  • Drop another 20 bytes, now 478b 🐕

4.0.1

5 years ago

Quick publishing fix.

3.1.2

5 years ago
  • Fixes an IE11 bug (#85, thanks @khusa!)

4.0.0

5 years ago

🦄 Small breaking change for awesome ponyness:

  • unfetch is now a pure ponyfill.
  • unfetch/polyfill is now the polyfill version (even smaller than the ponyfill!)
  • All modules are shipped in all formats, and the polyfill is now < 500b.
  • Also a little bugfix for IE11 (#85, thanks @khusa)

TL;DR: require('unfetch') no longer returns window.fetch when it exists. For that, use unfetch/polyfill.

This change makes unfetch lovely to use as a polyfill from HTML:

<script src="https://unpkg.com/unfetch/polyfill"></script>
<!-- that's it! -->
<script>foo = await fetch('/foo.json')</script>

Otherwise, if you're using Unfetch and bundling your code, continue as you were before:

if (!self.fetch) self.fetch = require('unfetch');
// or simply:
import 'unfetch/polyfill';

Important - the one thing to avoid:

Since unfetch is a proper ponyfill, it will now overwrite fetch even in supported browsers if you do the following

// never do this!
window.fetch = require('unfetch');

3.1.1

5 years ago

3.1.0

5 years ago

Also released: [email protected] - now with node-fetch 2.x, TypeScript definitions and a readme.

  • TypeScript definitions!
  • Fixes a bug in response status code parsing
  • Fixes XHR being potentially synchronous in really old browsers
  • Fixes parsing of empty header values
  • Serves up the umd bundle on unpkg.com