Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor] Enable regex constraint on the Blazor router #53533

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

javiercn
Copy link
Member

[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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jan 22, 2024
Base automatically changed from javiercn/issue53138 to main January 22, 2024 18:56
@javiercn javiercn marked this pull request as ready for review January 25, 2024 11:33
@javiercn javiercn requested a review from a team as a code owner January 25, 2024 11:33
@javiercn javiercn force-pushed the javiercn/enable-regex-constraint branch 2 times, most recently from fb37227 to d3b20c9 Compare January 25, 2024 17:48
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.
@javiercn javiercn force-pushed the javiercn/enable-regex-constraint branch from d3b20c9 to 788a28c Compare January 25, 2024 19:02
@javiercn
Copy link
Member Author

This should now be ok for review

Copy link
Member

@MackinnonBuck MackinnonBuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@javiercn javiercn merged commit f51ae60 into main Feb 1, 2024
@javiercn javiercn deleted the javiercn/enable-regex-constraint branch February 1, 2024 17:51
@ghost ghost added this to the 9.0-preview2 milestone Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants