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

Re-export reqwest crate #158

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Re-export reqwest crate #158

merged 3 commits into from
Jun 26, 2024

Conversation

mpalmer
Copy link
Contributor

@mpalmer mpalmer commented Jun 7, 2024

In a large project, it's not unheard of for multiple mutually-incompatible versions of a major crate like reqwest to end up in the mix. By re-exporting the version of reqwest used by reqwest-middleware, we can be sure we're referring to the correct reqwest, rather than some other, incompatible, reqwest.

In a large project, it's not unheard of for multiple mutually-incompatible versions of a major crate like `reqwest` to end up in the mix.  By re-exporting the version of `reqwest` used by `reqwest-middleware`, we can be sure we're referring to the *correct* `reqwest`, rather than some other, incompatible, `reqwest`.
@mpalmer mpalmer requested a review from a team as a code owner June 7, 2024 01:35
Copy link
Contributor

@cbeck88 cbeck88 left a comment

Choose a reason for hiding this comment

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

my 2 cents, this is a good idea

sometimes people don't want to re-export dependencies because whatever you export publicly is part of your API. So if you bump your dependency for breaking changes, and you export it publicly, that becomes a breaking change to your API as well, automatically, even though it might otherwise not be.

In this case though, the reqwest-middleware crate already wraps the entire API of reqwest and exports an equivalent API, and it re-exports many of its types already. It seems like any breaking change to reqwest API will necessarily lead to a breaking change happening in this crate too if it keeps API parity. So there seems to be little reason not to re-export reqwest

eopb
eopb previously approved these changes Jun 26, 2024
Copy link
Member

@eopb eopb left a comment

Choose a reason for hiding this comment

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

Thank you for this 👍

I was a little unsure about re-exporting reqwest since I haven't seen this type of re-export very often in the ecosystem. Thank you very much @cbeck88 for leaving your review, it was helpful for me in making a decision.

@eopb eopb enabled auto-merge (squash) June 26, 2024 19:32
@eopb eopb disabled auto-merge June 26, 2024 19:35
@eopb eopb merged commit 524e044 into TrueLayer:main Jun 26, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants