Skip to content

build(deps): narrow tokio's featureset; remove unused tokio-stream#731

Open
a-kenji wants to merge 2 commits intokdheepak:mainfrom
a-kenji:ke-narrow-tokio
Open

build(deps): narrow tokio's featureset; remove unused tokio-stream#731
a-kenji wants to merge 2 commits intokdheepak:mainfrom
a-kenji:ke-narrow-tokio

Conversation

@a-kenji
Copy link
Copy Markdown
Contributor

@a-kenji a-kenji commented Apr 3, 2026

  • build(deps): narrow tokio's feature set
    Not all features are being used, this opts in to these features
    explicitly, meaning the following unused features are not available
    anymore:
    -- fs
    -- io-std
    -- io-util
    -- net
    -- signal
    -- parking_lot
    Alternative: Keep the full feature set. But I think there is value in
    the explicit API surface, especially for such a powerful dependency.
  • build(deps): remove unused tokio-stream
    Remove the unused tokio-stream crate. It either seems to have been
    pulled in by accident, or it has been superseded by the futures crate by
    now.

@kdheepak
Copy link
Copy Markdown
Owner

kdheepak commented Apr 3, 2026

Thank you for the PR! I wanted to do the same thing as crates-tui but haven't gotten the chance to refactor the input handling yet. That seems like a nicer way to do events.

But I'm happy to merge this at the moment and revisit it when I get to that. Thoughts?

@a-kenji
Copy link
Copy Markdown
Contributor Author

a-kenji commented Apr 3, 2026

Oh, thanks for the link. That does seem like a clean API. I have to look further into it. Though I am not sure the feature is really needed here? At least not yet maybe?

Input handling could probably be improved independently of this event handling.

For example if you have separate rendering needs, like throbbers or an actual frame rate this can make sense. But this also comes at a cost. In the example a frame is unconditionally rendered at 15fps this will be a higher resource usage. Rendering directly after a key press is a simple, but really good design - if that is enough for you.

Edit: Ah, I just saw you actually use a tick to query for taskwarrior db changes. Yes that would be a nice API for that.

I personally prefer the dependencies to be used and introduced with the features that actually use them generally.

a-kenji added 2 commits April 3, 2026 13:46
Not all features are being used, this opts in to these features
explicitly, meaning the following unused features are not available
anymore:
- fs
- io-std
- io-util
- net
- signal
- parking_lot

Alternative: Keep the `full` feature set. But I think there is value in
the explicit API surface, especially for such a powerful dependency.
Remove the unused `tokio-stream` crate. It either seems to have been
pulled in by accident, or it has been superseded by the `futures` crate by
now.
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