dotnet / dotnet/aspnetcore

Consider using C#9 Source Generators for implementing SetParametersAsync

Open
#29,550 14 comments 13 reactions 1 assignee Claimed by @javiercn View on GitHub
affected-most area-blazor enhancement feature-blazor-component-model feature-rendering Pillar: Technical Debt Priority:1 severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

The performance best practices here talk about a custom implementation of SetParametersAsync instead of using reflection:
https://docs.microsoft.com/en-us/aspnet/core/blazor/webassembly-performance-best-practices?view=aspnetcore-5.0#implement-setparametersasync-manually

@stefanloerwald has built a lib that uses C#9 source generators that shows significant perf improvements:
https://github.com/excubo-ag/Generators.Blazor

Could that be an approach to include into the Blazor framework?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.