jthomas commented on issue #158: node-proxy-agent adds a huge amount to load 
time and installed size
URL: 
https://github.com/apache/incubator-openwhisk-client-js/issues/158#issuecomment-481204216
 
 
   Looking into this some more... it's clear adding the `proxy-agent` 
dependency causes an unacceptable increase in dependency size and load time. I 
do think supporting HTTP proxies is a valid requirement and we do want to still 
support this.
   
   https://packagephobia.now.sh/result?p=proxy-agent
   
   Install size has jumped from under 1MB to over 5MB. 
   https://packagephobia.now.sh/[email protected]
   
   I have a few ideas about how to resolve this, want to open it up for 
community involvement to decide the best way forward.
   
   1. Allow user to pass in exact `http.Agent` implementation class in 
constructor, rather than providing the implementation in the library.
   
   2. Remove `proxy-agent` dependency and replace with underlying 
`http-proxy-agent` and `https-proxy-agent` deps this project relies on. 
   
   Does anyone have any other suggestions? 
   
   Given the vast majority of users will not need a HTTP proxy, I'd like to 
keep the "fast path" as light as possible and this means option 1). seems like 
the best choice. This does make it a bit more difficult for downstream tools 
like The Serverless Framework (where the SDK is used implicitly) but that's a 
trade-off I think we have to make. Those tools will have to manage this in 
their projects. 
   
   I've also opened some other issues to help make sure this kind of issue 
[doesn't happen 
again](https://github.com/apache/incubator-openwhisk-client-js/issues/159) and 
also [reduce build 
size](https://github.com/apache/incubator-openwhisk-client-js/issues/160) even 
further.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to