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

Prepare this adapter for Faraday 2.0 #7

Merged
merged 1 commit into from
Nov 1, 2021

Conversation

mattbrictson
Copy link
Contributor

In Faraday 2.0, adapters will be completely opt-in. As a consequence, this adapter can now have a hard dependency on net_http_persistent. If a user has opted into adding this adapter to their Gemfile, we know they will be using it.

Thus this PR can make the following changes:

  1. Remove the dependency "net/http/persistent" declaration. This existed to support loading dependencies on demand, based on what adapter is being used. Since adapters are now explicitly opt-in, this is no longer needed.
  2. Add faraday-net_http as an explicit dependency. The faraday-net_http_persistent adapter subclasses the net_http one. Previously the net_http adapter was part of Faraday core. As of 2.0 it is packaged as a separate gem, so we need to declare it as a dependency.
  3. Change the installation instructions. All a user needs to do now is install faraday-net_http_persistent. All other dependencies will be included automatically.

In Faraday 2.0, adapters will be completely opt-in. As a consequence,
this adapter can now have a hard dependency on `net_http_persistent`.
If a user has opted into adding this adapter to their Gemfile, we know
they will be using it.

Thus this PR can make the following changes:

1. Remove the `dependency "net/http/persistent"` declaration. This
   existed to support loading dependencies on demand, based on what
   adapter is being used. Since adapters are now explicitly opt-in, this
   is no longer needed.
2. Add `faraday-net_http` as an explicit dependency. The
   `faraday-net_http_persistent` adapter subclasses the net_http
   one. Previously the net_http adapter was part of Faraday core. As of
   2.0 it is packaged as a separate gem, so we need to declare it as a
   dependency.
3. Change the installation instructions. All a user needs to do now is
   install `faraday-net_http_persistent`. All other dependencies will be
   included automatically.
Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and complete! Let's get this merged!

@olleolleolle olleolleolle merged commit f2f24c3 into lostisland:main Nov 1, 2021
@mattbrictson mattbrictson deleted the prepare-for-2.0 branch November 1, 2021 19:07
@mattbrictson
Copy link
Contributor Author

Thanks! I left off these things out of this PR because they aren't strictly related to Faraday 2.0 compatibility:

  • Dropping Ruby 2.5
  • Dropping net-http-persistent 3.x
  • Moving development dependencies to the Gemfile
  • Fixing the changelog URI

But I think those are worthwhile improvements and we should cherry-pick those from #8. As a follow-up PR.

@olleolleolle
Copy link
Member

@mattbrictson I began taking some of these steps, so watch this space.

@olleolleolle
Copy link
Member

#11
#10
#9

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

Successfully merging this pull request may close these issues.

2 participants