`isomorphic-fetch` 和 `isomorphic-unfetch` npm 包有什么区别

What is the difference between `isomorphic-fetch` and `isomorphic-unfetch` npm packages

我看到两者都用于SSR。那么有什么区别呢?除了 isomorphic-fetch being older and slightly larger gzipped package

链接:

Isomorphic Unfetch

Isomorphic Fetch

isomorphic-fetch is built on top of whatwg-fetch and isomorphic-unfetch is built on top of unfetch. What both of them are doing is switching between node-fetch 以及客户端和服务器的其他包。

所以他们的区别只在客户端,问题简化为:whatwg-fetch and unfetch有什么区别?

whatwg-fetch package is an almost complete polyfill for fetch API, but the unfetch is built with "bundle size" as the first priority in mind (like the other packages written by Jason Miller such as preact). The unfetch 仅支持完整提取的子集 API。但是,如果您的应用程序中只需要简单的请求,那就太好了。

新应用程序的一个好策略是使用 unfetch at first, and replace it with whatwg-fetch if you need any feature (such as streaming) which is not supported in unfetch