walletconnect-monorepo icon indicating copy to clipboard operation
walletconnect-monorepo copied to clipboard

Duplicate fetch dependencies across WalletConnect SDK

Open v1rtl opened this issue 1 year ago • 1 comments

Describe the bug

WalletConnect dependency tree includes 5 different, but identical fetch implementations instead of using just one:

This bloats up the bundle size and polyfills existing fetch implementation that all major platforms already support. The only platform without fetch API is IE11, in which case people who need to support IE11 can set up the polyfill themselves through webpack or any other bundler they're using. And from what I know, WalletConnect doesn't work on IE11.

Node.js supports fetch since v18, which is 2 years old. React Native has native fetch support. Deno and Bun natively implement fetch. All browsers except IE implement fetch since very long ago.

SDK Version (if relevant)

  • Client: TypeScript
  • Version [e.g. 22] 2.13.3

To Reproduce Steps to reproduce the behavior:

  1. npm i @walletconnect/ethereum-provider
  2. Get 5 different fetch implementations downloaded

Expected behavior

Either only one fetch implementation to be used, or preferably use native one.

Additional context

Dependency graph can be inspected here: https://npmgraph.js.org/?q=%40walletconnect%2Fethereum-provider%40latest

v1rtl avatar Jun 29 '24 08:06 v1rtl