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

Outdated faraday due to faraday_hal_middleware #129

Closed
espen opened this issue Sep 7, 2017 · 6 comments
Closed

Outdated faraday due to faraday_hal_middleware #129

espen opened this issue Sep 7, 2017 · 6 comments

Comments

@espen
Copy link

espen commented Sep 7, 2017

faraday_hal_middleware is using an old version of Faraday: faraday_middleware', ['>= 0.9', '< 0.10'].

This blocks hyperclient from using the latest version of faraday (currently 0.13.1).

faraday_hal_middleware hasn't been updated for a while but I have submitted a pull request here: fetch/faraday_hal_middleware#1

@ivoanjo
Copy link
Contributor

ivoanjo commented Sep 9, 2017

May I suggest also pinging the author via twitter, for instance? I've had success with that approach in the past.

Otherwise, as faraday_hal_middleware is trivial enough, it may be useful to look at either getting faraday_hal_middleware into faraday_middleware (plan B) or just import it into hyperclient (plan C?) (this change would also be a great chance to change it to use multijson instead of hardcoding the json gem).

@dblock
Copy link
Collaborator

dblock commented Sep 11, 2017

Good idea(s) @ivoanjo. On JSON note that in Grape we got rid of multi_json and are considering it just one of possible JSON adapters. See ruby-grape/grape#1623

@ivoanjo
Copy link
Contributor

ivoanjo commented Sep 12, 2017

Ah, interesting approach. I'm not a huge fan of just picking when the library is required (e.g. if somehow something causes grape to be loaded before multi_json, json decoding performance will suddendly go down a cliff without a lot of warning), and thus I would suggest an additional mechanism that would allow you to specifically pick multi_json (something like Hyperclient.json_decoder = :multi_json; this way if you have this on your app no amount of require reordering will change your configuration).

Just my 0.02c but other than that I agree that some may not want the burden of multi_json on their app ;)

At @Talkdesk we had our own faraday_hal_middleware replacements that used multi_json exactly because we wanted to be able to pick the json back-end (use Oj for MRI Ruby and jrjackson for JRuby), so we ended up passing in default: false and doing our own faraday configuration manually.

@dblock
Copy link
Collaborator

dblock commented Sep 13, 2017

Yes, explicit is better. Grape had to do this because of backwards compatibility.

@dblock
Copy link
Collaborator

dblock commented Jan 5, 2018

I opened fetch/faraday_hal_middleware#3, lets see if we can get some attention first.

@dblock
Copy link
Collaborator

dblock commented Jan 10, 2018

@espen Do you want to finish this one now that faraday_hal_middleware 0.1.0 has been released?

@espen espen closed this as completed Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants