Skip to content

feat!: replace got with native fetch as default downloader#376

Open
MarshallOfSound wants to merge 1 commit intomainfrom
claude/replace-got-with-fetch-AR2RN
Open

feat!: replace got with native fetch as default downloader#376
MarshallOfSound wants to merge 1 commit intomainfrom
claude/replace-got-with-fetch-AR2RN

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

@MarshallOfSound MarshallOfSound commented Mar 24, 2026

Summary

This is a proposed breaking change to reduce the dependency footprint of @electron/get by replacing the got HTTP client with Node's built-in fetch API.

Motivation

got is a heavyweight dependency with its own transitive dependency tree. Since @electron/get requires Node 22.12+, native fetch is guaranteed to be available and is sufficient for our use case of streaming file downloads.

Dependency changes

Dependency Before After
got ^14.4.5 (dependency) ❌ removed
global-agent ^3.0.0 (optional) ❌ removed
undici ^7.24.4 (optional, proxy support only)

Preserved behavior

  • getProgressCallback receives a Progress object with transferred, total, and percent (same shape as got's progress events)
  • Progress bar appears after 30 seconds (configurable via quiet or ELECTRON_GET_NO_PROGRESS)
  • 404 errors throw HTTPError with message format Response code 404 (Not Found) for ${url}
  • Parent directories are auto-created before download
  • ELECTRON_GET_USE_PROXY still auto-initializes proxy support

New exports

  • FetchDownloader — the new default downloader class
  • FetchDownloaderOptions — options type extending RequestInit
  • HTTPError — 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 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).

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 24, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedundici@​7.24.47210010098100

View full report

@MarshallOfSound MarshallOfSound marked this pull request as ready for review March 29, 2026 20:14
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner March 29, 2026 20:14
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).
@MarshallOfSound MarshallOfSound force-pushed the claude/replace-got-with-fetch-AR2RN branch from 5b5862b to c2e88cf Compare March 29, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants