MudBlazor / Templates

Ready to use Blazor Templates in different styles and layout with all the basic setup already done for MudBlazor.
MIT License
745 stars 165 forks source link

Upgraded MudBlazor Templates to .NET 9 #482

Open jperson2000 opened 2 weeks ago

jperson2000 commented 2 weeks ago

Description

Resolves: https://github.com/MudBlazor/Templates/issues/481

This update upgrades MudBlazor templates to match the latest ASP.NET Core Blazor Project templates. Changes include a reduced amount of code for auth pages, a better way to detect render modes, and an upgrade to .NET 9. Overall, however, files are largely the same.

Changes were made by performing the following steps:

  1. Cloning the MudBlazor.Templates repo (clone link)
  2. Cloning the aspnetcore repo (clone link)
  3. Choose the net9 branch in aspnetcore
  4. Comparing the MudBlazor Templates folder against aspnetcore\src\ProjectTemplates\Web.ProjectTemplates\content\BlazorWeb-CSharp\BlazorWeb-CSharp in BeyondCompare and setting the local code folders via Set Base Folders
  5. Performing file-by-file comparisons and looking for changes apart from using MudBlazor components.

Special thanks once again to @Anu6is for the MudBlazor.Static library for the Account Management pages.

Using BeyondCompare to Update Templates

image

How Has This Been Tested?

This was tested by:

  1. Running .\InstallAndBuildAllTemplates.ps1 PowerShell script
  2. Observing that all builds succeeded
  3. Opening each solution and testing all links
Project Type Test Result
InteractivityAuto Successful (11/15/2024)
InteractivityAuto_AllInteractive Successful (11/15/2024)
InteractivityAuto_AllInteractive_Auth Successful (11/15/2024)
InteractivityAuto_Auth Successful (11/15/2024)
InteractivityAuto_UseMain Successful (11/15/2024)
InteractivityNone Successful (11/15/2024)
InteractivityServer Successful (11/15/2024)
InteractivityServer_AllInteractive Successful (11/15/2024)
InteractivityWebAssembly Successful (11/15/2024)
InteractivityWebAssembly_AllInteractive Successful (11/15/2024)

Type of Changes

Checklist

ScarletKuro commented 2 weeks ago

Was a little mistake to give the main branch instead of the tag 9.0, it seems the main is on two commits a head, but luckily it seems only the tempalate.json is different with the net.10, so here is the correct one for .net9. https://github.com/dotnet/aspnetcore/blob/v9.0.0/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json

ScarletKuro commented 2 weeks ago

The rest seems to be the same

jperson2000 commented 2 weeks ago

Was a little mistake to give the main branch instead of the tag 9.0, it seems the main is on two commits a head, but luckily it seems only the tempalate.json is different with the net.10, so here is the correct one for .net9. https://github.com/dotnet/aspnetcore/blob/v9.0.0/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json

You're totally right! That's a relief that only the template is different; I will get that sync'ed today then.

ScarletKuro commented 2 weeks ago

I added net9 to the build system, feel free to update the branch

ScarletKuro commented 2 weeks ago

Somehow it still fails to build in CI, tho it's fine locally via the nuke-build. Not sure why it still thinks net8 is installed. I will look at it tmr, too tired for it today.

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

jperson2000 commented 2 weeks ago

Ok, I've finished testing all template projects and have verified that the new auth in .NET 9 is working as expected. I've restored the original Welcome message, and I think we're in good shape to review!

ScarletKuro commented 2 weeks ago

I will review and test this on weekends. I'm also guessing that we will merge this once the v8 is out?

omidkrad commented 2 weeks ago

Thanks for the update. Can you please also enable it to install with the dotnet new install MudBlazor.Templates command? Also README.md needs to be updated to show .NET 9.