lostisland / faraday_middleware

Various Faraday middlewares for Faraday-based API wrappers
MIT License
556 stars 205 forks source link

add jsonapi request middleware #244

Closed masciugo closed 4 years ago

olleolleolle commented 4 years ago

Thanks for your interest in Faraday Middleware!

This repository is generally not adding new middlewares. You can create a separate gem with this functionality.

Hope this helps – and thanks again!

masciugo commented 4 years ago

what a pity. I hoped this was a growing collection of useful Faraday middleware

thanks but I really remain curious about why. Is the collection of useful middleware so finite?

iMacTia commented 4 years ago

Hey @masciugo, we really are grateful for people like you that are willing to contribute, and we're actually encouraging you and others to keep creating new middleware for Faraday.

However we realised over time of the limitations of aggregating all middleware into the same gem, this include, but are not limited to:

  1. Responsibility of maintaining all the middleware falling on the very small core team after an external contributor commits the first version
  2. Complicated setup for the user that needs to know and add manually the dependencies on their project, since we can't just add them all to the .gemspec file
  3. Complex autoloading to keep the memory footprint small
  4. Conflicting implementations of similar middleware needs to be agreed on and discussed every time

We've thus decided to stop adding middleware to this gem, and instead incentivate users to build their own external gems. Moreover, we'll be also be moving out existing middleware from faraday_middleware into separate gems. As you can imagine, this tackle all the issues above and will greatly improve everyone's life:

  1. Each gem will have its own "owner" that will maintain it and keep it up-to-date
  2. Each gem will manage the right dependencies into it's own .gemspec
  3. Users will be able to "cherry-pick" and add to the gem file only the middleware they need
  4. It will be possible for multiple implementation of the same middleware to exist, in separate gems, and developers will be able to choose the one they prefer

So I hope this clarifies things. We're by no means trying to make everyone's life harder by limiting the amount of middleware. Instead, we're taking the first step towards a much better solution that will actually increase the landscape of available middleware for users.

We'll also create a list of 3rd party middleware for facilitate developers finding what they need, although we haven't decided yet if this list should replace the faraday_middleware repo or instead live in faraday.

If you do create your own gem for the json-api middleware please keep us posted! We'd love for you to be one of the first making it to that list 😃

masciugo commented 4 years ago

thank a lot. I was afraid my question sounded polemical but I really was interested in this project strategy and everything is clear and fair to me now. I'll follow the official directions as soon as they are available. Thanks again