-
Notifications
You must be signed in to change notification settings - Fork 288
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
Feature request: be a normal package #31
Comments
I've seen before something like the es6-promise module that exposes a |
Yes, please! I won't use this module if it pollutes the global, but having the option would be wonderful. |
I recognise the need for this but my team does not have this need and it would be a backwards incompatible change.
The reason why the I maintain If I were to create a brand new project today I'd probably use the GitHub fetch polyfill on the client side directly (or with the polyfill service) and If someone wanted to fork I don't really want to maintain to different versions of |
Oh nice! |
I had a similar need to the original poster, and I assembled a proof of concept which mashed up the best of Rather than publish a new package right off the bat, I approached @qubyte to see if I could add what I needed to From qubyte/fetch-ponyfill#2 and qubyte/fetch-ponyfill#3:
I'm pleased to say that has all been merged, so you can now use this in Node or the browser: var fetch = require('fetch-ponyfill')(); Or, provide a Promise implementation, to support older browsers and older Node environments: var Promise = require('promise');
var fetch = require('fetch-ponyfill')({ Promise: Promise }); Hopefully you're still up for adding a link to the readme! I'll open a PR. P.S. I did look around for other working solutions before implementing this. There is a package called |
Munging the global state may be true to the spec, but it goes above and beyond how most people develop Javascript. Most front-end and back-end development is done with require() these days, and I think more people will be accustomed to using
var fetch = require('isomoprhic-fetch')
than would be comfortable using a global variable, much less than the number of people who understand what particular incantations you've invoked on behalf of the user to get the global state isomorphically munged like you do.It's absolutely ok to provide a built in helper that munges the global state, adding fetch, but that should be a helper, not the default and only way to use this very fine package.
The text was updated successfully, but these errors were encountered: