Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XHR] Replace XMLHttpRequest with fetch() in Web/API #30131

Closed
34 tasks done
wbamberg opened this issue Nov 8, 2023 · 3 comments
Closed
34 tasks done

[XHR] Replace XMLHttpRequest with fetch() in Web/API #30131

wbamberg opened this issue Nov 8, 2023 · 3 comments
Labels
Content:WebAPI Web API docs

Comments

@wbamberg
Copy link
Collaborator

wbamberg commented Nov 8, 2023

Part of openwebdocs/project#156.

This issue is to track replacement of XHR in code examples with fetch().

I've just searched for XMLHttpRequest and got hits in the following subtrees of Web/API, excluding things which are obviously part of the XHR documentation itself:

I've deliberately not tried very hard to look for false positives at this point, so there are definitely going to be some in there.

@github-actions github-actions bot added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. Content:WebAPI Web API docs labels Nov 8, 2023
This was referenced Nov 8, 2023
@wbamberg
Copy link
Collaborator Author

wbamberg commented Nov 9, 2023

I think the example at https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications#handling_the_upload_process_for_a_file should stay XHR, because it wants to show upload progress, and AFAIK, XHR is still the best way to do this (though there is work to support it in fetch() (whatwg/fetch#607). Opinions @teoli2003 ?

@teoli2003
Copy link
Member

Yes, it makes sense: Once browsers will provide such a feature with fetch() we will update this entry; meanwhile we should keep it.

Maybe add an explicit sentence saying the Fetch API doesn't allow for this use case?

@wbamberg
Copy link
Collaborator Author

This is done! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

No branches or pull requests

3 participants