-
Notifications
You must be signed in to change notification settings - Fork 260
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
fix(widgets)!: rename StatefulWidgetRef::render_ref
to render_stateful_ref
#1184
base: main
Are you sure you want to change the base?
Conversation
…ul_ref` This commit renames the `StatefulWidgetRef::render_ref` method to `render_stateful_ref`. This helps avoid collisions with the `WidgetRef` trait's `render_ref` method. This change is breaking and requires updating all implementations of `StatefulWidgetRef`. BREAKING CHANGE: `StatefulWidgetRef::render_ref` has been renamed to `StatefulWidgetRef::render_stateful_ref`. ```diff trait StatefulWidgetRef { type State; - fn render_ref(&self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { } + fn render_stateful_ref(&self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { } } ``` Partially addresses <#996>
render_stateful_ref
StatefulWidgetRef::render_ref
to render_stateful_ref
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1184 +/- ##
=====================================
Coverage 94.3% 94.3%
=====================================
Files 60 60
Lines 14679 14679
=====================================
Hits 13843 13843
Misses 836 836 ☔ View full report in Codecov by Sentry. |
I think we could do |
I thought about that a little prior to writing this. The main pro for |
I have a preference for renaming these new trait names (the ones that are unstable) to The disadvantage is that it would break from convention with the And I can see a world where everyone moves to using these new traits, and we deprecate the old ones and remove them eventually (a few years later?). |
Let's move this point to a discussion on the forum. |
https://forum.ratatui.rs/t/naming-render-traits-methods/68 @kdheepak based on the logic in the above forum post are you happy to see this merged as is, or would you prefer to hold for a bit on this. It would be good to get it out in 0.27.0 perhaps. |
Probably off-topic to this PR… why move this to a different place? Personally the forum feels like a place for "how to do this" and "showoffs". Stuff that should end in the code should be discussed as issues next to the code. To the topic of naming the trait / methods… Personally I went to |
I’d like to hold out till we figure out the naming, if that’s okay. Making one breaking change later (v0.28.0?) is better than making one now and potentially again one later. |
It is off-topic for this PR. If you ask about the rationale for this on the forum, I'll answer there... ;P |
This commit renames the
StatefulWidgetRef::render_ref
method torender_stateful_ref
. This helps avoid collisions with theWidgetRef
trait's
render_ref
method. This change is breaking and requiresupdating all implementations of
StatefulWidgetRef
.BREAKING CHANGE:
StatefulWidgetRef::render_ref
has been renamed toStatefulWidgetRef::render_stateful_ref
.Partially addresses #996