Skip to content

[Blazor] Expose Renderer Instance #18500

Open
@RemiBou

Description

@RemiBou

Is your feature request related to a problem? Please describe.

This is related to my question here #16874 (comment)

I think it would be a good idea to expose the current Renderer instances publicly so we can change the instance and write decorator around it.

Why is that needed ?

In the past few month I needed it for 2 reasons :

  • Implement MiniProfiler for Blazor, I cannot find any hook for measuring all the rendering. I did it with a base component class but this is far from being right or clean IMO.
  • When I tried to implement my own Form validation I wanted to access the component hierarchy (so in an input component I could easily get the parent form component), but couldn't find anyway to do this. You did it with cascading parameter.

Describe the solution you'd like

I see multiple ways for doing this :

Additional context

Renderer and ComponentState are huge classes and I would understand why you don't want to expose it (more documentation needed, more issues ...), maybe we can find a common ground with my third solution, this would be a great addition for library authors IMHO ? If we validate a design I can work on a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-component-modelAny feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)severity-blockingThis label is used by an internal tool

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions