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

Usage in shared worker - migrate to fetch? #175

Open
@FRSgit

Description

@FRSgit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions