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

Migrating documentation to .NET 8 - WASM mode #5091

Open
wants to merge 29 commits into
base: rel-1.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8483cdc
Upgrade net8 packages
stsrki Aug 26, 2023
b66832e
Fix warning in launchSettings
stsrki Aug 26, 2023
6440586
Use App.razor for base component
stsrki Aug 26, 2023
6f722ae
Rename Seo class to SeoGenerator
stsrki Aug 26, 2023
5a1b1e7
Configure Program and Startup for net8
stsrki Aug 26, 2023
0244144
Add StreamRendering to pricing page
stsrki Aug 26, 2023
84817e4
Add more net8 packages
stsrki Aug 26, 2023
e62f447
Add counter page to test interactivity
David-Moreira Aug 26, 2023
45d79db
merge / remove wasm dependencies
David-Moreira Aug 26, 2023
bffb4e1
Make the router take in rendermode Server
David-Moreira Aug 26, 2023
4cd60b1
Separate Routes.razor
stsrki Aug 26, 2023
79dcba1
Use Routes.razor
stsrki Aug 26, 2023
a54fb00
merge
stsrki Sep 13, 2023
2266667
Use net8.0 for Blazorise.Docs.Compiler
stsrki Sep 13, 2023
f024679
ThemeProvider in Routes
stsrki Sep 13, 2023
d569083
Add missing rewardful JS scripts
stsrki Sep 13, 2023
ab9b8a6
Formating
stsrki Sep 13, 2023
c40d82a
Remove render mode from home and pricing pages
stsrki Sep 14, 2023
87deea8
Merge branch 'rel-1.3' into rel-1.2-net8-docs-v2
stsrki Oct 20, 2023
3fccab0
Update NuGet packages
stsrki Oct 20, 2023
3d960e6
Update server rendering mode APIs
stsrki Oct 20, 2023
a1c492c
Convert Blazorise.Docs to WASM client
stsrki Oct 20, 2023
0ac6cb7
Merge branch 'rel-1.4' into rel-1.2-net8-docs-v2-automode
stsrki Jan 3, 2024
113cc2e
merge 1.4
stsrki Jan 24, 2024
f0c2aa9
Fix CSS and JS paths
stsrki Jan 24, 2024
1771153
Update runtime versions
stsrki Jan 24, 2024
00e9a8e
Remove AllowSynchronousIO
stsrki Jan 24, 2024
e5eb204
Remove <SupportedPlatform Include="browser" />
stsrki Jan 24, 2024
1530e73
Fix Wasm project configuration | Interactive Auto Changes
David-Moreira Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Build/Blazorise.Docs.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<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>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
David-Moreira marked this conversation as resolved.
Show resolved Hide resolved
</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.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0-rc.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.2.*" />
<PackageReference Include="FluentValidation" Version="11.2.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.0" />
</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>
</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
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0-rc.2.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Source\Blazorise.Bootstrap5\Blazorise.Bootstrap5.csproj" />
<ProjectReference Include="..\..\Source\Extensions\Blazorise.Icons.FontAwesome\Blazorise.Icons.FontAwesome.csproj" />
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 @@ -17,7 +17,7 @@
},
"Blazorise.Docs.Server": {
"commandName": "Project",
"dotnetRunMessages": "true",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
Expand Down
63 changes: 34 additions & 29 deletions Documentation/Blazorise.Docs.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;

namespace Blazorise.Docs.Server;

Expand All @@ -33,14 +34,30 @@ public Startup( IConfiguration configuration )
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices( IServiceCollection services )
{
services.AddRazorPages();
services.AddServerSideBlazor();
// Add services to the container.
services
.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();

services.Configure<IISServerOptions>( options =>
{
options.AllowSynchronousIO = true;
} );

services.AddServerSideBlazor().AddHubOptions( ( o ) =>
services.Configure<KestrelServerOptions>( options =>
{
o.MaximumReceiveMessageSize = 1024 * 1024 * 100;
options.AllowSynchronousIO = true;
} );

//services.AddRazorPages();
//services.AddServerSideBlazor();

//services.AddServerSideBlazor().AddHubOptions( ( o ) =>
//{
// o.MaximumReceiveMessageSize = 1024 * 1024 * 100;
//} );

services.AddHttpContextAccessor();

services
Expand Down Expand Up @@ -99,13 +116,14 @@ public void ConfigureServices( IServiceCollection services )
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure( IApplicationBuilder app, IWebHostEnvironment env )
public void Configure( WebApplication app )
{
app.UseResponseCompression();

if ( env.IsDevelopment() )
// Configure the HTTP request pipeline.
if ( app.Environment.IsDevelopment() )
{
app.UseDeveloperExceptionPage();
app.UseWebAssemblyDebugging();
}
else
{
Expand All @@ -115,31 +133,18 @@ public void Configure( IApplicationBuilder app, IWebHostEnvironment env )
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseEndpoints( endpoints =>
{
endpoints.MapGet( "/robots.txt", async context =>
{
await Seo.GenerateRobots( context );
} );

endpoints.MapGet( "/sitemap.txt", async context =>
{
await Seo.GenerateSitemap( context );
} );
app.UseStaticFiles();
app.UseAntiforgery();

endpoints.MapGet( "/sitemap.xml", async context =>
{
await Seo.GenerateSitemapXml( context );
} );
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode();

endpoints.MapHealthChecks( "/healthcheck" );
//app.UseRouting();

endpoints.MapBlazorHub();
endpoints.MapFallbackToPage( "/_Host" );
} );
app.MapGet( "/robots.txt", SeoGenerator.GenerateRobots );
app.MapGet( "/sitemap.txt", SeoGenerator.GenerateSitemap );
app.MapGet( "/sitemap.xml", SeoGenerator.GenerateSitemapXml );
}
}
9 changes: 0 additions & 9 deletions Documentation/Blazorise.Docs.Server/_Imports.razor

This file was deleted.

Loading
Loading