-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make module available without polyfill #46
Comments
You might want to checkout This library is just going to be a standard polyfill implementation.
|
That module just does the same as this one, but works in Node too. i.e. the behaviour in the browser is identical. One last try to convince... doing this will allow your users to protect themselves from differences in implementation and changes in spec as browsers evolve. Else, I can close (or please feel free to). |
This is what I'm using at the moment. Seriously ugly, but has the behaviour I want: https://gist.github.com/qubyte/21cade5e28c924c48bc1 |
+1 |
I put that gist into a library. It has one potential showstopping problem though... It means that the |
@qubyte you can specify transforms on a per-package basis (e.g. in your fetch-ponyfill package.json) to avoid the global-ness. |
@domenic Wow. I really should have realised that. Thanks for the tip! |
It would be nice to be able to require
fetch
without it being appended towindow
in a similar way to thees6-promise
polyfill. Iffetch
can be assigned to a variable, then this means that when a broken or otherwise incompatible version of the fetch API become available in a browser, code that usesfetch
won't break.In other words:
I realise however that this breaks the existing API.
The text was updated successfully, but these errors were encountered: