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

request is not a dependency, and it is deprecated #3

Open
calvinf opened this issue Mar 16, 2020 · 3 comments
Open

request is not a dependency, and it is deprecated #3

calvinf opened this issue Mar 16, 2020 · 3 comments

Comments

@calvinf
Copy link
Contributor

calvinf commented Mar 16, 2020

Summary
The request module is not marked as a dependency, and it's used in the Fetch module.

Request
Make request a dependency or peerDependency in package.json.

Alternative
Because request is deprecated (as of February 11), an alternative would be to use something like cross-fetch (link) which will allow this module to work with both client-side (browser window.fetch natively or via polyfill) as well as server-side (via node-fetch).

I'm willing to contribute, let me know what approach you'd prefer.

@olawalejarvis
Copy link
Owner

I was trying to avoid using any external dependencies and only decided to use request because it came with nodejs.
That said since request is deprecated, using cross-fetch make sense. Please go ahead and make the change.

@calvinf
Copy link
Contributor Author

calvinf commented Mar 16, 2020

Oh, I assumed this was intentionally using the the npm request module as I don't see any documentation for a generic request module in Node.js. (Maybe you're picking it up transitively in your projects that are using this module?)

cross-fetch seems like best option for universal support (browser and node.js), it's about 7.5KB (pre-gzip). I see references to some other request alternatives when searching around, but cross-fetch is the one I'm most familiar with.

@olawalejarvis
Copy link
Owner

olawalejarvis commented Mar 16, 2020

Maybe you're picking it up transitively in your projects that are using this module?

ahhhhh, that could be the reason 😞 . I thought I read it somewhere. Thanks for catching this

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