Skip to content

perf!: reduce package size by replacing undici with Node.js built-in proxy support - #436

Merged
theoludwig merged 7 commits into
masterfrom
build/update-latest
Aug 27, 2026
Merged

perf!: reduce package size by replacing undici with Node.js built-in proxy support#436
theoludwig merged 7 commits into
masterfrom
build/update-latest

Conversation

@theoludwig

@theoludwig theoludwig commented Aug 25, 2026

Copy link
Copy Markdown
Member

From 671 Kb to 252 Kb.

Octokit now uses the global fetch directly, proxy support comes from
http.setGlobalProxyFromEnv(process.env) at startup, so undici and
proxy-from-env are no longer bundled and the custom proxiedFetch is
removed. HTTP_PROXY, HTTPS_PROXY and NO_PROXY keep working as before.

Also:

  • update all dependencies
  • update GitHub Actions
  • update usage output in README

BREAKING CHANGE: Node.js >= 24.14.0 is required (previously >= 20.11.0), as
http.setGlobalProxyFromEnv() was introduced in Node.js 24.14.0 and 25.4.0.

…proxy support

From 844 Kb to 253 Kb.

`proxiedFetch` now uses `node:https` with the built-in `proxyEnv` agent option
instead of `undici`'s `ProxyAgent`, so `undici` and `proxy-from-env` are no
longer bundled. `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` keep working as before.

BREAKING CHANGE: Node.js >= 24.5.0 is required (previously >= 20.11.0), as the
`proxyEnv` agent option was introduced in Node.js 24.5.0.
@theoludwig theoludwig changed the title build(deps): update latest perf!: reduce package size by replacing undici with Node.js built-in proxy support Aug 25, 2026
@theoludwig theoludwig linked an issue Aug 25, 2026 that may be closed by this pull request
Octokit now uses the global `fetch` directly, proxy support comes from
`http.setGlobalProxyFromEnv(process.env)` at startup, so the custom
`proxiedFetch` with its redirect handling is no longer needed.

The proxy tests keep the same four scenarios (`http_proxy` set/unset,
matching/mismatching `no_proxy`) but now exercise `setGlobalProxyFromEnv`
with `fetch`. The test proxy runs in a child process because a global
proxy would otherwise route the in-process proxy's own forwarding back
through itself.

BREAKING CHANGE: Node.js >= 24.14.0 is required (previously >= 24.5.0), as
`http.setGlobalProxyFromEnv()` was introduced in Node.js 24.14.0 and 25.4.0.
@theoludwig
theoludwig merged commit 5121b9d into master Aug 27, 2026
5 checks passed
@theoludwig
theoludwig deleted the build/update-latest branch August 27, 2026 02:19
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.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.

[Improvement] Usage of builtin Node.js ProxyAgent from Undici

1 participant