lostisland / faraday_middleware

Various Faraday middlewares for Faraday-based API wrappers
MIT License
557 stars 203 forks source link

faraday 2 support #279

Closed dwery closed 2 years ago

dwery commented 2 years ago

faraday_middleware requires faraday 1, and this causes issues on systems that have 2 installed. Would be nice to have a v2 release of this package with proper reshuffling of the middlewares (i.e. json has been integrated in faraday).

iMacTia commented 2 years ago

Hi @dwery, faraday_middleware has been deprecated and will not be updated to support Faraday 2.0. The change was originally described in Faraday's UPGRADING.md, but you got a point that this should be highlighted here as well. I've just updated the README to include the deprecation warning and useful information on how to upgrade.

Which middleware are you using from faraday_middleware that you would need to port into your Faraday v2 project?

dwery commented 2 years ago

IIRC it bailed out on gzip

iMacTia commented 2 years ago

First, I'd like to point out that according to the documentation:

This middleware is NOT necessary when these adapters are used:

  • net_http on Ruby 1.9+
  • net_http_persistent on Ruby 2.0+
  • em_http

I'm not sure which adapter you're using, but I'd be surprised if in 2022 there are still HTTP libraries incapable of managing gzip out-of-the-box 😮. If this is still necessary, would you be open to adopt it and make it a gem using faraday-middleware-template?

dwery commented 2 years ago

Or I could read the docs and find out it's not necessary... sorry for the noise!

iMacTia commented 2 years ago

Please don't be! I'm perfectly aware documentation is not our forte, we can't expect everyone to read code comments 😅.

I'm glad to hear the middleware is not necessary, that means you won't need to wait for it to be gemified 🙌