Skip to content

Commit cb7fd17

Browse files
authored
Update Nimble / Spright Blazor to .NET 8 (#2454)
# Pull Request ## 🤨 Rationale Resolves #1667 - Split off resolving more code analysis suppressions to #2453 - #2355 : Resolved by updates to Nimble/Spright JS initialization scripts for .NET 8 - #2188 : Not reproducible by Nimble team, can debug further once changes published if client can still reproduce ## 👩‍💻 Implementation - Projects in Blazor solution now target `net8.0` (formerly `net6.0`) - Update other .NET dependencies, and code analyzer package versions - Update docs - Re-build `Demo.Server` example based on new Blazor Web App template - Update acceptance test projects to use similar setup as Blazor Web App templates - `NimbleBlazor.Tests.Acceptance.Client`: Existing tests use the `InteractiveServer` render mode. The project also now supports tests using `InteractiveWebAssembly` and static SSR render modes. Add one example test for each. - TODO: Spright acceptance test project currently don't use the new setup yet. If the changes look reasonable and we want to do the same for the Spright tests, I can do so in an update. ## 🧪 Testing - Manual testing - Autotests (unit/acceptance) pass. New tests for Nimble for InteractiveWebAssembly / static SSR render modes. ## ✅ Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
1 parent a990204 commit cb7fd17

File tree

105 files changed

+2554
-2002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+2554
-2002
lines changed

.github/renovate.json

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"matchManagers": ["nuget"],
4646
"excludePackagePatterns":[
4747
"Apache.Arrow",
48-
"NI.CSharp.Analyzers",
4948
"Microsoft.Playwright"
5049
],
5150
"enabled": true

.vscode/tasks.json

+30
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@
111111
},
112112
"problemMatcher": "$msCompile"
113113
},
114+
{
115+
"label": "blazor-hybrid-example:build",
116+
"command": "dotnet",
117+
"type": "process",
118+
"args": [
119+
"build",
120+
"${workspaceFolder}/packages/blazor-workspace/Examples/Demo.Hybrid/Demo.Hybrid.csproj",
121+
"/property:GenerateFullPaths=true",
122+
"/consoleloggerparameters:NoSummary"
123+
],
124+
"options": {
125+
"cwd": "${workspaceFolder}/packages/blazor-workspace/Examples/Demo.Hybrid/"
126+
},
127+
"problemMatcher": "$msCompile"
128+
},
114129
{
115130
"label": "blazor-server-example:watch",
116131
"command": "dotnet",
@@ -141,5 +156,20 @@
141156
},
142157
"problemMatcher": "$msCompile"
143158
},
159+
{
160+
"label": "blazor-hybrid-example:watch",
161+
"command": "dotnet",
162+
"type": "process",
163+
"args": [
164+
"watch",
165+
"run",
166+
"--project",
167+
"${workspaceFolder}/packages/blazor-workspace/Examples/Demo.Hybrid/Demo.Hybrid.csproj"
168+
],
169+
"options": {
170+
"cwd": "${workspaceFolder}/packages/blazor-workspace/Examples/Demo.Hybrid/"
171+
},
172+
"problemMatcher": "$msCompile"
173+
},
144174
]
145175
}

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ To submit changes to Nimble, the first step is to build the monorepo which requi
77
- Sync down a copy of the nimble repository
88
- Note: For one-off small contributions you can consider using a fork-pull workflow. However [fork-pull workflows are not yet supported](https://github.com/ni/nimble/issues/634) for substantial development. For substantial development you should be added as a Contributor to the repository. See the [`README.md` Community section](/README.md#community) to get in touch if you need Contributor permissions.
99
- Install Node.js version 22+ (run `node --version`) and npm version 10+ (run `npm --version`) which can be downloaded from https://nodejs.org/en/download/
10-
- Install .NET 6 SDK (`6.0.418 <= version < 7`) which can be downloaded from https://dotnet.microsoft.com/en-us/download
11-
- Run `dotnet --info` to verify the required version of the SDK is installed. A `v6` install is required, but it's fine if later versions are installed too.
10+
- Install .NET 8 SDK (`8.0.403` or higher) which can be downloaded from https://dotnet.microsoft.com/en-us/download
11+
- Run `dotnet --info` to verify the required version of the SDK is installed. A `v8` install is required, but it's fine if later versions are installed too.
1212

1313
From the `nimble` directory:
1414

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "Nimble Blazor targets (and requires) .NET 8. Update examples, docs, tests. See README for updated usage instructions.",
4+
"packageName": "@ni/nimble-blazor",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "Spright Blazor targets (and requires) .NET 8. Update examples, docs, tests. See README for updated usage instructions.",
4+
"packageName": "@ni/spright-blazor",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/blazor-workspace/.editorconfig

+17-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ dotnet_diagnostic.IDE0066.severity = none
3434
# Disable general pattern matching rule for now, may opt in in the future
3535
dotnet_diagnostic.IDE0078.severity = none
3636

37+
# Disabled during .NET 8 updates
38+
dotnet_diagnostic.IDE0005.severity = suggestion
39+
dotnet_diagnostic.IDE0100.severity = none
40+
dotnet_diagnostic.IDE0200.severity = none
41+
dotnet_diagnostic.IDE0300.severity = none
42+
dotnet_diagnostic.IDE0290.severity = none
43+
dotnet_diagnostic.IDE0028.severity = none
44+
dotnet_diagnostic.IDE0301.severity = none
45+
dotnet_diagnostic.IDE0090.severity = none
46+
dotnet_diagnostic.IDE0028.severity = none
47+
dotnet_diagnostic.BL0007.severity = none
48+
dotnet_diagnostic.SYSLIB1045.severity = none
49+
# dotnet format command throws an exception when IDE0130 (dotnet_style_namespace_match_folder)
50+
# triggers - see https://github.com/dotnet/format/issues/1623
51+
dotnet_diagnostic.IDE0130.severity = suggestion
52+
3753
[*.razor.cs]
3854
# Spurious 'unused' warnings when properties/methods are only used from Razor files
3955
dotnet_diagnostic.IDE0051.severity = none
@@ -45,7 +61,7 @@ dotnet_diagnostic.IDE0044.severity = none
4561
# Spurious 'unnecessary using' warnings
4662
dotnet_diagnostic.IDE0005.severity = none
4763

48-
[Tests/NimbleBlazor.Tests.Acceptance/Tests/*.cs]
64+
[Tests/NimbleBlazor.Tests.Acceptance/Tests*/*.cs]
4965
dotnet_style_namespace_match_folder = false
5066
# Disable 'Namespace does not match folder structure'
5167
dotnet_diagnostic.IDE0130.severity = none

packages/blazor-workspace/BlazorWorkspace.sln

+20-13
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NimbleBlazor.Tests", "Tests
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{638B1C16-782F-4C91-A09C-3569957356DF}"
1111
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Client", "Examples\Demo.Client\Demo.Client.csproj", "{A8C1D36B-77FA-4D9B-893E-226FA2786D31}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Client", "Examples\Demo.Client\Demo.Client.csproj", "{63AFFE3B-A427-40B4-8079-CE6E6F1E8223}"
1313
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Server", "Examples\Demo.Server\Demo.Server.csproj", "{6A1D0B77-BBF2-415E-B3A8-FAB00879F07C}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Server", "Examples\Demo.Server\Demo.Server.csproj", "{08919E1A-D277-4F26-A85B-05CC736508BB}"
1515
EndProject
1616
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Shared", "Examples\Demo.Shared\Demo.Shared.csproj", "{8B6E367C-E472-4E68-98D2-968CFCF6939D}"
1717
EndProject
@@ -27,7 +27,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SprightBlazor.Tests", "Test
2727
EndProject
2828
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SprightBlazor.Tests.Acceptance", "Tests\SprightBlazor.Tests.Acceptance\SprightBlazor.Tests.Acceptance.csproj", "{8E335572-CD8B-4879-8760-73416CF103B1}"
2929
EndProject
30-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorWorkspace.Testing.Acceptance", "Tests\BlazorWorkspace.Testing.Acceptance\BlazorWorkspace.Testing.Acceptance.csproj", "{D94A4535-51B3-4E70-9582-3F3A44C7A798}"
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWorkspace.Testing.Acceptance", "Tests\BlazorWorkspace.Testing.Acceptance\BlazorWorkspace.Testing.Acceptance.csproj", "{D94A4535-51B3-4E70-9582-3F3A44C7A798}"
31+
EndProject
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NimbleBlazor.Tests.Acceptance.Client", "Tests\NimbleBlazor.Tests.Acceptance.Client\NimbleBlazor.Tests.Acceptance.Client.csproj", "{27DB8F65-4848-4EA6-A7F2-86EF00D585FD}"
3133
EndProject
3234
Global
3335
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -43,14 +45,6 @@ Global
4345
{1E11DA86-D43D-4CF7-94F5-B4565450BF4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
4446
{1E11DA86-D43D-4CF7-94F5-B4565450BF4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
4547
{1E11DA86-D43D-4CF7-94F5-B4565450BF4C}.Release|Any CPU.Build.0 = Release|Any CPU
46-
{A8C1D36B-77FA-4D9B-893E-226FA2786D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47-
{A8C1D36B-77FA-4D9B-893E-226FA2786D31}.Debug|Any CPU.Build.0 = Debug|Any CPU
48-
{A8C1D36B-77FA-4D9B-893E-226FA2786D31}.Release|Any CPU.ActiveCfg = Release|Any CPU
49-
{A8C1D36B-77FA-4D9B-893E-226FA2786D31}.Release|Any CPU.Build.0 = Release|Any CPU
50-
{6A1D0B77-BBF2-415E-B3A8-FAB00879F07C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51-
{6A1D0B77-BBF2-415E-B3A8-FAB00879F07C}.Debug|Any CPU.Build.0 = Debug|Any CPU
52-
{6A1D0B77-BBF2-415E-B3A8-FAB00879F07C}.Release|Any CPU.ActiveCfg = Release|Any CPU
53-
{6A1D0B77-BBF2-415E-B3A8-FAB00879F07C}.Release|Any CPU.Build.0 = Release|Any CPU
5448
{8B6E367C-E472-4E68-98D2-968CFCF6939D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5549
{8B6E367C-E472-4E68-98D2-968CFCF6939D}.Debug|Any CPU.Build.0 = Debug|Any CPU
5650
{8B6E367C-E472-4E68-98D2-968CFCF6939D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -79,20 +73,33 @@ Global
7973
{D94A4535-51B3-4E70-9582-3F3A44C7A798}.Debug|Any CPU.Build.0 = Debug|Any CPU
8074
{D94A4535-51B3-4E70-9582-3F3A44C7A798}.Release|Any CPU.ActiveCfg = Release|Any CPU
8175
{D94A4535-51B3-4E70-9582-3F3A44C7A798}.Release|Any CPU.Build.0 = Release|Any CPU
76+
{27DB8F65-4848-4EA6-A7F2-86EF00D585FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77+
{27DB8F65-4848-4EA6-A7F2-86EF00D585FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
78+
{27DB8F65-4848-4EA6-A7F2-86EF00D585FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
79+
{27DB8F65-4848-4EA6-A7F2-86EF00D585FD}.Release|Any CPU.Build.0 = Release|Any CPU
80+
{63AFFE3B-A427-40B4-8079-CE6E6F1E8223}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
81+
{63AFFE3B-A427-40B4-8079-CE6E6F1E8223}.Debug|Any CPU.Build.0 = Debug|Any CPU
82+
{63AFFE3B-A427-40B4-8079-CE6E6F1E8223}.Release|Any CPU.ActiveCfg = Release|Any CPU
83+
{63AFFE3B-A427-40B4-8079-CE6E6F1E8223}.Release|Any CPU.Build.0 = Release|Any CPU
84+
{08919E1A-D277-4F26-A85B-05CC736508BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
85+
{08919E1A-D277-4F26-A85B-05CC736508BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
86+
{08919E1A-D277-4F26-A85B-05CC736508BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
87+
{08919E1A-D277-4F26-A85B-05CC736508BB}.Release|Any CPU.Build.0 = Release|Any CPU
8288
EndGlobalSection
8389
GlobalSection(SolutionProperties) = preSolution
8490
HideSolutionNode = FALSE
8591
EndGlobalSection
8692
GlobalSection(NestedProjects) = preSolution
8793
{1E11DA86-D43D-4CF7-94F5-B4565450BF4C} = {E5C31FAF-7DEF-494F-A0D2-C9A4875F2132}
88-
{A8C1D36B-77FA-4D9B-893E-226FA2786D31} = {638B1C16-782F-4C91-A09C-3569957356DF}
89-
{6A1D0B77-BBF2-415E-B3A8-FAB00879F07C} = {638B1C16-782F-4C91-A09C-3569957356DF}
9094
{8B6E367C-E472-4E68-98D2-968CFCF6939D} = {638B1C16-782F-4C91-A09C-3569957356DF}
9195
{EAC50129-EF2E-4E7B-98D0-64502E97ED8B} = {638B1C16-782F-4C91-A09C-3569957356DF}
9296
{7C65AEA1-8CA2-48DC-81FE-CE39295BDD4B} = {E5C31FAF-7DEF-494F-A0D2-C9A4875F2132}
9397
{CEA7A89F-CF8E-4128-927E-24CBBF2C8C63} = {E5C31FAF-7DEF-494F-A0D2-C9A4875F2132}
9498
{8E335572-CD8B-4879-8760-73416CF103B1} = {E5C31FAF-7DEF-494F-A0D2-C9A4875F2132}
9599
{D94A4535-51B3-4E70-9582-3F3A44C7A798} = {E5C31FAF-7DEF-494F-A0D2-C9A4875F2132}
100+
{27DB8F65-4848-4EA6-A7F2-86EF00D585FD} = {E5C31FAF-7DEF-494F-A0D2-C9A4875F2132}
101+
{63AFFE3B-A427-40B4-8079-CE6E6F1E8223} = {638B1C16-782F-4C91-A09C-3569957356DF}
102+
{08919E1A-D277-4F26-A85B-05CC736508BB} = {638B1C16-782F-4C91-A09C-3569957356DF}
96103
EndGlobalSection
97104
GlobalSection(ExtensibilityGlobals) = postSolution
98105
SolutionGuid = {38E2A588-0714-41E7-9BA3-D89622560FF9}

packages/blazor-workspace/Examples/Demo.Client/Demo.Client.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
@@ -12,8 +12,8 @@
1212
<Content Remove="packages.lock.json" />
1313
</ItemGroup>
1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.33" />
16-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.33" PrivateAssets="all" />
15+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.10" />
16+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.10" PrivateAssets="all" />
1717
</ItemGroup>
1818

1919
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -32,7 +32,7 @@
3232
<None Include="packages.lock.json">
3333
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
3434
</None>
35-
<PackageReference Include="NI.CSharp.Analyzers" Version="[2.0.21]" />
35+
<PackageReference Include="NI.CSharp.Analyzers" Version="2.0.27" />
3636
</ItemGroup>
3737

3838
<ItemGroup>

packages/blazor-workspace/Examples/Demo.Client/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
44

55
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6-
builder.RootComponents.Add<App>("#app");
6+
builder.RootComponents.Add<Routes>("#app");
77
builder.RootComponents.Add<HeadOutlet>("head::after");
88

99
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

0 commit comments

Comments
 (0)