toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

fix: lazy load ProxyAgent to avoid bundling all the undici

Open aminya opened this issue 1 year ago • 0 comments

This makes the loading of undici conditional by lazy loading it inside the actual function that needs the ProxyAgent.

undici is a huge library, and here it is being imported unconditionally, which results in 500KB bloat in the bundles of http-client. By requiring only what is needed and when it is needed, this issue is resolved.

Fixes #1560 Closes #1561

aminya avatar Aug 17 '24 16:08 aminya