scala-js/scala-js-dom

`XMLHttpRequest` and friends shouldn't be deprecated

japgolly opened this issue · 4 comments

XMLHttpRequest and AjaxException are deprecated in scalajs-dom but not irl.

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

The deprecation message is to use the Fetch API instead. Yes Fetch is the better replacement for the old AJAX API, but the old AJAX API isn't deprecated. People with old code that use it do not at all need to migrate away from it, it's fine, just old.

I mostly agree, I think another interpretation of this deprecation could be "we no longer maintain this facade" but given that we now facade anything experimental or poorly supported that just seems too arbitrary. We can undeprecate it 👍

Yeah, imo this library should be an unopinionated reflection of the dom world. If an API isn't deprecated by browsers, I don't think we should be deprecating it ourselves.

I think it is fair to deprecate Ajax, since that is our own facade, and Fetch is a better API that is natively supported.