Skip to content

Routing enhancements #5489

@SteveSandersonMS

Description

@SteveSandersonMS

This issue is to track routing features we're likely to want to add in the future:

  • Review exactly which parameter constraints we really want to support. For example maybe add regex; maybe remove bool or limit the set of datetime formats more precisely. See Basic route constraints (:int, etc.) blazor#295 for more discussion.
  • Catch-all segments (e.g., /products/{*categoryAndName})
  • 404 handler (it's probably not enough just to have a component that matches /{*anythingElse}, because for SSR you'd want to know it's really not a match so you could actually return a 404) - Done!
  • Simple method for accessing querystring/hash values (e.g., via new properties on IUriHelper)
  • Multiple nested routers
  • Outbound URL generation (e.g., <a page=@About>About us</a>, or perhaps just by codegenning methods like <a href=@Products.Url(53)>Duck boots</a> for each @page declaration)
  • In the @page directive, allow the use of compile-time constant expressions, not just literal strings (e.g., https://github.com/aspnet/blazor/issues/1363).
  • Optional route parameters

Also the items from dotnet/blazor#636 that were not yet finalised:

  • Discover [Route] attributes on types in referenced assemblies that themselves reference Microsoft.AspNetCore.Blazor transitively
  • Discover [Route] attributes on component base classes (i.e., inherit=true)
  • In the Router component, make it simple to subclass and override a virtual method to change the logic for locating the IComponent for a given URL. Currently there's no virtual method for this.
  • Make RouteTable's Routes property get-only
  • Cache route tables per assembly

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing one

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions