Description
My understanding is that it's generally discouraged to add flashy new features to XHR. (I don't have a ton of domain expertise, so please let me know if this premise is wrong.)
I have a question about a special case. If a new Web Platform feature is primarily an extension to Fetch (for instance, defining an addtion to the interface and some corresponding new request handling logic), does it seem like it might be reasonable to mirror the fetch API changes (e.g. expanding RequestInit
) with corresponding XHR changes? The motivation would be that there are some people who, for whatever reason, can't use the fetch
API but can use XHR; this would allow them to make use of the new Fetch-first Web Platform feature.
(The specific example I have in mind is the Trust Token API, which expands RequestInit
to take a new argument specifying a cryptographic operation to execute alongside the request; in its prototype implementation in Chromium, we add a corresponding new setter to XMLHttpRequest
so clients can access the same functionality via XHR. @jeremyroman, who was reviewing my XHR change, suggested I drop by and ask whether there are any issues with this approach.)