Skip to content

Conversation

@javiercn
Copy link
Member

The current pipeline is common for MapRazorComponents and RazorComponentResults which add extra complexity to MapRazorComponents which we expect to be the common case.

The change splits the pipeline in two, so that we can simplify the pipeline for MapRazorComponents, where we can make assumptions that are not possible in RazorComponentResult.

This change introduces RazorComponentEndpointInvoker to capture all the required state that is needed for rendering the component endpoint and avoid additional closures from captured state caused by calling Dispatcher.InvokeAsync.

We also guarantee that we only call DispatchAsync once at the root level to enter the synchronization context.

Finally, we skip over all the render modes and preserve prerendered component state mode update, since that's not needed at this level.

The current pipeline is common for MapRazorComponents and
RazorComponentResults which add extra complexity to MapRazorComponents
which we expect to be the common case.

The change splits the pipeline in two, so that we can simplify the
pipeline for MapRazorComponents, where we can make assumptions that
are not possible in RazorComponentResult.

This change introduces RazorComponentEndpointInvoker to capture all the
required state that is needed for rendering the component endpoint and
avoid additional closures from captured state caused by calling
Dispatcher.InvokeAsync.

We also guarantee that we only call `DispatchAsync` once at the root
level to enter the synchronization context.

Finally, we skip over all the render modes and preserve prerendered
component state mode update, since that's not needed at this level.
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Apr 11, 2023
@javiercn javiercn marked this pull request as ready for review April 11, 2023 19:13
@javiercn javiercn requested a review from a team as a code owner April 11, 2023 19:13
Copy link
Member

@MackinnonBuck MackinnonBuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small question but looks great to me!

@javiercn javiercn merged commit 7a0d0de into main Apr 13, 2023
@javiercn javiercn deleted the javiercn/blazor-forms-support branch April 13, 2023 17:52
@ghost ghost added this to the 8.0-preview4 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants