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

chore: remove usage of prelude #1390

Merged
merged 1 commit into from
Sep 28, 2024
Merged

chore: remove usage of prelude #1390

merged 1 commit into from
Sep 28, 2024

Conversation

joshka
Copy link
Member

@joshka joshka commented Sep 28, 2024

This helps make the doc examples more explicit about what is being used.
It will also makes it a bit easier to do future refactoring of Ratatui,
into several crates, as the ambiguity of where types are coming from
will be reduced.

Additionally, several doc examples have been simplified to use Stylize, and
necessary imports are no longer hidden.

This helps make the doc examples more explicit about what is being used.
It will also makes it a bit easier to do future refactoring of Ratatui,
into several crates, as the ambiguity of where types are coming from
will be reduced.
@joshka joshka requested a review from a team as a code owner September 28, 2024 18:11
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.5%. Comparing base (bc10af5) to head (b0dd25e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1390    /-   ##
=====================================
  Coverage   93.5%   93.5%           
=====================================
  Files         67      67           
  Lines      15897   15897           
=====================================
  Hits       14871   14871           
  Misses      1026    1026           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orhun
Copy link
Member

orhun commented Sep 28, 2024

Does it remove the prelude or the usages? I am preparing a presentation/workshop and I kinda depend on it - and I was thinking of making improvements.

@joshka
Copy link
Member Author

joshka commented Sep 28, 2024

Does it remove the prelude or the usages? I am preparing a presentation/workshop and I kinda depend on it - and I was thinking of making improvements.

Just the usages - the prelude is still there and still documented as being available. This just makes the internal code not use it and the doc comment examples also not use it.

Context: in #1389 I found that having the prelude scattered around made it a bit difficult to properly refactor towards modules without adding another prelude in ratatui-core, and then there being confusion over where the types came from. Documented in #1388

Copy link

github-actions bot commented Sep 28, 2024

🐰 Bencher Report

Branch1390/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
barchart/render/2048📈 view plot
⚠️ NO THRESHOLD
193,160.00
barchart/render/256📈 view plot
⚠️ NO THRESHOLD
130,090.00
barchart/render/64📈 view plot
⚠️ NO THRESHOLD
82,454.00
barchart/render_grouped/2048📈 view plot
⚠️ NO THRESHOLD
339,380.00
barchart/render_grouped/256📈 view plot
⚠️ NO THRESHOLD
136,710.00
barchart/render_grouped/64📈 view plot
⚠️ NO THRESHOLD
125,520.00
barchart/render_horizontal/2048📈 view plot
⚠️ NO THRESHOLD
165,300.00
barchart/render_horizontal/256📈 view plot
⚠️ NO THRESHOLD
82,989.00
barchart/render_horizontal/64📈 view plot
⚠️ NO THRESHOLD
76,639.00
block/render_all_feature/100x50📈 view plot
⚠️ NO THRESHOLD
10,538.00
block/render_all_feature/200x50📈 view plot
⚠️ NO THRESHOLD
18,153.00
block/render_all_feature/256x256📈 view plot
⚠️ NO THRESHOLD
85,764.00
block/render_empty/100x50📈 view plot
⚠️ NO THRESHOLD
5,602.00
block/render_empty/200x50📈 view plot
⚠️ NO THRESHOLD
10,855.00
block/render_empty/256x256📈 view plot
⚠️ NO THRESHOLD
71,314.00
buffer/empty/16📈 view plot
⚠️ NO THRESHOLD
787.98
buffer/empty/255📈 view plot
⚠️ NO THRESHOLD
224,740.00
buffer/empty/64📈 view plot
⚠️ NO THRESHOLD
13,271.00
buffer/filled/16📈 view plot
⚠️ NO THRESHOLD
790.26
buffer/filled/255📈 view plot
⚠️ NO THRESHOLD
224,710.00
buffer/filled/64📈 view plot
⚠️ NO THRESHOLD
13,506.00
buffer/with_lines/16📈 view plot
⚠️ NO THRESHOLD
14,490.00
buffer/with_lines/255📈 view plot
⚠️ NO THRESHOLD
14,344.00
buffer/with_lines/64📈 view plot
⚠️ NO THRESHOLD
16,287.00
line_render/Center/0📈 view plot
⚠️ NO THRESHOLD
3.74
line_render/Center/10📈 view plot
⚠️ NO THRESHOLD
640.14
line_render/Center/3📈 view plot
⚠️ NO THRESHOLD
308.70
line_render/Center/4📈 view plot
⚠️ NO THRESHOLD
351.89
line_render/Center/42📈 view plot
⚠️ NO THRESHOLD
846.24
line_render/Center/6📈 view plot
⚠️ NO THRESHOLD
401.39
line_render/Center/7📈 view plot
⚠️ NO THRESHOLD
456.28
line_render/Left/0📈 view plot
⚠️ NO THRESHOLD
3.73
line_render/Left/10📈 view plot
⚠️ NO THRESHOLD
597.84
line_render/Left/3📈 view plot
⚠️ NO THRESHOLD
229.03
line_render/Left/4📈 view plot
⚠️ NO THRESHOLD
244.29
line_render/Left/42📈 view plot
⚠️ NO THRESHOLD
848.54
line_render/Left/6📈 view plot
⚠️ NO THRESHOLD
389.68
line_render/Left/7📈 view plot
⚠️ NO THRESHOLD
405.79
line_render/Right/0📈 view plot
⚠️ NO THRESHOLD
3.73
line_render/Right/10📈 view plot
⚠️ NO THRESHOLD
575.09
line_render/Right/3📈 view plot
⚠️ NO THRESHOLD
286.93
line_render/Right/4📈 view plot
⚠️ NO THRESHOLD
347.96
line_render/Right/42📈 view plot
⚠️ NO THRESHOLD
848.38
line_render/Right/6📈 view plot
⚠️ NO THRESHOLD
466.48
line_render/Right/7📈 view plot
⚠️ NO THRESHOLD
527.49
list/render/16384📈 view plot
⚠️ NO THRESHOLD
1,222,500.00
list/render/2048📈 view plot
⚠️ NO THRESHOLD
325,160.00
list/render/64📈 view plot
⚠️ NO THRESHOLD
210,290.00
list/render_scroll_half/16384📈 view plot
⚠️ NO THRESHOLD
1,222,000.00
list/render_scroll_half/2048📈 view plot
⚠️ NO THRESHOLD
333,430.00
list/render_scroll_half/64📈 view plot
⚠️ NO THRESHOLD
142,760.00
paragraph/new/2048📈 view plot
⚠️ NO THRESHOLD
257,120.00
paragraph/new/64📈 view plot
⚠️ NO THRESHOLD
6,726.20
paragraph/new/65535📈 view plot
⚠️ NO THRESHOLD
8,221,300.00
paragraph/render/2048📈 view plot
⚠️ NO THRESHOLD
612,340.00
paragraph/render/64📈 view plot
⚠️ NO THRESHOLD
569,300.00
paragraph/render/65535📈 view plot
⚠️ NO THRESHOLD
1,826,200.00
paragraph/render_scroll_full/2048📈 view plot
⚠️ NO THRESHOLD
574,250.00
paragraph/render_scroll_full/64📈 view plot
⚠️ NO THRESHOLD
611,100.00
paragraph/render_scroll_full/65535📈 view plot
⚠️ NO THRESHOLD
1,797,800.00
paragraph/render_scroll_half/2048📈 view plot
⚠️ NO THRESHOLD
572,010.00
paragraph/render_scroll_half/64📈 view plot
⚠️ NO THRESHOLD
616,030.00
paragraph/render_scroll_half/65535📈 view plot
⚠️ NO THRESHOLD
1,799,600.00
paragraph/render_wrap/2048📈 view plot
⚠️ NO THRESHOLD
284,330.00
paragraph/render_wrap/64📈 view plot
⚠️ NO THRESHOLD
256,990.00
paragraph/render_wrap/65535📈 view plot
⚠️ NO THRESHOLD
1,498,100.00
paragraph/render_wrap_scroll_full/2048📈 view plot
⚠️ NO THRESHOLD
284,110.00
paragraph/render_wrap_scroll_full/64📈 view plot
⚠️ NO THRESHOLD
257,260.00
paragraph/render_wrap_scroll_full/65535📈 view plot
⚠️ NO THRESHOLD
1,507,100.00
rect_rows/rows/1024📈 view plot
⚠️ NO THRESHOLD
324.48
rect_rows/rows/16📈 view plot
⚠️ NO THRESHOLD
5.27
rect_rows/rows/65535📈 view plot
⚠️ NO THRESHOLD
20,379.00
sparkline/render/2048📈 view plot
⚠️ NO THRESHOLD
116,110.00
sparkline/render/256📈 view plot
⚠️ NO THRESHOLD
115,670.00
sparkline/render/64📈 view plot
⚠️ NO THRESHOLD
36,962.00
🐰 View full continuous benchmarking report in Bencher

@orhun
Copy link
Member

orhun commented Sep 28, 2024

This removes almost every reference to prelude, so the only way to know about it is to get it suggested by your LSP I guess. It is in the crate docs - but I'm still wondering if we should mention it explicitly somewhere.

@joshka
Copy link
Member Author

joshka commented Sep 28, 2024

image

@joshka joshka merged commit 5ad623c into main Sep 28, 2024
44 checks passed
@joshka joshka deleted the jm/remove-prelude-use branch September 28, 2024 18:47
@orhun
Copy link
Member

orhun commented Sep 29, 2024

fair

joshka added a commit to erak/ratatui that referenced this pull request Oct 14, 2024
This helps make the doc examples more explicit about what is being used.
It will also makes it a bit easier to do future refactoring of Ratatui,
into several crates, as the ambiguity of where types are coming from
will be reduced.

Additionally, several doc examples have been simplified to use Stylize,
and necessary imports are no longer hidden.

This doesn't remove the prelude. Only the internal usages.
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