This public feature request:
- Explains how the TelerikRootComponent works.
- Outlines the problems of the current software design in static .NET 8 Blazor apps.
- Measures customer demand for a major change that may possibly resolve the current limitations.
How the TelerikRootComponent Works
Historically, the TelerikRootComponent was designed with the following purposes:
- To host and render all Telerik Blazor popups as RenderFragments. This means that all popups are rendered where the TelerikRootComponent is defined in the application's component hierarchy. In most cases, correct popup position requires the TelerikRootComponent to wrap all the content on the web page. Otherwise the correct position is not guaranteed and this is documented. In addition, the TelerikRootComponent instance is a CascadingValue, which allows it to collect all popup RenderFragments.
- The TelerikRootComponent exposes parameters for global application-wide Telerik settings, such as icon type or RTL support. This is another reason why it makes sense to have a single TelerikRootComponent that wraps all the page content.
Problems and Limitations in .NET 8 Blazor Static Apps
.NET 8 Blazor apps with "Per Component" interactivity location create a big challenge for the above state of affairs:
- Cascading values do not pass across render mode boundaries. .NET 8 includes a new feature for passing cascading values to interactive components (builder.Services.AddCascadingValues()), but this mechanism does not support passing of RenderFragments, because they are not JSON serializable. This brings the requirement that the TelerikRootComponent is part of an interactive component hierarchy.
- When the TelerikRootComponent is in a non-layout .razor file, it triggers more re-renders than normally. They are related to internal MediaQuery instances and all popups, which the root component manages.
So, developers who work with a globally static app with specific interactive components ("islands of interactivity") may need to:
- Place the TelerikRootComponent somewhere inside the component hierarchy, so it can't wrap all the page content. This will lead to wrong popup position.
- Use multiple TelerikRootComponents. This requires to define the same parameters for each TelerikRootComponent instance.
Next Steps
All developers who develop static .NET 8 Blazor apps with "Per Component" interactivity location:
- Please vote for this feature request, so that we can measure how many customers are affected by the described limitations.
- Post here and describe:
- Why do you need to use apps with "Per Component" interactivity.
- Your specific challenges with the current TelerikRootComponent setup.