feat!: replace got with native fetch as default downloader#376
Open
MarshallOfSound wants to merge 1 commit intomainfrom
Open
feat!: replace got with native fetch as default downloader#376MarshallOfSound wants to merge 1 commit intomainfrom
MarshallOfSound wants to merge 1 commit intomainfrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
BlackHole1
approved these changes
Mar 25, 2026
BREAKING CHANGE: The default downloader now uses the built-in Fetch API instead of the got package. The GotDownloader and GotDownloaderOptions exports have been removed; use FetchDownloader and FetchDownloaderOptions instead. Download options now accept RequestInit options instead of got options. The initializeProxy() function now uses undici's EnvHttpProxyAgent instead of global-agent, reading HTTP_PROXY/HTTPS_PROXY/NO_PROXY environment variables directly (GLOBAL_AGENT_* prefixed variables are no longer supported).
5b5862b to
c2e88cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a proposed breaking change to reduce the dependency footprint of
@electron/getby replacing thegotHTTP client with Node's built-infetchAPI.Motivation
gotis a heavyweight dependency with its own transitive dependency tree. Since@electron/getrequires Node 22.12+, nativefetchis guaranteed to be available and is sufficient for our use case of streaming file downloads.Dependency changes
got^14.4.5(dependency)global-agent^3.0.0(optional)undici^7.24.4(optional, proxy support only)Preserved behavior
getProgressCallbackreceives aProgressobject withtransferred,total, andpercent(same shape as got's progress events)quietorELECTRON_GET_NO_PROGRESS)HTTPErrorwith message formatResponse code 404 (Not Found) for ${url}ELECTRON_GET_USE_PROXYstill auto-initializes proxy supportNew exports
FetchDownloader— the new default downloader classFetchDownloaderOptions— options type extendingRequestInitHTTPError— error class (previously re-exported from got)Progress— progress interface (previously re-exported from got)BREAKING CHANGE: The default downloader now uses the built-in Fetch API instead of the got package. The
GotDownloaderandGotDownloaderOptionsexports have been removed; useFetchDownloaderandFetchDownloaderOptionsinstead. Download options now acceptRequestInitoptions instead of got options. TheinitializeProxy()function now uses undici'sEnvHttpProxyAgentinstead ofglobal-agent, readingHTTP_PROXY/HTTPS_PROXY/NO_PROXYenvironment variables directly (GLOBAL_AGENT_*prefixed variables are no longer supported).