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

fix(prelude): remove widgets module from prelude #317

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

joshka
Copy link
Member

@joshka joshka commented Jul 15, 2023

This helps to keep the prelude small and less likely to conflict with
other crates.

  • remove widgets module from prelude as the entire module can be just as
    easily imported with use ratatui::widgets::*;
  • move prelude module into its own file
  • update examples to import widgets module instead of just prelude
  • added several modules to prelude to make it possible to qualify
    imports that collide with other types that have similar names

Note

In the discussion of this on discord, just the canvas was suggested to be removed, however given that it's fairly easy to import widgets::*, it makes sense to drop the entire module from the prelude.

This helps to keep the prelude small and less likely to conflict with
other crates.

- remove widgets module from prelude as the entire module can be just as
  easily imported with `use ratatui::widgets::*;`
- move prelude module into its own file
- update examples to import widgets module instead of just prelude
- added several modules to prelude to make it possible to qualify
  imports that collide with other types that have similar names
@codecov
Copy link

codecov bot commented Jul 15, 2023

Codecov Report

Merging #317 (67cf96b) into main (b347201) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #317   +/-   ##
=======================================
  Coverage   85.00%   85.00%           
=======================================
  Files          38       38           
  Lines        8507     8507           
=======================================
  Hits         7231     7231           
  Misses       1276     1276           
Impacted Files Coverage Δ
src/style.rs 92.74% <ø> (ø)
src/widgets/barchart/bar.rs 100.00% <ø> (ø)
src/widgets/barchart/bar_group.rs 100.00% <ø> (ø)
src/widgets/barchart/mod.rs 89.66% <ø> (ø)

@joshka
Copy link
Member Author

joshka commented Jul 16, 2023

Will wait on a second review on this one rather than merging.

@orhun orhun added this pull request to the merge queue Jul 16, 2023
Merged via the queue into ratatui-org:main with commit 446efae Jul 16, 2023
17 checks passed
a-kenji pushed a commit to a-kenji/ratatui that referenced this pull request Jul 16, 2023
This helps to keep the prelude small and less likely to conflict with
other crates.

- remove widgets module from prelude as the entire module can be just as
  easily imported with `use ratatui::widgets::*;`
- move prelude module into its own file
- update examples to import widgets module instead of just prelude
- added several modules to prelude to make it possible to qualify
  imports that collide with other types that have similar names
@joshka joshka deleted the fix-prelude branch January 13, 2024 23:47
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.

None yet

4 participants