Skip to content

Commit a5ca308

Browse files
committed
Fix the API Analyzer bug.
1 parent 58b6895 commit a5ca308

File tree

6 files changed

+36
-13
lines changed

6 files changed

+36
-13
lines changed

src/Components/Components/src/PublicAPI.Shipped.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ Microsoft.AspNetCore.Components.RouteView.RouteData.set -> void
445445
Microsoft.AspNetCore.Components.RouteView.RouteView() -> void
446446
Microsoft.AspNetCore.Components.RouteView.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) -> System.Threading.Tasks.Task!
447447
Microsoft.AspNetCore.Components.Routing.IHostEnvironmentNavigationManager
448+
Microsoft.AspNetCore.Components.Routing.IHostEnvironmentNavigationManager.Initialize(string! baseUri, string! uri) -> void
448449
Microsoft.AspNetCore.Components.Routing.INavigationInterception
449450
Microsoft.AspNetCore.Components.Routing.INavigationInterception.EnableNavigationInterceptionAsync() -> System.Threading.Tasks.Task!
450451
Microsoft.AspNetCore.Components.Routing.IRoutingStateProvider
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
#nullable enable
2-
3-
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFound() -> void
4-
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFoundCore() -> void
2+
Microsoft.AspNetCore.Components.IEndpointHtmlRenderer
3+
Microsoft.AspNetCore.Components.IEndpointHtmlRenderer.SetNotFoundResponse() -> void
54
Microsoft.AspNetCore.Components.NavigationManager.NotFoundEvent -> System.EventHandler<System.EventArgs!>!
5+
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFound() -> void
6+
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFoundAsync() -> System.Threading.Tasks.ValueTask<bool>
7+
Microsoft.AspNetCore.Components.NotFoundRenderingException
8+
Microsoft.AspNetCore.Components.NotFoundRenderingException.NotFoundRenderingException(string! message, System.Exception! innerException) -> void
9+
Microsoft.AspNetCore.Components.Routing.IHostEnvironmentNavigationManager.Initialize(string! baseUri, string! uri, Microsoft.AspNetCore.Components.IEndpointHtmlRenderer! renderer) -> void
610
Microsoft.AspNetCore.Components.Routing.NotFoundContext
7-
Microsoft.AspNetCore.Components.Routing.NotFoundContext.NotFoundContext() -> void
811
Microsoft.AspNetCore.Components.Routing.NotFoundContext.CancellationToken.get -> System.Threading.CancellationToken
912
Microsoft.AspNetCore.Components.Routing.NotFoundContext.CancellationToken.init -> void
13+
Microsoft.AspNetCore.Components.Routing.NotFoundContext.NotFoundContext() -> void
1014
Microsoft.AspNetCore.Components.Routing.NotFoundContext.PreventRendering() -> void
11-
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFound() -> void
12-
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFoundAsync() -> System.Threading.Tasks.ValueTask<bool>
1315
virtual Microsoft.AspNetCore.Components.NavigationManager.HandleNotFoundHandlerException(System.Exception! ex, Microsoft.AspNetCore.Components.Routing.NotFoundContext! context) -> void
14-
Microsoft.AspNetCore.Components.NotFoundRenderingException
15-
Microsoft.AspNetCore.Components.NotFoundRenderingException.NotFoundRenderingException(string! message, System.Exception! innerException) -> void
16-
Microsoft.AspNetCore.Components.IEndpointHtmlRenderer
17-
Microsoft.AspNetCore.Components.IEndpointHtmlRenderer.SetNotFoundResponse() -> void
18-
Microsoft.AspNetCore.Components.Routing.IHostEnvironmentNavigationManager.Initialize(string! baseUri, string! uri, Microsoft.AspNetCore.Components.IEndpointHtmlRenderer? renderer = null) -> void
16+
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFound() -> void
17+
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFoundCore() -> void

src/Components/Components/src/Routing/IHostEnvironmentNavigationManager.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ public interface IHostEnvironmentNavigationManager
1414
/// </summary>
1515
/// <param name="baseUri">The base URI.</param>
1616
/// <param name="uri">The absolute URI.</param>
17-
/// <param name="renderer">The optional renderer.</param>
18-
void Initialize(string baseUri, string uri, IEndpointHtmlRenderer? renderer = null);
17+
void Initialize(string baseUri, string uri);
18+
19+
/// <summary>
20+
/// Initializes the <see cref="NavigationManager" />.
21+
/// </summary>
22+
/// <param name="baseUri">The base URI.</param>
23+
/// <param name="uri">The absolute URI.</param>
24+
/// <param name="renderer">The renderer.</param>
25+
void Initialize(string baseUri, string uri, IEndpointHtmlRenderer renderer);
1926
}

src/Components/Endpoints/src/DependencyInjection/HttpNavigationManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ internal sealed class HttpNavigationManager : NavigationManager, IHostEnvironmen
99
{
1010
private IEndpointHtmlRenderer? _renderer;
1111

12+
void IHostEnvironmentNavigationManager.Initialize(string baseUri, string uri) => Initialize(baseUri, uri);
13+
1214
void IHostEnvironmentNavigationManager.Initialize(string baseUri, string uri, IEndpointHtmlRenderer? renderer)
1315
{
1416
Initialize(baseUri, uri);

src/Components/Endpoints/test/RazorComponentResultTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ class FakeDataProtector : IDataProtector
510510

511511
class FakeNavigationManager : NavigationManager, IHostEnvironmentNavigationManager
512512
{
513+
public new void Initialize(string baseUri, string uri)
514+
=> base.Initialize(baseUri, uri);
515+
513516
#nullable enable
514517
public void Initialize(string baseUri, string uri, IEndpointHtmlRenderer? renderer = null)
515518
=> base.Initialize(baseUri, uri);

src/Components/Server/src/Circuits/RemoteNavigationManager.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ public RemoteNavigationManager(ILogger<RemoteNavigationManager> logger)
3434
/// </summary>
3535
public bool HasAttachedJSRuntime => _jsRuntime != null;
3636

37+
/// <summary>
38+
/// Initializes the <see cref="NavigationManager" />.
39+
/// </summary>
40+
/// <param name="baseUri">The base URI.</param>
41+
/// <param name="uri">The absolute URI.</param>
42+
public new void Initialize(string baseUri, string uri)
43+
{
44+
base.Initialize(baseUri, uri);
45+
NotifyLocationChanged(isInterceptedLink: false);
46+
}
47+
3748
/// <summary>
3849
/// Initializes the <see cref="NavigationManager" />.
3950
/// </summary>

0 commit comments

Comments
 (0)