Usage in shared worker - migrate to fetch? #175
Description
Hey,
First of all - thank you for this library. We are running oauth2 PKCE flow in my company and this package was a big time-saver.
I have a question which I stumbled across when trying to use your package in a shared worker.
The default request implementation for browses is based on XMLHttpRequest
js API which, unfortunately, is not available in the shared worker environment. Ofc, I know I can pass a custom request implementation to the constructor (and that's what I'm doing currently), but wouldn't it be actually better to migrate the default browser implementation so it uses fetch
? I think this API is mature enough to be used as a replacement for XMLHttpRequest
. And for IE11 - there are small polyfills avaiable (which work pretty similar to what you've done in request/browser.js
) and users could be encouraged in the README to use them on their side. There is no need to bundle such "polyfill" directly within this library, right?
I saw some of your previous talks about this topic from the past, but since all of them were quite old (5 years ago) I thought it makes sense to raise this topic again. Please give me your insight/comments and, if needed, I'm willing to file the PR adjusting the library accordingly.