Custom Fetch Enhancements

Created on 26 July 2023, over 1 year ago
Updated 1 November 2023, about 1 year ago

Some raw thoughts from @coby.sher that we can use to refine the scope for 1.0. My assumption is that the POC will provide support for only things that match the signature of fetch.

===

Fetch is still listed as Stability 1 in node v20 but is likely to leave experimental status at some point in the future.
fetch and fetch-compatible libraries return a Response object while (still somewhat popular) libraries like Axios use the XMLHttpRequest constructor which does not return the same Response object.

In the case where we want to make this library compatible with Axios or other libraries that rely on XMLHttpRequest as a custom fetcher, we need to make sure our types work for both. Axios is not useable in DrupalState for this reason so it would be great to get out in front of this.

Axios also handles JSON serialization and some other things like intercepting requests and responses. Can we allow the custom fetcher to handle those things if it has the capability?

Alternatively, we could be opinionated and not support Axios and similar libraries.

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Postponed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brianperry

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024