Replace XHR requests with `fetch #2004
Replies: 2 comments
-
You have some good points here, IE11 is no longer supported, and the safari might be solved, but in cordova/ionic environment file:// is used so I think xhr is needed (for example loading a style that is on the device). |
Beta Was this translation helpful? Give feedback.
-
I thought more about reurning an object where the request result is wrapped into a Promise, and separately a cancel method.
OK, makes sense. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Found this code in
src/util/ajax.ts
.The comments are fairly interesting in that that I feel like they are not quite relevant anymore.
Is it really still relevant?
The bug was fixed back in 2019
Where does the map send requests with
file://
protocol? Only in dev. mode I believe? Can't they be proxied instead?The main desire to remove XHR requests alltogether is conditioned by the desire to use
fetch
API instead, which uses Promises natively under the hood. And there were ideas to rewrite some major callback-related parts of the code to use Promises instead.So are we OK with moving from XHR to fetch, @HarelM? Not that it's really crucial, but I see it a good point to refactor.
Beta Was this translation helpful? Give feedback.
All reactions