Skip to content

Update to undici@7. - #58

Merged
davidlehn merged 1 commit into
remove-cjs-supportfrom
update-undici
Aug 11, 2026
Merged

Update to undici@7.#58
davidlehn merged 1 commit into
remove-cjs-supportfrom
update-undici

Conversation

@davidlehn

Copy link
Copy Markdown
Member

Claude ran matrix tests on this. I guided it to leave in the fallback code since it's likely to be needed again. We could alternatively drop that for now and add back later. Also going straight to undici@8 could be done if there are performance or other reasons to do so, but that will always hit fallbacks for current LTS node@24 at the moment.

Robot commit message:

Aligns the installed undici with the one built into the current Node.js LTS release, per the policy of optimizing for current LTS.

undici 7 is the transition release between the old (v6 onError) and new (v8 onRequestStart) dispatcher handler dialects, shipping both wrap-handler and unwrap-handler to translate in either direction. A v7 dispatcher is therefore usable by the fetch built into Node.js 22, 24, and 26 alike, so the legacy agent/httpsAgent options now use the platform fetch on every supported release and responses are platform Response instances again.

Replace the strict installed-equals-platform major check with an explicit table of the platform majors each installed major can drive. An installed major with no entry falls back to requiring an exact match, so a missing or stale entry costs only the fallback path rather than correctness.

The fallback is kept rather than removed: a future undici bump is expected to need it again, since a v8 dispatcher cannot be driven by the v7 fetch in Node.js 24.

Aligns the installed undici with the one built into the current Node.js LTS
release, per the policy of optimizing for current LTS.

undici 7 is the transition release between the old (v6 `onError`) and new
(v8 `onRequestStart`) dispatcher handler dialects, shipping both
`wrap-handler` and `unwrap-handler` to translate in either direction. A v7
dispatcher is therefore usable by the `fetch` built into Node.js 22, 24, and
26 alike, so the legacy `agent`/`httpsAgent` options now use the platform
`fetch` on every supported release and responses are platform `Response`
instances again.

Replace the strict installed-equals-platform major check with an explicit
table of the platform majors each installed major can drive. An installed
major with no entry falls back to requiring an exact match, so a missing or
stale entry costs only the fallback path rather than correctness.

The fallback is kept rather than removed: a future undici bump is expected
to need it again, since a v8 dispatcher cannot be driven by the v7 `fetch`
in Node.js 24.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@davidlehn
davidlehn requested a review from dlongley August 11, 2026 02:18
@davidlehn
davidlehn merged commit 08cde11 into remove-cjs-support Aug 11, 2026
6 checks passed
@davidlehn
davidlehn deleted the update-undici branch August 11, 2026 23:57
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.

2 participants