refactor: replace got with native fetch API#4189
Merged
MarshallOfSound merged 1 commit intonextfrom Mar 24, 2026
Merged
Conversation
Replace the got HTTP client with native fetch in the zip maker for fetching RELEASES.json manifests. Native fetch has been stable in Node.js since v18 and the package already requires Node >= 22.12.0. Also remove the unused got dependency from @electron-forge/core.
erickzhao
approved these changes
Mar 24, 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.
Summarize your changes:
This PR removes the
gotHTTP client library dependency and replaces it with the nativefetchAPI, which is now available in Node.js. This reduces external dependencies and simplifies the codebase.Changes:
gotdependency from@electron-forge/maker-zipand@electron-forge/corepackagesMakerZIP.tsto use nativefetch()instead ofgot.get()for HTTP requests to the macOS update manifest URLResponseobject properties (status,json()) instead ofgot's response format (statusCode,body)MakerZip.spec.tsto stub the globalfetchfunction usingvi.stubGlobal()instead of mocking thegotmodulemockFetchcalls instead ofgot.getcallsThe functionality remains identical - the code still fetches the RELEASES.json manifest from the configured URL and handles both successful (200) and not-found (404) responses appropriately.
https://claude.ai/code/session_01BYVpGL3mf7JBUZSnABvRR3