Use a manual renderer to fix prerendering #277
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When rendering the static part of a page defined with Bolero.Html, prerendering does not work (see #261). It seems that using Blazor's renderer in a nested way (first for the page component, and then inside for the
rootComp
component) is not supported: the nested rendering gets queued as a task, and executed too late.This PR fixes this issue by using a simple custom renderer for the page instead of invoking Blazor's RenderComponentAsync.
rootComp
can no longer prerender? [version 0.20.*] #261rootComp
, because with this new renderer,comp
can be used directly.Bolero.Server.Components.Rendering.renderPlain : Node -> string
which renders a Node into a string (see Is there any option ho to get raw HTML? #275). Components are ignored, including boleroScript.