Coder Social home page Coder Social logo

support faraday 2.0? about dropbox_api HOT 5 CLOSED

jesus avatar jesus commented on May 27, 2024
support faraday 2.0?

from dropbox_api.

Comments (5)

Jesus avatar Jesus commented on May 27, 2024 1

Definitely this would be great. My plan is to eventually drop the dependency on Faraday and use net/http instead, but I won't have bandwidth to do that in the mid-term.

from dropbox_api.

berkes avatar berkes commented on May 27, 2024

I'd like to add an alternative: not depend on any HTTP client, but leave that to the implementor.

For me, gems that depend on specific (versions of) HTTP clients, is very unfortunate:

  • It pulls in a lot of dependencies that I have no control over (Faraday depends on 4+ other gems)
  • It conflicts with other versions.
  • It makes debugging and maintainance a hell if we thus get several different gems.

My use-case is not the most common but not that unusual either:

We have a storage layer that offer people to store files on their preferred platform: S3, GoogleDrive, Dropbox, FTP etc. We integrate many cloud APIs.

Many of the gems for these platforms come with their own (version of) HTTP clients. For example, I now have to maintain a dependency tree with net/http, faraday, excon, typhous, and httparty. We had to forego a (rather crappy) GoogleDrive/GC, gem because it required a faraday version incompatible with this gem here.

Alternatives, I would love to see considered are:

  • A generic adapter-like setup. E.g. https://www.ruby-toolbox.com/projects/httpi offers a generic layer over all popular HTTP clients: the implementor can inject their preferred libs.
  • Rely on net/http only. Ruby STDlib http client is cumbersome, but it is available and consistent to all without conflicting. E.g. AWS::S3 uses this method.

Sorry for the long winded post. Hopefully this is something worth considering. If so, I can probably find some time to code this, though not on short notice.

And, in case I come over as critical: not at all: I love this great Gem!

from dropbox_api.

jrochkind avatar jrochkind commented on May 27, 2024

@berkes Faraday already is a generic layer over other HTTP clients. Certainly switching to a different one is one option.

Either way, I'll need some solution, or will perhaps fork the gem.

from dropbox_api.

jrochkind avatar jrochkind commented on May 27, 2024

Thanks for comment @Jesus ! If someone can find time to make a PR expanding Faraday support to allow 1.0-2.0, would you be able to find time to review/merge/release?

from dropbox_api.

jrochkind avatar jrochkind commented on May 27, 2024

Wait a second, I see it's already been done!

spec.add_dependency 'faraday', '< 3.0'

eaa9e36

And 0.1.21 released allowing Faraday 2.x.

Thanks @Jesus!

I am closing this issue, it is resolved!

from dropbox_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.