Skip to content

Commit

Permalink
Upgrade sample projects to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcparkyn committed Nov 17, 2023
1 parent 08990f9 commit dc890e1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
NETCORE_VERSION: |
6.0.x
7.0.x
8.0.x
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUGET_FEED: https://api.nuget.org/v3/index.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
NETCORE_VERSION: |
6.0.x
7.0.x
8.0.x
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUGET_FEED: https://api.nuget.org/v3/index.json
Expand Down
8 changes: 4 additions & 4 deletions samples/HackerNewsClient/HackerNewsClient.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions samples/HackerNewsClient/Shared/Comment.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
grid-template-columns: min-content fit-content(100%);
grid-template-rows: auto auto;
align-items: baseline;
scroll-margin-top: 100px;
}

.comment-content {
Expand Down
4 changes: 2 additions & 2 deletions samples/HackerNewsClient/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<script src="_framework/blazor.webassembly.js"></script>
<script>
function scrollIntoView(element) {
window.location.hash = element.id; // Sets the page target
element.scrollIntoView({ block: "center" });
// Sets the page target. Blazor will automatically scroll to it.
window.location.hash = element.id;
}
</script>
</body>
Expand Down
10 changes: 5 additions & 5 deletions samples/PhetchBlazorDemo/PhetchBlazorDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.2" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.0.6" />
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.11.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/PhetchBlazorDemo/Shared/LocalStorageCounterApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public LocalStorageCounterApi(ILocalStorageService localStorage)
{
// More artificial delay
await Task.Delay(Random.Shared.Next(1000), ct);
return await localStorage.GetItemAsync<int>("counterVal");
return await localStorage.GetItemAsync<int>("counterVal", ct);
}
);
SetCounterValue = new(
async (val, ct) =>
{
// Add artificial delay to make the loading effect visible (don't do this in a real application).
await Task.Delay(Random.Shared.Next(1000), ct);
await localStorage.SetItemAsync("counterVal", val);
await localStorage.SetItemAsync("counterVal", val, ct);
GetCounterValue.UpdateQueryData(new Unit(), val);
}
);
Expand Down
12 changes: 6 additions & 6 deletions test/Phetch.Blazor.Tests/Phetch.Blazor.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="bunit" Version="1.21.9" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.20.0">
<PackageReference Include="bunit" Version="1.25.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.26.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit dc890e1

Please sign in to comment.