developit/unfetch

isomorphic-unfetch: Consider making node-fetch a peerDependency

jamiechong opened this issue · 8 comments

I have the case where I'd like to have better control of the version of node-fetch used (v3.x beta). If it were a peer dependency I'd be able to do this.

Definitely open to this.

Peer dependencies are not meant to be optional. This will cause problems with non-node installs.

How about at least adding a peer dependency on @types/node-fetch, so building with this package doesn't fail? (see #96)

Fully support this since unfetch bundles its own type definitions. Per @mindplay-dk's own comment in that thread,

But either way, it's currently an undeclared dependency - you have to get a build failure and then manually install the package, so I think either that should be fixed, or the dependency should be removed?

E: I wonder if you shouldn't open a separate issue for visibility.

@jamiechong you can use yarn and resolutions field in package.json to force exact version of dependencies. But be careful, it could break things.

@developit can node-fetch be updated to v3.1.0 please?

@matheo want to open a PR?

@developit , I tried my best to create #156 , but I am stuck to fix the test cases. Can you please take a look?