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

Performance Optimizations #760

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
185c276
Bugfix for charts larger than most;
Lucasharskamp May 29, 2024
21d914b
Coding rework for readability, performance and preventing bugs.
Lucasharskamp Jun 3, 2024
cf9d2c2
Added extra readonly checks
Lucasharskamp Jun 3, 2024
b820e00
Added Bootstrap CSS generator (v0.1)
Lucasharskamp Jun 4, 2024
3da54cf
Added a ton more coloring options
Lucasharskamp Jun 6, 2024
f892ae3
CSS generator finalized (V1)
Lucasharskamp Jun 10, 2024
508cef7
Merge commit
Lucasharskamp Jun 10, 2024
f5e2083
fixes for merge commit
Lucasharskamp Jun 10, 2024
9d90d73
Added performance optimizations
Lucasharskamp Jun 12, 2024
a780fd5
Parameters are now being set asynchronously for all components, excep…
Lucasharskamp Jun 17, 2024
533b181
1) Merge commit
Lucasharskamp Jun 17, 2024
3aa3261
Removed obsolete code
Lucasharskamp Jun 17, 2024
70027c7
Added Button disabled color/bg color/border color/opacity settings si…
Lucasharskamp Jun 19, 2024
5064c08
added xml documentation
Lucasharskamp Jun 20, 2024
2f7df44
Bugfix (wrong color assignment in generator)
Lucasharskamp Jun 24, 2024
ba59bbf
Chartdataset is now set to double? to allow for gaps in the data (to …
Lucasharskamp Jul 5, 2024
bee5785
Merge commit.
Lucasharskamp Jul 5, 2024
43c37cf
Fixed demo issues
Lucasharskamp Jul 5, 2024
b9bcb06
1) Fixes for Grid filters not being applied, since they were being se…
Lucasharskamp Jul 9, 2024
8f78362
Merge commit
Lucasharskamp Jul 19, 2024
6941030
Fixed bug in ribbonitems
Lucasharskamp Aug 1, 2024
3d9aa78
Improvements to generator
Lucasharskamp Aug 6, 2024
21319d4
Grid column update
Lucasharskamp Sep 13, 2024
36331c8
Updated code to 3.0
Lucasharskamp Sep 13, 2024
dbbdb37
Icon lookup converted to a dictionary for sake of performance
Lucasharskamp Dec 6, 2024
25208e8
Merged with the current branch
Lucasharskamp Dec 6, 2024
ab28b35
(not finished) Reworked components to remove useless checks, bloats, …
Lucasharskamp Dec 10, 2024
5267d6b
Few bugfixes, 1 I accidentally made in the refactor (Icon classes)
Lucasharskamp Dec 11, 2024
2d09e08
Removed JSRuntime from elements unless they need them
Lucasharskamp Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions BlazorBootstrap.Demo.RCL/Components/Layout/EmptyLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@
<hr class="d-lg-none text-white-50">
<ul class="navbar-nav flex-row flex-wrap bd-navbar-nav">
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="/getting-started/blazor-webassembly">Demos</a></li>
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="@docsUrl" target="_blank" rel="noopener">Docs</a></li>
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="@blogUrl" target="_blank" rel="noopener">Blog</a></li>
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="@githubUrl" target="_blank" rel="noopener">GitHub</a></li>
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="@DocsUrl" target="_blank" rel="noopener">Docs</a></li>
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="@BlogUrl" target="_blank" rel="noopener">Blog</a></li>
<li class="nav-item col-6 col-lg-auto"><a class="nav-link py-2 px-0 px-lg-2" href="@GithubUrl" target="_blank" rel="noopener">GitHub</a></li>
</ul>

<hr class="d-lg-none text-white-50">

<ul class="navbar-nav flex-row flex-wrap ms-md-auto">
<li class="nav-item col-6 col-lg-auto">
<a class="nav-link py-2 px-0 px-lg-2" href="@githubUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-0 px-lg-2" href="@GithubUrl" target="_blank" rel="noopener">
<i class="bi bi-github"></i>
<small class="d-lg-none ms-2">GitHub</small>
</a>
</li>
<li class="nav-item col-6 col-lg-auto">
<a class="nav-link py-2 px-0 px-lg-2" href="@twitterUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-0 px-lg-2" href="@TwitterUrl" target="_blank" rel="noopener">
<i class="bi bi-twitter-x"></i>
<small class="d-lg-none ms-2">Twitter</small>
</a>
</li>
<li class="nav-item col-6 col-lg-auto">
<a class="nav-link py-2 px-0 px-lg-2" href="@linkedInUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-0 px-lg-2" href="@LinkedInUrl" target="_blank" rel="noopener">
<i class="bi bi-linkedin"></i>
<small class="d-lg-none ms-2">LinkedIn</small>
</a>
</li>
<li class="nav-item col-6 col-lg-auto">
<a class="nav-link py-2 px-0 px-lg-2" href="@openCollectiveUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-0 px-lg-2" href="@OpenCollectiveUrl" target="_blank" rel="noopener">
<i class="bi bi-opencollective"></i>
<small class="d-lg-none ms-2">Open Collective</small>
</a>
Expand Down
13 changes: 5 additions & 8 deletions BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
<BlazorBootstrapLayout StickyHeader="true">
<HeaderSection>
<div>
<a class="nav-link py-2 px-2" href="@githubUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-2" href="@GithubUrl" target="_blank" rel="noopener">
<i class="bi bi-github"></i>
</a>
</div>
<div>
<a class="nav-link py-2 px-2" href="@twitterUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-2" href="@TwitterUrl" target="_blank" rel="noopener">
<i class="bi bi-twitter-x"></i>
</a>
</div>
<div>
<a class="nav-link py-2 px-2" href="@linkedInUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-2" href="@LinkedInUrl" target="_blank" rel="noopener">
<i class="bi bi-linkedin"></i>
</a>
</div>
<div>
<a class="nav-link py-2 px-2 pe-3" href="@openCollectiveUrl" target="_blank" rel="noopener">
<a class="nav-link py-2 px-2 pe-3" href="@OpenCollectiveUrl" target="_blank" rel="noopener">
<i class="bi bi-opencollective"></i>
</a>
</div>
Expand Down Expand Up @@ -64,10 +64,7 @@
<li class="mb-2">Designed and built with all the love in the world by the <strong><a href="https://www.nuget.org/packages/Blazor.Bootstrap">Blazor Bootstrap</a></strong> team with the help of our contributors.</li>
<li class="mb-2">Code licensed <a href="https://github.com/vikramlearning/blazorbootstrap/blob/main/LICENSE.txt" target="_blank" rel="license noopener">Apache License 2.0</a>.</li>
<li class="mb-2">Currently @Version.</li>
@if (!string.IsNullOrWhiteSpace(DotNetVersion))
{
<li class="mb-2">Powered by @DotNetVersion</li>
}
<li class="mb-2">Powered by @DotNetVersion</li>
</ul>
</div>
<div class="col-6 col-lg-2 offset-lg-1 mb-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

public partial class MainLayout : MainLayoutBase
{
internal override IEnumerable<NavItem> GetNavItems()
internal override IReadOnlyCollection<NavItem> GetNavItems()
{
navItems ??= new List<NavItem>
NavItems ??= new List<NavItem>
{
new (){ Id = "1", Text = "Getting Started", Href = "/getting-started", IconName = IconName.HouseDoorFill },

Expand All @@ -15,6 +15,7 @@ internal override IEnumerable<NavItem> GetNavItems()
new (){ Id = "3", Text = "Content", IconName = IconName.BodyText, IconColor = IconColor.Primary },
new (){ Id = "300", Text = "Icons", Href = "/icons", IconName = IconName.PersonSquare, ParentId = "3" },
new (){ Id = "301", Text = "Images", Href = "/images", IconName = IconName.Image, ParentId = "3" },
new (){ Id = "302", Text = "CSS Generator", Href = "/customcss", IconName = IconName.WrenchAdjustableCircle, ParentId = "3" },

new (){ Id = "4", Text = "Forms", IconName = IconName.InputCursorText, IconColor = IconColor.Success },
new (){ Id = "400", Text = "Auto Complete", Href = "/form/autocomplete", IconName = IconName.InputCursorText, ParentId = "4" },
Expand Down Expand Up @@ -97,7 +98,7 @@ internal override IEnumerable<NavItem> GetNavItems()
new (){ Id = "1900", Text = "Color Utility", Href = "/utils/color-utility", IconName = IconName.Palette2, ParentId = "19" },
};

return navItems;
return NavItems;
}

private async ValueTask OnThemeChanged(string themeName)
Expand Down
81 changes: 38 additions & 43 deletions BlazorBootstrap.Demo.RCL/Components/Layout/MainLayoutBase.cs
Original file line number Diff line number Diff line change
@@ -1,61 +1,56 @@
namespace BlazorBootstrap.Demo.RCL;
using System.Runtime.InteropServices;

namespace BlazorBootstrap.Demo.RCL;

public class MainLayoutBase : LayoutComponentBase
{
internal string version = default!;
internal string dotNetVersion = default!;
internal string docsUrl = default!;
internal string blogUrl = default!;
internal string githubUrl = default!;
internal string twitterUrl = default!;
internal string linkedInUrl = default!;
internal string openCollectiveUrl = default!;
internal string githubIssuesUrl = default!;
internal string githubDiscussionsUrl = default!;
internal string stackoverflowUrl = default!;

internal Sidebar2 sidebar2 = default!;
internal IEnumerable<NavItem> navItems = default!;
internal IReadOnlyCollection<NavItem>? NavItems;

[Inject] public IConfiguration Configuration { get; set; } = default!;

[Inject] protected IJSRuntime JS { get; set; } = default!;

protected override void OnInitialized()
{
version = $"v{Configuration["version"]}"; // example: v0.6.1
dotNetVersion = $".NET {Configuration["dotNetVersion"]}"; // example: 9.0.0
docsUrl = $"{Configuration["urls:docs"]}";
blogUrl = $"{Configuration["urls:blog"]}";
githubUrl = $"{Configuration["urls:github"]}";
twitterUrl = $"{Configuration["urls:twitter"]}";
linkedInUrl = $"{Configuration["urls:linkedin"]}";
openCollectiveUrl = $"{Configuration["urls:opencollective"]}";
githubIssuesUrl = $"{Configuration["urls:github_issues"]}";
githubDiscussionsUrl = $"{Configuration["urls:github_discussions"]}";
stackoverflowUrl = $"{Configuration["urls:stackoverflow"]}";
Version = $"v{Configuration["version"]}"; // example: v0.6.1
DocsUrl = $"{Configuration["urls:docs"]}";
BlogUrl = $"{Configuration["urls:blog"]}";
GithubUrl = $"{Configuration["urls:github"]}";
TwitterUrl = $"{Configuration["urls:twitter"]}";
LinkedInUrl = $"{Configuration["urls:linkedin"]}";
OpenCollectiveUrl = $"{Configuration["urls:opencollective"]}";
GithubIssuesUrl = $"{Configuration["urls:github_issues"]}";
GithubDiscussionsUrl = $"{Configuration["urls:github_discussions"]}";
StackoverflowUrl = $"{Configuration["urls:stackoverflow"]}";
base.OnInitialized();
}

internal virtual async Task<Sidebar2DataProviderResult> Sidebar2DataProvider(Sidebar2DataProviderRequest request)
internal virtual Task<Sidebar2DataProviderResult> Sidebar2DataProvider()
{
if (navItems is null)
navItems = GetNavItems();

return await Task.FromResult(request.ApplyTo(navItems));
return Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(NavItems));
}
internal virtual IReadOnlyCollection<NavItem> GetNavItems() => new List<NavItem>();

public string Version { get; private set; } = default!;

public string DocsUrl { get; private set; } = default!;

public string BlogUrl { get; private set; } = default!;

public string GithubUrl { get; private set; } = default!;

public string TwitterUrl { get; private set; } = default!;

public string LinkedInUrl { get; private set; } = default!;

public string OpenCollectiveUrl { get; private set; } = default!;

public string GithubIssuesUrl { get; private set; } = default!;

public string GithubDiscussionsUrl { get; private set; } = default!;

internal virtual IEnumerable<NavItem> GetNavItems() => new List<NavItem>();

public string Version => version;
public string DotNetVersion => dotNetVersion;
public string DocsUrl => docsUrl;
public string BlogUrl => blogUrl;
public string GithubUrl => githubUrl;
public string TwitterUrl => twitterUrl;
public string LinkedInUrl => linkedInUrl;
public string OpenCollectiveUrl => openCollectiveUrl;
public string GithubIssuesUrl => githubIssuesUrl;
public string GithubDiscussionsUrl => githubDiscussionsUrl;
public string StackoverflowUrl => stackoverflowUrl;
public string StackoverflowUrl { get; private set; } = default!;

public string DotNetVersion => RuntimeInformation.FrameworkDescription;
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<Accordion>
<AccordionItem Title="Accordion Item #1">
<Content>
<b>This is the first item's accordion body.</b> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</Content>
<b>This is the first item's accordion body.</b> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</AccordionItem>
<AccordionItem Title="Accordion Item #2">
<Content>
<b>This is the second item's accordion body.</b> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</Content>
<b>This is the second item's accordion body.</b> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</AccordionItem>
<AccordionItem Title="Accordion Item #3">
<Content>
<b>This is the third item's accordion body.</b> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</Content>
<b>This is the third item's accordion body.</b> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</AccordionItem>
</Accordion>
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<TitleTemplate>
<Icon Name="IconName.HouseFill" Class="me-1" /> Accordion Item #1
</TitleTemplate>
<Content>
<ChildContent>
<b>This is the first item's accordion body.</b> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</Content>
</ChildContent>
</AccordionItem>
<AccordionItem>
<TitleTemplate>
<Icon Name="IconName.PersonFill" Class="me-1" /> Accordion Item #2
</TitleTemplate>
<Content>
<ChildContent>
<b>This is the second item's accordion body.</b> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</Content>
</ChildContent>
</AccordionItem>
<AccordionItem>
<TitleTemplate>
<Icon Name="IconName.PhoneFill" Class="me-1" /> Accordion Item #3
</TitleTemplate>
<Content>
<ChildContent>
<b>This is the third item's accordion body.</b> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
</Content>
</ChildContent>
</AccordionItem>
</Accordion>
Loading
Loading