Skip to content

Commit 64ca188

Browse files
authored
add microsoft fluentui #19 (#21)
1 parent 1807ada commit 64ca188

15 files changed

+229
-0
lines changed

BlazorBenchmarks.sln

+16
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Solution Items", ".Solutio
6868
README.md = README.md
6969
EndProjectSection
7070
EndProject
71+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentUI.Blazor.Benchmark.Server", "FluentUI.Blazor.Benchmark\Server\FluentUI.Blazor.Benchmark.Server.csproj", "{2B91B5BA-16DD-60B5-6F3C-EA01E8C50200}"
72+
EndProject
73+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentUI.Blazor.Benchmark.Client", "FluentUI.Blazor.Benchmark\Client\FluentUI.Blazor.Benchmark.Client.csproj", "{11B917E2-C872-36A1-A476-3A3236C73013}"
74+
EndProject
75+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FluentUI", "FluentUI", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
76+
EndProject
7177
Global
7278
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7379
Debug|Any CPU = Debug|Any CPU
@@ -154,6 +160,14 @@ Global
154160
{B99719A5-C51D-4E84-8C17-0232EFDB69F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
155161
{B99719A5-C51D-4E84-8C17-0232EFDB69F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
156162
{B99719A5-C51D-4E84-8C17-0232EFDB69F7}.Release|Any CPU.Build.0 = Release|Any CPU
163+
{2B91B5BA-16DD-60B5-6F3C-EA01E8C50200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
164+
{2B91B5BA-16DD-60B5-6F3C-EA01E8C50200}.Debug|Any CPU.Build.0 = Debug|Any CPU
165+
{2B91B5BA-16DD-60B5-6F3C-EA01E8C50200}.Release|Any CPU.ActiveCfg = Release|Any CPU
166+
{2B91B5BA-16DD-60B5-6F3C-EA01E8C50200}.Release|Any CPU.Build.0 = Release|Any CPU
167+
{11B917E2-C872-36A1-A476-3A3236C73013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
168+
{11B917E2-C872-36A1-A476-3A3236C73013}.Debug|Any CPU.Build.0 = Debug|Any CPU
169+
{11B917E2-C872-36A1-A476-3A3236C73013}.Release|Any CPU.ActiveCfg = Release|Any CPU
170+
{11B917E2-C872-36A1-A476-3A3236C73013}.Release|Any CPU.Build.0 = Release|Any CPU
157171
EndGlobalSection
158172
GlobalSection(SolutionProperties) = preSolution
159173
HideSolutionNode = FALSE
@@ -179,6 +193,8 @@ Global
179193
{37974F2E-325D-48B2-80B6-EB8F3E3EEF21} = {FFB0EA65-EE0B-46B5-AC93-32C84C04BD95}
180194
{C7D3A94A-9A82-4F41-9372-B0C8EF66ACF0} = {AA99018F-7582-4A3C-989D-6B18506F864B}
181195
{B99719A5-C51D-4E84-8C17-0232EFDB69F7} = {AA99018F-7582-4A3C-989D-6B18506F864B}
196+
{2B91B5BA-16DD-60B5-6F3C-EA01E8C50200} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
197+
{11B917E2-C872-36A1-A476-3A3236C73013} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
182198
EndGlobalSection
183199
GlobalSection(ExtensibilityGlobals) = postSolution
184200
SolutionGuid = {E284F5B4-146F-44A2-9962-B50F6216B1A7}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<InvariantTimezone>true</InvariantTimezone>
8+
<InvariantGlobalization>true</InvariantGlobalization>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.2" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.2" PrivateAssets="all" />
14+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.11.5" />
15+
</ItemGroup>
16+
17+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@inherits LayoutComponentBase
2+
3+
<main>
4+
@Body
5+
</main>
6+
7+
<FluentToastProvider />
8+
<FluentDialogProvider />
9+
<FluentTooltipProvider />
10+
<FluentMessageBarProvider />
11+
<FluentMenuProvider />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@page "/"
2+
3+
<div class="container">
4+
<FluentButton OnClick="IncreaseCounter" Appearance="@Appearance.Accent">@($"Counter: {counter}")</FluentButton>
5+
<FluentDatePicker />
6+
7+
<lable For="label-input">A Label for An Input</lable>
8+
<input type="text" name="label-input" id="label-input" />
9+
</div>
10+
11+
<style>
12+
.container{
13+
display: flex;
14+
flex-direction: column;
15+
gap: 1rem;
16+
width: 300px;
17+
}
18+
</style>
19+
20+
@code {
21+
int counter;
22+
23+
void IncreaseCounter()
24+
{
25+
counter++;
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using FluentUI.Blazor.Benchmark.Client;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
4+
using Microsoft.FluentUI.AspNetCore.Components;
5+
6+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
7+
8+
builder.RootComponents.Add<App>("#app");
9+
builder.RootComponents.Add<HeadOutlet>("head::after");
10+
11+
builder.Services.AddFluentUIComponents(options =>
12+
{
13+
options.ValidateClassNames = false;
14+
});
15+
16+
await builder.Build().RunAsync();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"profiles": {
3+
"FluentUI.Blazor.Benchmark.Client": {
4+
"commandName": "Project",
5+
"launchBrowser": true,
6+
"environmentVariables": {
7+
"ASPNETCORE_ENVIRONMENT": "Development"
8+
},
9+
"applicationUrl": "https://localhost:52438;http://localhost:52439"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@using System.Net.Http
2+
@using System.Net.Http.Json
3+
@using Microsoft.AspNetCore.Components.Routing
4+
@using Microsoft.AspNetCore.Components.Web
5+
@using Microsoft.AspNetCore.Components.WebAssembly.Http
6+
@using Microsoft.JSInterop
7+
@using FluentUI.Blazor.Benchmark.Client
8+
@using Microsoft.FluentUI.AspNetCore.Components
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>FluentUI.Blazor.Benchmark</title>
7+
<base href="/" />
8+
<link href="FluentUI.Blazor.Benchmark.Client.styles.css" rel="stylesheet" />
9+
</head>
10+
11+
<body>
12+
<div id="app">Loading...</div>
13+
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>
14+
<script src="_framework/blazor.webassembly.js"></script>
15+
</body>
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.2" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\Client\FluentUI.Blazor.Benchmark.Client.csproj" />
15+
</ItemGroup>
16+
17+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using Microsoft.AspNetCore.ResponseCompression;
2+
using System.IO.Compression;
3+
4+
var builder = WebApplication.CreateBuilder(args);
5+
6+
builder.Services.AddRazorPages();
7+
8+
builder.Services.AddResponseCompression(opts =>
9+
{
10+
opts.EnableForHttps = true;
11+
opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[]
12+
{
13+
"application/octet-stream"
14+
}).ToArray();
15+
opts.Providers.Add<BrotliCompressionProvider>();
16+
opts.Providers.Add<GzipCompressionProvider>();
17+
})
18+
.Configure<BrotliCompressionProviderOptions>(opt => opt.Level = CompressionLevel.Fastest)
19+
.Configure<GzipCompressionProviderOptions>(opt => opt.Level = CompressionLevel.Fastest);
20+
21+
var app = builder.Build();
22+
23+
if (app.Environment.IsDevelopment())
24+
{
25+
app.UseWebAssemblyDebugging();
26+
}
27+
else
28+
{
29+
app.UseHsts();
30+
}
31+
32+
app.UseHttpsRedirection();
33+
if (app.Environment.IsProduction() || true)
34+
{
35+
app.UseResponseCompression();
36+
}
37+
app.UseBlazorFrameworkFiles();
38+
app.MapStaticAssets();
39+
40+
app.UseRouting();
41+
42+
app.MapRazorPages();
43+
app.MapFallbackToFile("index.html");
44+
45+
app.Run();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"profiles": {
3+
"https": {
4+
"commandName": "Project",
5+
"launchBrowser": true,
6+
"environmentVariables": {
7+
"ASPNETCORE_ENVIRONMENT": "Development"
8+
},
9+
"dotnetRunMessages": true,
10+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
11+
"applicationUrl": "https://localhost:7012;http://localhost:5249"
12+
}
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The table below provides an overview of the file sizes of various popular Blazor
1616
| **Blazor only** | 1.5 MB | N/A |
1717
| [**bit BlazorUI**](https://blazorui.bitplatform.dev/) | 1.7 MB | +0.2 MB |
1818
| [**MudBlazor**](https://mudblazor.com/) | 2.0 MB | +0.5 MB |
19+
| [**Microsoft FluentUI**](https://fluentui-blazor.net/) | 2.0 MB | +0.5 MB |
1920
| [**MatBlazor**](https://matblazor.com/) | 2.1 MB | +0.6 MB |
2021
| [**Blazorise**](https://blazorise.com/) | 3.1 MB | +1.6 MB |
2122
| [**Ant Design**](https://antblazor.com/) | 3.6 MB | +2.1 MB |

0 commit comments

Comments
 (0)