Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not use node-fetch, let user polyfill it #17

Open
2 of 9 tasks
sibelius opened this issue May 17, 2019 · 3 comments
Open
2 of 9 tasks

do not use node-fetch, let user polyfill it #17

sibelius opened this issue May 17, 2019 · 3 comments

Comments

@sibelius
Copy link

I'm submitting this issue for the package(s):

I'm submitting a:

  • Bug report
  • Feature request
  • Other (Describe below)

Current behavior

It uses node-fetch

Expected behavior

It should let user polyfill fetch instead

Minimal reproduction of the problem with instructions

remove node-fetch, and add docs saying that user should polyfill it

using isomorphic-fetch sounds a good option

Extra information about the use case/user story you are trying to implement

Environment

  • Package Version: 2.0.0
  • Browser:
  • OS: mac
  • Node version (node -v): 10
  • Other:
@swiftone
Copy link

Thanks for the comment @sibelius - Can you give us some more detail on your use case?

We want to minimize the effort of users of this package. isomorphic-fetch wasn't used for three reasons:

  • The last update to isomorphic-fetch was 3 years ago, and most of the code is untouched for 4 years. That not necessarily bad, but the list of issues is growing and the JS environment has evolved quite a bit in that time.
  • oidc-middleware is explicitly backend - there are no frontend calls, so the explicit goal of isomorphic-fetch (isomorphic) was outside our scope.
  • isomorphic-fetch implements a global, and we want to minimize the impact on user environments (and vice-versa).

Can you share a bit of info about

  • Why node-fetch causes you problems
  • Why isomorphic-fetch is better?

Thanks in advance - hopefully we can figure out how best to address any issues you are experiencing.

@sibelius
Copy link
Author

it is recommend to let user code provide the polyfill not every package/library

so the bundle can be small if you are doing serveless

@swiftone
Copy link

Sorry, @sibelius, I'm not quite following your point here and need some clarification.

it is recommend to let user code provide the polyfill not every package/library

node-fetch isn't a polyfill - it's a server-side library that doesn't polyfill anything, server-side or browser-side.

so the bundle can be small if you are doing serveless

I'm used to 'bundle' referring to what is being sent to a browser user on page load. oidc-middleware isn't sent to the browser user at all, it runs the server, and thus node-fetch shouldn't be sent to a browser user at all. Are you using 'bundle' to mean something different?

@denysoblohin-okta denysoblohin-okta transferred this issue from okta/okta-oidc-js Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants