dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.43k stars 10.01k forks source link

[Blazor] Enable creating dynamic routes #45396

Open aurnor opened 1 year ago

aurnor commented 1 year ago

Is there an existing issue for this?

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

This is not a problem in Blazor, but a feature request.

Scenario A Blazor component is created in a Razor Class Library, with its own route:

@page "/parameters"  
<div>My parameters page</div>

This external component is imported in a Blazor app with AdditionalAssemblies parameter:

<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true" AdditionalAssemblies="@MyAssembliesList">

The goal is that the Blazor app can choose a different route to this external component (from config file for example).

Currently routing is static on Blazor applications. The routes get defined on pages that are stamped as attributes on the component types and attribute types must be compile time constants.

This prevents creating a custom route for this external component from the main Blazor app.

Describe the solution you'd like

Make routes dynamic so that this kind of scenario is possible.

Additional context

No response

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

mihaimyh commented 1 year ago

Could you also support dynamic routing in the sense that routes can be defined at runtime, best populated from a db table, similar like a CMS works?

ghost commented 11 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.