Further internal resource loader cleanup
Author: domenicCreated Feb 2, 2026Updated Sep 17, 2026
After #4033, we should consider the following cleanup items:
- Blocked on Undici
- Remove usage of
WrapHandler: https://github.com/nodejs/undici/pull/4786, https://github.com/nodejs/undici/pull/4785, and https://github.com/nodejs/undici/pull/4787 will likely help. - Move to
request()instead ofdispatch()inxhr-utils.js: blocked on https://github.com/nodejs/undici/issues/4797, although https://github.com/nodejs/undici/pull/4786 might be the better fix. - Remove workaround for bad
WebSocketstate transitions and events: https://github.com/nodejs/undici/issues/4742, https://github.com/nodejs/undici/issues/4741 - Keep an eye on a fix for multiple
WebSocketconnections to the same host: https://github.com/nodejs/undici/issues/4743 - Wait for
DecompressInterceptorto be made public to get rid of our own copy ofdecompress-interceptor.jsin the source tree.
- Remove usage of
- Rewrite and greatly simplify
per-document-resource-loader.js,request-manager.js, and probablyresource-queue.js/async-resource-queue.js. UseAbortControllers to shut down all requests on jsdom teardown. Make elements fire their own events. Etc.: https://github.com/jsdom/jsdom/pull/4324
Source: jsdom/jsdom