refactor!: replace global-agent with proxy-agent#368
refactor!: replace global-agent with proxy-agent#368BlackHole1 wants to merge 2 commits intomainfrom
Conversation
The `global-agent` dependency is in a state of maintenance stagnation. Although 4 releases have been published in the last month, they are all in an unusable state (which reduces my confidence in this dependency). Also, personally, I don't think the proxy should pollute the entire global scope - all requests are being proxied. It should be more atomic. Fortunately, we have set the minimum node version requirement to >= 22.12.0. Based on this, we can gracefully use `proxy-agent` to use a proxy for specific requests without polluting the global scope. Regarding proxy behavior, I referred to curl: automatically detect proxy variables and apply them. Instead of controlling whether to use a proxy through special env variables, this will reduce the cognitive load on developers (because many developers simply don't know that `npm install electron` actually calls `@electron/get` to download, let alone look at the `@electron/get` documentation). BREAKING CHANGE: `GLOBAL_AGENT_*` env vars no longer work. `ELECTRON_GET_USE_PROXY` is no longer checked. `getEnv()` and `setEnv()` removed from public API. Signed-off-by: Kevin Cui <bh@bugs.cc>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Signed-off-by: Kevin Cui <bh@bugs.cc>
|
Paper trail from a Slack conversation, I asked @BlackHole1 if he could evaluate |
Fixed: #304 #243
The
global-agentdependency is in a state of maintenance stagnation. Although 4 releases have been published in the three weeks ago., they are all in an unusable state (which reduces my confidence in this dependency).Also, personally, I don't think the proxy should pollute the entire global scope - all requests are being proxied. It should be more atomic.
Fortunately, we have set the minimum node version requirement to >= 22.12.0. Based on this, we can gracefully use
proxy-agentsto use a proxy for specific requests without polluting the global scope.Regarding proxy behavior, I referred to curl: automatically detect proxy variables and apply them. Instead of controlling whether to use a proxy through special env variables, this will reduce the cognitive load on developers (because many developers simply don't know that
npm install electronactually calls@electron/getto download, let alone look at the@electron/getdocumentation).No Proxy ENV

Has Proxy ENV

BREAKING CHANGE:
GLOBAL_AGENT_*env vars no longer work.ELECTRON_GET_USE_PROXYis no longer checked.getEnv()andsetEnv()removed from public API.