Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,9 @@ dotnet_diagnostic.CS0618.severity = none

# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = none

[**/scripts/*.cs]
# IDE0005: Remove unused usings. Ignore for shared src files since imports for those depend on the projects in which they are included.
dotnet_diagnostic.IDE0005.severity = silent
dotnet_diagnostic.IDE2003.severity = silent
dotnet_diagnostic.IDE0073.severity = silent
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ FodyWeavers.xsd
*.js
*.razor.js.map

#templates JavaScript files must not be ignored
!src/Templates/templates/*.js

# Specific files, typically generated by tools
*.cobertura.xml
Microsoft.FluentUI.AspNetCore.Components.xml
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<RepositoryUrl>https://github.com/microsoft/fluentui-blazor</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<License>MIT</License>
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<AssemblyVersion>$(VersionFile)</AssemblyVersion>
Expand Down
40 changes: 31 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<RuntimeVersion9>9.0.15</RuntimeVersion9>
<AspNetCoreVersion9>9.0.15</AspNetCoreVersion9>
<EfCoreVersion9>9.0.15</EfCoreVersion9>
<RuntimeVersion10>10.0.3</RuntimeVersion10>
<AspNetCoreVersion10>10.0.3</AspNetCoreVersion10>
<EfCoreVersion10>10.0.3</EfCoreVersion10>
<RuntimeVersion9>9.0.17</RuntimeVersion9>
<AspNetCoreVersion9>9.0.17</AspNetCoreVersion9>
<EfCoreVersion9>9.0.17</EfCoreVersion9>
<RuntimeVersion10>10.0.9</RuntimeVersion10>
<AspNetCoreVersion10>10.0.9</AspNetCoreVersion10>
<EfCoreVersion10>10.0.9</EfCoreVersion10>
</PropertyGroup>
<!-- Independent from TargetFrameWorks-->
<ItemGroup>
<!-- For Sample Apps -->
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.14.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.14.1" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.14.1" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.14.2" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.14.2" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.14.2" />
<PackageVersion Include="LoxSmoke.DocXml" Version="3.9.0" />
<!-- For MCP Apps -->
<PackageVersion Include="ModelContextProtocol" Version="1.3.0" />
Expand All @@ -37,6 +37,9 @@
<PackageVersion Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="5.9.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="5.0.0-1.25277.114" />
<!-- For templates generation -->
<PackageVersion Include="System.CommandLine" Version="2.0.5" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(RuntimeVersion10)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net9.0'">
<!-- Build dependencies -->
Expand Down Expand Up @@ -79,4 +82,23 @@
<PackageVersion Include="System.Text.Encodings.Web" Version="$(RuntimeVersion10)" />
<PackageVersion Include="System.Text.Json" Version="$(RuntimeVersion10)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net11.0'">
<!-- Build dependencies -->
<PackageVersion Include="Microsoft.AspNetCore.Components.Analyzers" Version="$(AspNetCoreVersion11)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion11)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(AspNetCoreVersion11)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(AspNetCoreVersion11)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(AspNetCoreVersion11)" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="$(RuntimeVersion11)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="$(EfCoreVersion11)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EfCoreVersion11)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(EfCoreVersion11)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="$(RuntimeVersion11)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(RuntimeVersion11)" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(RuntimeVersion11)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(RuntimeVersion11)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(RuntimeVersion11)" />
<PackageVersion Include="System.Text.Encodings.Web" Version="$(RuntimeVersion11)" />
<PackageVersion Include="System.Text.Json" Version="$(RuntimeVersion11)" />
</ItemGroup>
</Project>
6 changes: 5 additions & 1 deletion Microsoft.FluentUI-v5.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
<Project Path="examples/Samples/FluentUI.Samples.SSR/FluentUI.Samples.SSR.csproj" />
<Project Path="examples/Samples/FluentUI.Samples.WasmStandalone/FluentUI.Samples.WasmStandalone.csproj" />
</Folder>
<Folder Name="/src/" />
<Folder Name="/src/">
<Project Path="src/Templates/Microsoft.FluentUI.AspNetCore.Templates.csproj">
<Build Solution="Debug|*" Project="false" />
</Project>
</Folder>
<Folder Name="/src/Charts/">
<Project Path="src/Charts.Scripts/Microsoft.FluentUI.AspNetCore.Components.Charts.Scripts.esproj">
<Build />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ icon: SettingsCogMultiple
---

# Installation

Getting started with **Fluent UI Blazor** for faster and easier .NET web development.

## Online Playground
Expand All @@ -15,7 +16,16 @@ TODO

## Using Templates

TODO
After installing the `Microsoft/FluentUI.AspNetCore.Templates` package (available starting with RC4) you'll have 4 standard templates available in a ready-to-run Fluent UI version.

Templates added:

- Fluent Blazor Web App
- Fluent Blazor WebAssembly Standalone App
- Fluent Aspire Starter App (ASP.NET Core/Blazor/Fluent UI)
- Fluent .NET MAUI Blazor Hybrid and Web App

The templates are all 100% code copies of the original templates. We just used the Fluent Razor components to build the UI with.

## Manual Installation

Expand Down
1 change: 0 additions & 1 deletion src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\Core.Scripts\Microsoft.FluentUI.AspNetCore.Components.Scripts.esproj" PrivateAssets="All" />
</ItemGroup>

<!-- Enable deterministic builds for CI environments and Release configuration -->
Expand Down
191 changes: 191 additions & 0 deletions src/Templates/Microsoft.FluentUI.AspNetCore.Templates.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="AddTemplatesToPackageAsContent">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Library</OutputType>
<ContentTargetFolders>content</ContentTargetFolders>
<IsPackable>true</IsPackable>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PackageType>Template</PackageType>
<PackageIcon>icon.png</PackageIcon>
<EnableDefaultItems>false</EnableDefaultItems>
<NoWarn>$(NoWarn);NU5128;IDE0005</NoWarn>
<NoDefaultExcludes>true</NoDefaultExcludes>
<UsingToolTemplateLocalizer>true</UsingToolTemplateLocalizer>
<Description>Project templates for creating a Fluent UI Blazor Web app, Blazor WebAssembly Standalone app, Blazor Hybrid and Web App or .NET Aspire Starter app. These templates are pure copies of the original templates but use the Fluent UI Blazor library for building the user interface (UI).</Description>
<PackageId>Microsoft.FluentUI.AspNetCore.Templates</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/microsoft/fluentui-blazor</PackageProjectUrl>
<PackageTags>Templates, Fluent UI, Blazor, Web Components</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Title>Microsoft Fluent UI Blazor Templates</Title>
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
</PropertyGroup>

<PropertyGroup>
<!-- for templates -->
<IconsPackageVersion>4.14.2</IconsPackageVersion>
<AspirePackageVersion>13.4</AspirePackageVersion>
<MicrosoftExtensionsHttpResiliencePackageVersion>10.0.0</MicrosoftExtensionsHttpResiliencePackageVersion>
<MicrosoftExtensionsServiceDiscoveryVersion>10.6.0</MicrosoftExtensionsServiceDiscoveryVersion>
<MicrosoftAspNetCorePackageVersionForNet8>8.0.25</MicrosoftAspNetCorePackageVersionForNet8>
<MicrosoftAspNetCorePackageVersionForNet9>9.0.16</MicrosoftAspNetCorePackageVersionForNet9>
<MicrosoftAspNetCorePackageVersionForNet10>10.0.8</MicrosoftAspNetCorePackageVersionForNet10>
<MicrosoftAspNetCorePackageVersionForNet11>11.0.0-preview.4.26230.115</MicrosoftAspNetCorePackageVersionForNet11>
<MicrosoftAspNetCoreOpenApiVersion>9.0.16</MicrosoftAspNetCoreOpenApiVersion>
<MicrosoftAspNetCoreOpenApiPreviewVersion>10.0.8</MicrosoftAspNetCoreOpenApiPreviewVersion>
<OpenTelemetryNet8Version>1.9.0</OpenTelemetryNet8Version>
<OpenTelemetryLTSVersion>1.15.1</OpenTelemetryLTSVersion>
<OpenTelemetryInstrumentationAspNetCoreVersion>1.15.2</OpenTelemetryInstrumentationAspNetCoreVersion>
<OpenTelemetryInstrumentationHttpVersion>1.15.0</OpenTelemetryInstrumentationHttpVersion>
<OpenTelemetryInstrumentationExtensionsHostingVersion>1.15.3</OpenTelemetryInstrumentationExtensionsHostingVersion>
<OpenTelemetryInstrumentationRuntimeVersion>1.15.1</OpenTelemetryInstrumentationRuntimeVersion>
<OpenTelemetryExporterOpenTelemetryProtocolVersion>1.15.3</OpenTelemetryExporterOpenTelemetryProtocolVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<IsShipping>true</IsShipping>
<Optimize>True</Optimize>
<NoWarn>1701;1702;8669;1591</NoWarn>
<DebuggerSupport>false</DebuggerSupport>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
</PropertyGroup>

<PropertyGroup>
<UsePublicApiAnalyzers>false</UsePublicApiAnalyzers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="templates\**\*" />
<!--<Content Include="content\**\*" Exclude="content\**\bin\**;content\**\obj\**" />-->
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="..\..\icon.png" Pack="true" PackagePath="\" />
<Compile Remove="**/*" />
</ItemGroup>

<ItemGroup>
<!-- Template config files: .template.config\*.json -->
<TemplateConfigFiles Include="$(MSBuildThisFileDirectory)templates\**\.template.config\*.json">
<PackagePath>content/templates/%(RecursiveDir)</PackagePath>
<DestinationFile>$(IntermediateOutputPath)content\templates\%(RecursiveDir)%(Filename)%(Extension)</DestinationFile>
</TemplateConfigFiles>

<TemplateConfigFilesObj Include="@(TemplateConfigFiles->'%(DestinationFile)')" />

<!-- Template project files: *.csproj -->
<TemplateProjectFiles Include="$(MSBuildThisFileDirectory)templates\**\*.csproj">
<PackagePath>content/templates/%(RecursiveDir)</PackagePath>
<DestinationFile>$(IntermediateOutputPath)content\templates\%(RecursiveDir)%(Filename)%(Extension)</DestinationFile>
</TemplateProjectFiles>

<TemplateProjectFilesObj Include="@(TemplateProjectFiles->'%(DestinationFile)')" />

<TemplateFiles Include="$(MSBuildThisFileDirectory)templates\**\*" Exclude="$(MSBuildThisFileDirectory)templates\**\bin\**;$(MSBuildThisFileDirectory)templates\**\obj\**;$(MSBuildThisFileDirectory)templates\**\*.csproj;$(MSBuildThisFileDirectory)templates\aspire-apphost-singlefile\**\apphost.cs">
<PackagePath>content/templates/%(RecursiveDir)</PackagePath>
</TemplateFiles>

<None Remove="templates\blazorweb-csharp-11\**" />

<None Remove="templates\componentswebassembly-csharp-11\**" />

<TemplateFilesObj Include="@(TemplateFiles->'$(IntermediateOutputPath)content\templates\%(RecursiveDir)%(Filename)%(Extension)')" />
</ItemGroup>

<!-- When building a package, this target will run to copy all the templates into the intermediate directory,
replaces the package versions, and adds them to the package.-->
<Target Name="AddTemplatesToPackageAsContent" AfterTargets="Build" DependsOnTargets="ReplacePackageVersionOnTemplates">
<ItemGroup>
<Content Include="@(TemplateFilesObj);@(TemplateProjectFilesObj)" />
</ItemGroup>
</Target>

<!-- Replaces the versions referenced by the templates projects to use the version of the packages being live-built -->
<Target Name="ReplacePackageVersionOnTemplates" DependsOnTargets="CopyTemplatesToIntermediateOutputPath">

<PropertyGroup>
<_RspFilePath>$(IntermediateOutputPath)replace-text-args.rsp</_RspFilePath>
<_ReplaceTextScriptPath>$(SolutionDir)tools/scripts/replace-text.cs</_ReplaceTextScriptPath>
</PropertyGroup>

<ItemGroup>
<!-- This is defined here as these files aren't guaranteed to exist until the build has run -->
<TemplateLocalizedStringsFiles Include="$(MSBuildThisFileDirectory)templates\**\.template.config\localize\templatestrings.*.json" />
<TemplateLocalizedStringsFilesDest Include="@(TemplateLocalizedStringsFiles)" DestinationFile="$(IntermediateOutputPath)content\templates\%(RecursiveDir)%(Filename)%(Extension)" />
<TemplateLocalizedStringsFilesObj Include="@(TemplateLocalizedStringsFilesDest->'%(DestinationFile)')" />
</ItemGroup>

<ItemGroup>
<SourceFiles Include="@(TemplateConfigFilesObj)" />
<SourceFiles Include="@(TemplateProjectFilesObj)" />
<SourceFiles Include="@(TemplateLocalizedStringsFilesObj)" />
<!-- NOTE: These must be added in pairs, with text to replace first, then replacement text second -->
<Replacements Include="!!REPLACE_WITH_LATEST_VERSION!!" />
<Replacements Include="$(PackageVersion)" />
<Replacements Include="!!REPLACE_WITH_LATEST_ICONS_VERSION!!" />
<Replacements Include="$(IconsPackageVersion)" />
<Replacements Include="!!REPLACE_WITH_LATEST_ASPIRE_VERSION!!" />
<Replacements Include="$(AspirePackageVersion)" />
<Replacements Include="!!REPLACE_WITH_ASPNETCORE_8_VERSION!!" />
<Replacements Include="$(MicrosoftAspNetCorePackageVersionForNet8)" />
<Replacements Include="!!REPLACE_WITH_ASPNETCORE_9_VERSION!!" />
<Replacements Include="$(MicrosoftAspNetCorePackageVersionForNet9)" />
<Replacements Include="!!REPLACE_WITH_ASPNETCORE_10_VERSION!!" />
<Replacements Include="$(MicrosoftAspNetCorePackageVersionForNet10)" />
<Replacements Include="!!REPLACE_WITH_ASPNETCORE_11_VERSION!!" />
<Replacements Include="$(MicrosoftAspNetCorePackageVersionForNet11)" />
<Replacements Include="!!REPLACE_WITH_DOTNET_EXTENSIONS_VERSION!!" />
<Replacements Include="$(MicrosoftExtensionsHttpResiliencePackageVersion)" />
<Replacements Include="!!REPLACE_WITH_SERVICE_DISCOVERY_VERSION!!" />
<Replacements Include="$(MicrosoftExtensionsServiceDiscoveryVersion)" />
<Replacements Include="!!REPLACE_WITH_OTEL_NET8_VERSION!!" />
<Replacements Include="$(OpenTelemetryNet8Version)" />
<Replacements Include="!!REPLACE_WITH_OTEL_LTS_VERSION!!" />
<Replacements Include="$(OpenTelemetryLTSVersion)" />
<Replacements Include="!!REPLACE_WITH_OTEL_EXPORTER_VERSION!!" />
<Replacements Include="$(OpenTelemetryExporterOpenTelemetryProtocolVersion)" />
<Replacements Include="!!REPLACE_WITH_OTEL_HOSTING_VERSION!!" />
<Replacements Include="$(OpenTelemetryInstrumentationExtensionsHostingVersion)" />
<Replacements Include="!!REPLACE_WITH_OTEL_ASPNETCORE_VERSION!!" />
<Replacements Include="$(OpenTelemetryInstrumentationAspNetCoreVersion)" />
<Replacements Include="!!REPLACE_WITH_OTEL_HTTP_VERSION!!" />
<Replacements Include="$(OpenTelemetryInstrumentationHttpVersion)" />
<Replacements Include="!!REPLACE_WITH_OTEL_RUNTIME_VERSION!!" />
<Replacements Include="$(OpenTelemetryInstrumentationRuntimeVersion)" />
<Replacements Include="!!REPLACE_WITH_ASPNETCORE_OPENAPI_9_VERSION!!" />
<Replacements Include="$(MicrosoftAspNetCoreOpenApiVersion)" />
<Replacements Include="!!REPLACE_WITH_ASPNETCORE_OPENAPI_10_VERSION!!" />
<Replacements Include="$(MicrosoftAspNetCoreOpenApiPreviewVersion)" />
</ItemGroup>

<!-- Build the .rsp file content as an item group -->
<ItemGroup>
<_RspLines Include="--files" />
<_RspLines Include="@(SourceFiles)" />
<_RspLines Include="--replacements" />
<_RspLines Include="@(Replacements)" />
</ItemGroup>

<!-- Write the .rsp file -->
<WriteLinesToFile File="$(_RspFilePath)" Lines="@(_RspLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />

<!-- Execute the script with the .rsp file, using double dash to pass arguments directly to the script -->
<Exec Command="dotnet &quot;$(_ReplaceTextScriptPath)&quot; -- @&quot;$(_RspFilePath)&quot;" WorkingDirectory="$(MSBuildThisFileDirectory)" StandardOutputImportance="Normal" StandardErrorImportance="Normal" />
</Target>

<!-- Grabs the contents of the templates folder and copies them to IntermediateOutputPath directory -->
<Target Name="CopyTemplatesToIntermediateOutputPath" Inputs="@(TemplateFiles);@(TemplateProjectFiles)" Outputs="@(TemplateFilesObj);@(TemplateProjectFilesObj)">

<Copy SourceFiles="@(TemplateFiles)" DestinationFiles="@(TemplateFilesObj)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(TemplateProjectFiles)" DestinationFiles="@(TemplateProjectFilesObj)" SkipUnchangedFiles="true" />

</Target>

</Project>
32 changes: 32 additions & 0 deletions src/Templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
> **IMPORTANT!!**
> Just as with the standard Blazor Web App template, Blazor will use SSR by default. If you want to have interactive components, make sure you add a rendermode to the app, page or component!

## Installation
Install the templates by running the command:
```
dotnet new install Microsoft.FluentUI.AspNetCore.Templates
```

## Usage
After installing the templates you can create new a project from either the CLI or by creating a new project in Visual studio 2022.

For creating a Fluent Blazor Web App project from the CLI
```
dotnet new fluentblazor -o {your project name}
```
For creating a Fluent Blazor WebAssembly Standalone App project from the CLI:
```
dotnet new fluentblazorwasm -o {your project name}
```
In Visual Studio you can create a new project by selecting either the FluentUI Blazor Server App template or the FluentUI Blazor WebAssembly template in the 'File->New->Project'-dialog.

## Uninstalling the templates
If you want to uninstall the templates, both from the CLI and Visual Studio 2022, run the following command:
```
dotnet new uninstall Microsoft.FluentUI.AspNetCore.Templates
```

## Support
The Microsoft Fluent UI Blazor library is an open source project and is **not** an official part of ASP.NET Core, which means it’s **not** officially
supported and isn’t committed to ship updates as part of any official .NET updates. It is built and maintained by Microsoft employees (**and** other contributors)
and offers support, like most other open source projects, on a best effort base through the GitHub repository **only**.
1 change: 0 additions & 1 deletion src/Templates/no-file.txt

This file was deleted.

Loading
Loading