feat!: replace got with native fetch as default downloader#376
Draft
MarshallOfSound wants to merge 4 commits intomainfrom
Draft
feat!: replace got with native fetch as default downloader#376MarshallOfSound wants to merge 4 commits intomainfrom
MarshallOfSound wants to merge 4 commits intomainfrom
Conversation
BREAKING CHANGE: The default downloader now uses the built-in Fetch API instead of the got package. The GotDownloader and GotDownloaderOptions exports are deprecated aliases for the new FetchDownloader and FetchDownloaderOptions. 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.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
BlackHole1
approved these changes
Mar 25, 2026
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)Breaking changes
GotDownloader→FetchDownloader: The default downloader class has been renamed. The oldGotDownloaderexport has been removed.GotDownloaderOptions→FetchDownloaderOptions: Download options now extendRequestInitinstead of got'sOptions. ThegetProgressCallbackandquietoptions are preserved.initializeProxy(): Now uses undici'sEnvHttpProxyAgentinstead ofglobal-agent. ReadsHTTP_PROXY/HTTPS_PROXY/NO_PROXYdirectly (theGLOBAL_AGENT_*prefixed variables are no longer supported).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)