You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cspotcode hello! Thanks for the question, and sorry for the delay.
At the moment, no, but polyfills should Just Work, if that's an option. Do you have a specific need to avoid polyfills right now? I'm curious to know, because it wouldn't be too hard to add this capability to the library if it could be a common use case.
Not a specific need; just a general desire to avoid modifying the global environment to avoid possible incompatibilities with other libraries.
If I require any modifications to the global environment, this means that any libraries I publish will also impose this global mutation on their consumers. It's possible that consumers will use another library that breaks when it encounters this global mutation. I don't have any specific examples, so it's possible that this is extremely rare. But when writing libraries, I try not to make that assumption, since I don't know who will be using the library.
Hello again @cspotcode 👋 heck of a year it's been lol, sorry I never got back to you on this.
I hear you on the globals. Since you posted this, gretchen was refactored into a state that might make this easier. However, it still relies on other globals like Request.
If you've got ideas on how we could implement this we'd love a PR!
On node, is there a way to use dependency injection to provide a
fetch
implementation rather than declaring one globally? Is there a recommended implementation, maybe https://www.npmjs.com/package/isomorphic-fetch or https://www.npmjs.com/package/cross-fetch?Ideally, I'd like to be able to do:
The text was updated successfully, but these errors were encountered: