Skip to content

Expanding the XHR interface to mirror expansions to the fetch interface? #284

Open
@davidvancleve

Description

@davidvancleve

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions