Skip to content

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

Merged
MarshallOfSound merged 1 commit intomainfrom
claude/replace-got-with-fetch-AR2RN
Apr 22, 2026
Merged

feat!: replace got with native fetch as default downloader#376
MarshallOfSound merged 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.77210010098100

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
@MarshallOfSound MarshallOfSound force-pushed the claude/replace-got-with-fetch-AR2RN branch from 5b5862b to c2e88cf Compare March 29, 2026 20:15
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 c2e88cf to 2399d5c Compare April 19, 2026 10:33
@MarshallOfSound MarshallOfSound merged commit f4d5cfe into main Apr 22, 2026
8 checks passed
@MarshallOfSound MarshallOfSound deleted the claude/replace-got-with-fetch-AR2RN branch April 22, 2026 00:57
@electron-npm-package-publisher
Copy link
Copy Markdown

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants