Skip to content

Support rendering components outside of the HttpContext #38114

@javiercn

Description

@javiercn

There has been a historical ask to be able to render UI using Razor without being in the context of a web application. Many of these requests are based on things like generating HTML fragments for sending emails or even generating content for sites statically.

In the past, we've relied on "tricks/hacks" to the Razor View Engine to guide customers on how to accomplish this. However all those "hacks" are very involved and require a lot of setup. Components offer an opportunity to do this with much upfront cost for us and our customers, since they don't have any dependency on the request primitives like the Razor View Engine does.

Being able to have this support also helps with the idea of being able to render root components from ASP.NET Core in the same way we do Razor pages/views and offers several advantages for prerendering scenarios (like dealing with meta/title/etc without hacks) and a path forward for a lighter way of authoring UIs within ASP.NET Core applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:1Work that is critical for the release, but we could probably ship withoutarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-prerenderingIssues related to prerendering blazor components

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions