Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Usage in shared worker - migrate to fetch? #175

Open
FRSgit opened this issue Apr 21, 2021 · 0 comments
Open

Usage in shared worker - migrate to fetch? #175

FRSgit opened this issue Apr 21, 2021 · 0 comments

Comments

@FRSgit
Copy link

FRSgit commented Apr 21, 2021

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.

@FRSgit FRSgit changed the title Usage in service worker - migrate to fetch? Usage in shared worker - migrate to fetch? Dec 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant