Feature request: be a normal package
See original GitHub issueMunging 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.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to handle feature requests that add new package ...
I am the maintainer of a package on hackage, lrucache. I recently received a feature request for adding instances for Binary and NFData...
Read more >7 Useful Tips to Manage Feature Requests - Craft.io
Feature requests can provide product managers with great ideas for product improvement, but they must be managed correctly. Here are our top tips....
Read more >Feature Requests: What are they and how to manage them
Feature requests are a form of product feedback you may frequently encounter as a SaaS product manager. They typically come in the form...
Read more >10 Tips for Responding Graciously to Customer Feature ...
10 Tips for Responding Graciously to Customer Feature Requests · 1. Be open and honest · 2. Be grateful for their effort ·...
Read more >Feature Requests - ShippingEasy
We would like to assign specific SKUs to a dedicated user to be able to run reports and perform any updates needed for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I recognise the need for this but my team does not have this need and it would be a backwards incompatible change.
isomorphic-fetch
is actually very, very, very small. All it does is merge together node-fetch and GitHub’s Fetch polyfill so that the former is pulled in when you runrequire('isomorphic-fetch')
on the server, and the latter on the client.isomorphic-fetch
is mostly config, there’s barely any code at all.The reason why the
isomorphic-fetch
library exists is because in the pastnode-fetch
didn’t exist and this module used to provide the server side implementation. Now thatnode-fetch
does exist, this module more or less blindly passesnode-fetch
through if yourequire('isomorphic-fetch')
on the server.I maintain
isomorphic-fetch
largely for backwards compatibility for old projects.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
node-fetch
directly in Node.If someone wanted to fork
isomorphic-fetch
and got rid of the defining-itself-globally behaviour I would gladly link to that in theREADME.md
of this module. I’d suggest calling itsafe-isomorphic-fetch
or perhapsuniversal-fetch
.I don’t really want to maintain to different versions of
isomorphic-fetch
so for this issue I will say no. Sorry.I had a similar need to the original poster, and I assembled a proof of concept which mashed up the best of
isomorphic-fetch
andfetch-ponyfill
. I got great results in Browserify, Webpack, and Node.Rather than publish a new package right off the bat, I approached @qubyte to see if I could add what I needed to
fetch-ponyfill
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:
Or, provide a Promise implementation, to support older browsers and older Node environments:
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
universal-fetch
, but it’s a fork of this repo that supports IE8, and still a polyfill. And, by the way, thanks for the clear “wontfix” in this thread!