[whatwg/xhr] Expanding the XHR interface to mirror expansions to the fetch interface? (#284)

If a new Web Platform feature is primarily an extension to Fetch (for instance, defining an extension to the API and some corresponding new request handling logic), does it seem in general 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](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/fetch/request_init.idl?q=request_init.idl&sq=package:chromium&g=0&l=1&dlp=chromium&dlf=src/third_party/blink/renderer/core/fetch/request_init.idl&dlc=491a1c39fb7d97c698af068a3ee5e7515fd84f3c&dlr=4&dlgp=third_party/blink/renderer/core/fetch/request_init.idl&dlgr=chromium/chromium/src&drp=chromium&drf=src/third_party/blink/renderer/core/fetch/request_init.idl&drc=fc9c78109a556c467c09e1fcec92fe156fd2a783&drr=5&drgp=third_party/blink/renderer/core/fetch/request_init.idl&drgr=chromium/chromium/src) `RequestInit` to take a new argument specifying a cryptographic operation to execute alongside the request; in its prototype implementation in Chromium, we [add](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.idl?q=xml_http_request.idl&sq=package:chromium&dr&dlp=chromium&dlf=src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.idl&dlc=c2e7d4f0b24814b0d1c51a964db34ec5b4930756&dlr=130&dlgp=third_party/blink/renderer/core/xmlhttprequest/xml_http_request.idl&dlgr=chromium/chromium/src&drp=chromium&drf=src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.idl&drc=c0228a98feda794aae87b52193cc7313bbf16a4a&drr=131&drgp=third_party/blink/renderer/core/xmlhttprequest/xml_http_request.idl&drgr=chromium/chromium/src) 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.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/issues/284

Received on Tuesday, 30 June 2020 05:01:24 UTC