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

feat: add new anstyle-ratatui crate #234

Closed
wants to merge 1 commit into from
Closed

Conversation

joshka
Copy link

@joshka joshka commented Dec 5, 2024

I wasn't sure what the right approach to creating the changelog for the first commit was, so I haven't done that.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12172863562

Details

  • 0 of 51 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.1%) to 50.746%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/anstyle-ratatui/src/lib.rs 0 51 0.0%
Totals Coverage Status
Change from base Build 12124481823: -1.1%
Covered Lines: 1224
Relevant Lines: 2412

💛 - Coveralls

@joshka
Copy link
Author

joshka commented Dec 5, 2024

Ratatui requires MSRV 1.74 and there's a Zlib licensed dependency in our tree. Thoughts?

@epage
Copy link
Collaborator

epage commented Dec 5, 2024

Ratatui also frequently bumps their major version which will make it annoying to keep up with it.

Looks like you are involved with ratatui. The primary goal of anstyle is to be vocabulary terms for ANSI terminal styling. The adapter crates exist to fill gaps for crates that don't use anstyle natively. How acceptable would it be to switch Color and Style in style out for anstyle? Looks like you have some more specialized functionality on those that would at least require extension traits which can be iffy for APIs.

@joshka
Copy link
Author

joshka commented Dec 5, 2024

Ratatui also frequently bumps their major version which will make it annoying to keep up with it.

A lot of that is that the built-in widgets have new functionality / changes that technically is breaking and that there's a discrepancy between how fast the core types move and how fast the widget types move. We're working on pulling out a ratatui-core crate that addresses this in the next 0.30.0 release (I'd suggest that we perhaps hold off on merging this until that's in place at the very least).

Looks like you are involved with ratatui. The primary goal of anstyle is to be vocabulary terms for ANSI terminal styling. The adapter crates exist to fill gaps for crates that don't use anstyle natively. How acceptable would it be to switch Color and Style in style out for anstyle? Looks like you have some more specialized functionality on those that would at least require extension traits which can be iffy for APIs.

I'm not sure if I'm following the question quite right. As far as using anstyle values as the native style which is passed as a parameter to things which will be styled, I think there's probably enough small differences that that would be a large breaking change.

Alternatively if you're asking "what about putting the conversions inside ratatui instead of as an anstyle- crate". That has some merit. I'd made an assumption that releasing an adapter crate like this was the convention. Nobody has asked for an anstyle crate, I was more adding it for completeness (to allow for conversions from non-ratatui specific types). We could also build that in directly to Ratatui pretty easily behind a feature flag. That would also solve the major version problem.

@epage
Copy link
Collaborator

epage commented Dec 6, 2024

I'm not sure if I'm following the question quite right. As far as using anstyle values as the native style which is passed as a parameter to things which will be styled, I think there's probably enough small differences that that would be a large breaking change.

Was hoping for this and can understand. Its a trade off for what you want to optimize for (current vs future users, maybe)

Alternatively if you're asking "what about putting the conversions inside ratatui instead of as an anstyle- crate". That has some merit. I'd made an assumption that releasing an adapter crate like this was the convention. Nobody has asked for an anstyle crate, I was more adding it for completeness (to allow for conversions from non-ratatui specific types). We could also build that in directly to Ratatui pretty easily behind a feature flag. That would also solve the major version problem.

I made the conversion crates because I wanted to make sure there was good interoperability to make it easy for people to adopt without me trying to coerce maintainers to adopt my crate (especially when it was brand new).

I do not feel the need for the conversions to live here. In fact, having the conversions live in ratatui makes it easier to deal with MSRV, breaking changes, etc.

@joshka
Copy link
Author

joshka commented Dec 6, 2024

I do not feel the need for the conversions to live here. In fact, having the conversions live in ratatui makes it easier to deal with MSRV, breaking changes, etc.

Sounds good - I'll add this there instead.

@joshka joshka closed this Dec 6, 2024
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.

3 participants