As we move towards Vue and adopt Vue components, we are keen to create reusable libraries that can be used outside MediaWiki for rendering Wikimedia-specced Vue components. One implication of this is that we cannot make assumptions about the existence of jQuery and/or the existence of mw.Api if the library is to be used by teams such as analytics.
Cross-checking caniuse [1] with our browser compatibility table [2] fetch is supported with the exceptions of:
- IE11
- Android browser
- iOS 6.1 => 10.3
Note we only support Edge current and latest versions (currently 83 and 84)
I think it's likely a mistake that we support Android browser - the traffic there is low and will hopefully be confirmed by T248907
but iOS 9 accounts for 0.6% of our traffic and IE11 2%.
An optionally loaded polyfill [3] added to MediaWiki core using a skipFunction would support these 2 browsers and allow us to use fetch with a few documented caveats [4] that do not seem like deal-breakers to me. Note we also already have Promise support thanks to T237688.
Thoughts?
[1] https://caniuse.com/#search=fetch
[2] https://www.mediawiki.org/wiki/Compatibility#Modern_(Grade_A)
[3] https://github.com/github/fetch#installation
[4] https://github.github.io/fetch/, https://www.npmjs.com/package/whatwg-fetch