File tree 2 files changed +16
-2
lines changed
test/testassets/Components.TestServer
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ namespace Microsoft.AspNetCore.Components.Routing;
5
5
6
6
internal static class RegexConstraintSupport
7
7
{
8
- public static bool IsEnabled =>
9
- AppContext . TryGetSwitch ( "Microsoft.AspNetCore.Components.Routing.RegexConstraintSupport" , out var enabled ) && enabled ;
8
+ // We should check the AppContext switch in the implementation, but it doesn't flow to the wasm runtime
9
+ // during development, so we can't offer a better experience (build time message to enable the switch)
10
+ // until the context switch flows to the runtime.
11
+ // This value gets updated by the linker when the app is trimmed, so the code will always be removed from
12
+ // webassembly unless the switch is enabled.
13
+ public static bool IsEnabled => true ;
14
+ // AppContext.TryGetSwitch("Microsoft.AspNetCore.Components.Routing.RegexConstraintSupport", out var enabled) && enabled;
10
15
}
Original file line number Diff line number Diff line change 7
7
<BlazorWebAssemblyLoadAllGlobalizationData >true</BlazorWebAssemblyLoadAllGlobalizationData >
8
8
<Nullable >annotations</Nullable >
9
9
<RazorLangVersion >latest</RazorLangVersion >
10
+ <BlazorRoutingEnableRegexConstraint >true</BlazorRoutingEnableRegexConstraint >
11
+ <BlazorRoutingEnableRegexConstraint Condition =" '$(BlazorRoutingEnableRegexConstraint)' == ''" >false</BlazorRoutingEnableRegexConstraint >
10
12
</PropertyGroup >
11
13
14
+ <ItemGroup >
15
+ <RuntimeHostConfigurationOption Include =" Microsoft.AspNetCore.Components.Routing.RegexConstraintSupport"
16
+ Condition =" '$(BlazorRoutingEnableRegexConstraint)' != ''"
17
+ Value =" $(BlazorRoutingEnableRegexConstraint)"
18
+ Trim =" true" />
19
+ </ItemGroup >
20
+
12
21
<ItemGroup >
13
22
<Reference Include =" Microsoft.AspNetCore" />
14
23
<Reference Include =" Microsoft.AspNetCore.Authentication.Cookies" />
You can’t perform that action at this time.
0 commit comments