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

airframe-http (js): Use Fetch API instead of Ajax #2897

Closed
xerial opened this issue Apr 27, 2023 · 2 comments · Fixed by #3370
Closed

airframe-http (js): Use Fetch API instead of Ajax #2897

xerial opened this issue Apr 27, 2023 · 2 comments · Fixed by #3370
Assignees
Milestone

Comments

@xerial
Copy link
Member

xerial commented Apr 27, 2023

dom.ext.Ajax has been deprecated. It's better to use native dom.Fetch API:

Usage:
scala-js/scala-js-dom#627 (comment)

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

@xerial
Copy link
Member Author

xerial commented Feb 13, 2024

WIP #3370 but two compliations

  • Fetch API access works only in Web browsers, so we still need Ajax
  • Node.js has node-fetch, but its API can't be accessed through scalajs-dom at this moment.

Related
https://stackoverflow.com/questions/70380171/ajax-post-dom-fetch/70412242#70412242

@xerial
Copy link
Member Author

xerial commented Feb 13, 2024

As Fetch API in scala-js-dom will not fully replace the XMLHttpRequest in Node.js, Ajax code will remain for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant