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

refactor(derive): drop tokio dependency #19

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

fasterthanlime
Copy link
Contributor

The references to 'tokio' in async-dropper-derive are in quoted code, that crate is a proc macro that doesn't need tokio to run (ie. to manipulate token streams).

Leaving it in as a dependency just means tokio would show up twice in the dep graph, built once for async-dropper-derive (as a proc macro dependency and unused), and once as a regular dependency.

Having it as a dependency of async-dropper-derive also doesn't force users of the derive feature to have a dependency on tokio: they can still have compile errors due to the tokio symbol not being found if they don't also depend on tokio in their crate, just like how https://docs.rs/tracing-test/latest/tracing_test/ cannot force your crate to depend on tracing (even though its macro expansion needs it).

@t3hmrman
Copy link
Owner

t3hmrman commented Sep 11, 2024

Hey @fasterthanlime thanks for the recommendation and PR -- greatly enjoy your reading/watching your adventures.

Change looks good to me, would you mind changing your PR comment to match a conventional commit (as we believe in them). Something like:

refactor(derive): drop tokio dependency

The release tooling does pick this up and actually use it :)

[EDIT] Oh BTW if you'd like me to make this change, please click the little "Allow edits by maintainers" checkbox and I will!

@t3hmrman t3hmrman self-requested a review September 11, 2024 05:02
Copy link
Owner

@t3hmrman t3hmrman left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Will merge pending the commit title change/CI passing

@fasterthanlime fasterthanlime changed the title derive: Drop tokio dependency refactor(derive): drop tokio dependency Sep 11, 2024
@fasterthanlime
Copy link
Contributor Author

[EDIT] Oh BTW if you'd like me to make this change, please click the little "Allow edits by maintainers" checkbox and I will!

I haven’t seen this checkbox in a while and… here’s why:

https://github.com/orgs/community/discussions/5634

I’ll stop making contributions from orgs I guess!

@t3hmrman
Copy link
Owner

t3hmrman commented Sep 11, 2024

https://github.com/orgs/community/discussions/5634

TIL

Hey @fasterthanlime actually I should have been clearer -- the commit is actually what matters :)

Something like:

git commit --amend "refactor(derive): drop tokio dependency

(this repo disallows merge commits in general -- only fast-forward merges +/- rebase, so I try to keep the commit history perfectly conventional)

The references to 'tokio' in `async-dropper-derive` are in quoted
code, that crate is a proc macro that doesn't need tokio to run
(ie. to manipulate token streams).

Leaving it in as a dependency just means tokio would show up twice
in the dep graph, built once for `async-dropper-derive` (as a proc
macro dependency and unused), and once as a regular dependency.

Having it as a dependency of `async-dropper-derive` also doesn't
force users of the `derive` feature to have a dependency on tokio:
they can still have compile errors due to the `tokio` symbol not
being found if they don't _also_ depend on tokio in their crate,
just like how <https://docs.rs/tracing-test/latest/tracing_test/>
cannot force your crate to depend on `tracing` (even though its
macro expansion needs it).
@fasterthanlime
Copy link
Contributor Author

the commit is actually what matters :)

Yup yup, am aware, I was just away from a computer x) amending/force-pushing is more than I'm willing to do from a phone. Should be good now! Interestingly the repo settings are so conservative that they need your approval again to run a second time.

@t3hmrman
Copy link
Owner

Ah I think once your contribution goes through you won't have to worry about approvals -- thanks again!

@t3hmrman t3hmrman merged commit 8c7b5a3 into t3hmrman:main Sep 11, 2024
2 checks passed
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