-
Notifications
You must be signed in to change notification settings - Fork 241
Update to latest Razor Slices #2038
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
Conversation
- Drop net7 support - Fix TargetFrameworkVersion condition
loggerFactory.AddConsole(o => o.TimestampFormat = "ss.ffff ").SetMinimumLevel(logLevel); | ||
loggerFactory | ||
.AddConsole() | ||
.AddConsoleFormatter<ConsoleFormatter, ConsoleFormatterOptions>(o => o.TimestampFormat = "ss.ffff") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was done to resolve an obsolete warning.
<ItemGroup> | ||
<PackageReference Include="Grpc.AspNetCore" Version="2.27.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Grpc.HttpApi" Version="0.1.0-alpha.20121.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Grpc.HttpApi" Version="0.1.0-alpha.20179.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done to quiet a NuGet warning about the previous stated version being unresolvable.
<PackageReference Include="Microsoft.Data.SqlClient" Version="$(MicrosoftDataSqlClientVersion90)" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(MicrosoftEntityFrameworkCoreSqliteVersion90)" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting.IIS" Version="$(MicrosoftAspNetCoreAppPackageVersion)" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting.IIS" Version="$(MicrosoftIISTestingVersion90)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this was a typo/copy-pasta that was causing a NuGet warning as the versions didn't line up.
</ItemGroup> | ||
|
||
<ItemGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '9.0'))"> | ||
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net9.0'))"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a build error that occurs when building the project without specifying a target framework, e.g. when building from VS 😄
app.MapGet("/fortunes", async (HttpContext context, Db db) => { | ||
var fortunes = await db.LoadFortunesRows(); | ||
var template = (RazorSliceHttpResult<List<Fortune>>)createFortunesTemplate(fortunes); | ||
var template = (RazorSliceHttpResult<List<Fortune>>)Fortunes.Create(fortunes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Razor Slices generates these template factory classes now.
using RazorSlices; | ||
|
||
namespace PlatformBenchmarks | ||
namespace PlatformBenchmarks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to file-scoped namespace declaration on this file.
Updates the Platform and Minimal TechEmpower benchmarks to the latest Razor Slices release that uses source generators and supports native AOT. Razor Slices doesn't support rendering to
IBufferWriter<byte>
anymore so had to changeChunkedBufferWriter
toChunkedPipeWriter
.Removed the
.net7.0
targets as we don't run those anymore and tweaked the version check condition in .csproj files to be compatible with multi-targeting builds.Also fixed the launch settings in the Platform project so it runs from VS.
Results after the change are within the usual noise margins, i.e. ~566K - ~630K RPS: