However this would break a lot in our code, since it is a great isomorphic abstraction to HTTP calls and I managed to replace request with node-fetch on the server and kept the client code as it is.
nice work! since Meteor offers isomorphic fetch couldn’t you use the same code that you have for the server in your package more or less and use Meteor’s fetch to provide an http package compat. layer?
@jkuester thanks so much for doing this. I spent about 4 hours yesterday trying to convert some of my REST calls to use fetch, and I was completely buried in all of the encoding issues, and trying to get the URL parameters and body in shape. In particular, Twilio was driving me crazy.
I just replaced all of that with your HTTP and it is working perfectly. Thanks again
Just updated to 2.0. Got the deprecation warning in my logs. From my packages, the following are dependent on HTTP:
facebook-oauth
mdg:meteor-apm-agent
mizzao:timesync
@jkuester am I right in thinking that under normal circumstances, if I use your HTTP package those aforementioned packages automatically default to it?
am I right in thinking that under normal circumstances, if I use your HTTP package those aforementioned packages automatically default to it?
Unfortunately not, because HTTP is not a global export and thus the accounts- packages will use the deprecated version (using request). This is why I’d like to discuss this topic. We have several options:
update accounts (and other core packages) to use fetch
update http to use the fetch (via merging jkuester:http into http)
keep accounts packages use the (updated/merged) http until they have been migrated
I think we should do a major version upgrade to http where we merge your package in. In the meantime upgrading as much as possible in Meteor core to fetch would be great.
Ughh that would drive me crazy! I’m not aware of any measure to turn off such warnings; last resort could be to clone the package locally, then add it to your project and fix the code that’s causing the deprecation warning.
I’m a little surprised HTTP has been deprecated and not patched, given how widely used it is in the meteor ecosystem. I guess a patch would be difficult though given that it semi-officially exposes the internal request instance on the server.