You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Blazor] Enable regex constraint in Blazor routing
This was discovered when working on the issue for #53138. The regex
constraint is not enabled by default on the blazor router.
As a result if a route uses a regex constraint, it will work on SSR but
will fail the moment the Blazor router tries to construct the route.
The fix enables the regex constraint on the blazor router,
unconditionally for server, and behind a feature flag for webassembly.
This is because enabling the regex constraint adds +80kb to the payload
due to the inclusion of the System.Text.RegularExpressions assembly.
<value>A route parameter uses the regex constraint, which isn't registered. If this application was configured using CreateSlimBuilder(...) or AddRoutingCore(...) then this constraint is not registered by default. To use the regex constraint, configure route options at app startup: services.Configure<RouteOptions>(options => options.SetParameterPolicy<RegexInlineRouteConstraint>("regex"));</value>
157
+
<value>A route parameter uses the regex constraint, which isn't registered. To enable it add the property 'BlazorRoutingEnableRegexConstraint' to your project file inside a `PropertyGroup`.</value>
[UnconditionalSuppressMessage("Trimming","IL2067",Justification="Application code does not get trimmed, and the framework does not define routable components.")]
0 commit comments