Skip to content

Commit

Permalink
Migrating to .NET 8 (#4998)
Browse files Browse the repository at this point in the history
* Upgrade net8 packages

* Fix warning in launchSettings

* Use App.razor for base component

* Rename Seo class to SeoGenerator

* Configure Program and Startup for net8

* Add StreamRendering to pricing page

* Add more net8 packages

* Add counter page to test interactivity

* Make the router take in rendermode Server

* Separate Routes.razor

* Use Routes.razor

* Use net8.0 for Blazorise.Docs.Compiler

* ThemeProvider in Routes

* Add missing rewardful JS scripts

* Formating

* Remove render mode from home and pricing pages

* Update NuGet packages

* Update server rendering mode APIs

* Fix static files query version

* Skip TableOfContents if there is no TOC container

* Update demos and docs to net8.0

* Update playwright path

* Update playwright to latest

* Delete NuGet.config

* Remove AllowSynchronousIO

* Interactive HeadOutlet

* Delete counter page

* Fix blog seo

---------

Co-authored-by: David Moreira <[email protected]>
  • Loading branch information
stsrki and David-Moreira authored Nov 15, 2023
1 parent ece5c9f commit d97754f
Show file tree
Hide file tree
Showing 41 changed files with 241 additions and 298 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/blazorise-ci-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: dotnet test ./Tests/Blazorise.Tests/Blazorise.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal

- name: Prepare E2E Tests Dependencies
run: pwsh ./Tests/Blazorise.E2E.Tests/bin/Release/net7.0/playwright.ps1 install --with-deps
run: pwsh ./Tests/Blazorise.E2E.Tests/bin/Release/net8.0/playwright.ps1 install --with-deps

- name: Run E2E Tests - Release
run: dotnet test ./Tests/Blazorise.E2E.Tests/Blazorise.E2E.Tests.csproj --configuration Release --no-restore --no-build --verbosity normal
1 change: 1 addition & 0 deletions .runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<EnvironmentVariables>
<!-- For debugging selectors, it's recommend to set the following environment variable -->
<!--<DEBUG>pw:api</DEBUG>-->
<!--<DEBUG>pw:channel:response,pw:channel:event</DEBUG>-->
</EnvironmentVariables>
</RunConfiguration>

Expand Down
6 changes: 3 additions & 3 deletions Build/Blazorise.Client.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.*" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.*" PrivateAssets="all" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions Build/Blazorise.Demo.props
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<LangVersion>10.0</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Markdig" Version="0.30.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.*" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.*" />
<PackageReference Include="FluentValidation" Version="11.2.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.0" />
<PackageReference Include="Flurl.Http" Version="4.0.0-pre2" />
Expand Down
6 changes: 3 additions & 3 deletions Build/Blazorise.Docs.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<LangVersion>10.0</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.*" />
<PackageReference Include="FluentValidation" Version="11.2.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Build/Blazorise.Server.RC.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.*" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Build/Blazorise.Server.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.*" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Build/Blazorise.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishUrl>D:\Projects\_releases\Blazorise\antdesign</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<ProjectGuid>39cce894-2049-493f-9b49-2d8b94e4a1b6</ProjectGuid>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishUrl>D:\Projects\_releases\Blazorise\rcbootstrap</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ProjectGuid>2b39f3d9-4721-4ea7-9272-708238d1208f</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishUrl>D:\Projects\_releases\Blazorise\bootstrap</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<ProjectGuid>36be2535-4cab-4d2d-8ec8-a5396214ea91</ProjectGuid>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishUrl>D:\Projects\_releases\Blazorise\bootstrap5</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<ProjectGuid>cca627e3-633e-4f00-854c-f028ab298cf5</ProjectGuid>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishUrl>D:\Projects\_releases\Blazorise\bulma</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<ProjectGuid>71232d47-6012-4fec-a52a-86301faa0ae8</ProjectGuid>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<ProjectGuid>4deb65e7-40ba-409e-9c26-6ef75adf2601</ProjectGuid>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<ProjectGuid>47eeb5b2-3ca1-436c-8317-e69f611fa1e3</ProjectGuid>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Documentation/Blazorise.Docs.Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// </summary>
//</member>
var blzSrcPath = @"..\..\..\..\..\Source\Blazorise";
var file = @$"{blzSrcPath}\obj\Debug\net7.0\Blazorise.xml";
var file = @$"{blzSrcPath}\obj\Debug\net8.0\Blazorise.xml";
var enumsFolder = @$"{blzSrcPath}\Enums";
string outputPath = @$"{blzSrcPath}\obj\Debug\net7.0\EnumsOutput.txt";
string outputPath = @$"{blzSrcPath}\obj\Debug\net8.0\EnumsOutput.txt";

var enumsFolderDirectory = new DirectoryInfo( enumsFolder );
var enumFileNames = enumsFolderDirectory.GetFiles().Select( x => x.Name.Split( ".cs" )[0] );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>$(MSBuildProjectName)</UserSecretsId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Blazorise.Docs.Server.Infrastructure;

public class Seo
public class SeoGenerator
{
public static async Task GenerateRobots( HttpContext context )
{
Expand Down
9 changes: 0 additions & 9 deletions Documentation/Blazorise.Docs.Server/Pages/_Host.cshtml

This file was deleted.

90 changes: 0 additions & 90 deletions Documentation/Blazorise.Docs.Server/Pages/_Layout.cshtml

This file was deleted.

31 changes: 14 additions & 17 deletions Documentation/Blazorise.Docs.Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Blazorise.Docs.Server;
using Microsoft.AspNetCore.Builder;

namespace Blazorise.Docs.Server;
namespace Blazorise.Docs;

public class Program
{
public static void Main( string[] args )
{
CreateHostBuilder( args ).Build().Run();
}
var builder = WebApplication.CreateBuilder( args );

var startup = new Startup( builder.Configuration );

startup.ConfigureServices( builder.Services );

public static IHostBuilder CreateHostBuilder( string[] args ) =>
Host.CreateDefaultBuilder( args )
.ConfigureWebHostDefaults( webBuilder =>
{
webBuilder.UseStartup<Startup>();
} );
var app = builder.Build();

startup.Configure( app );

app.Run();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishUrl>D:\Projects\_releases\Blazorise\docs-v2</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ProjectGuid>3d262581-0f01-4317-9acc-3f104bb639cb</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
Expand Down
Loading

0 comments on commit d97754f

Please sign in to comment.