Skip to content

Commit 6d7ae8c

Browse files
Copilotjaviercn
andcommitted
Remove additional obsolete APIs from Components.WebAssembly
Co-authored-by: javiercn <[email protected]>
1 parent a1d12ed commit 6d7ae8c

12 files changed

+11
-167
lines changed

src/Components/WebAssembly/JSInterop/src/InternalCalls.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using System.Diagnostics.CodeAnalysis;
5-
using System.Runtime.CompilerServices;
64
using System.Runtime.InteropServices.JavaScript;
75

86
namespace WebAssembly.JSInterop;
97

108
internal static partial class InternalCalls
119
{
12-
// This method only exists for backwards compatibility and will be removed in the future.
13-
// The exact namespace, type, and method name must match the corresponding entries
14-
// in driver.c in the Mono distribution.
15-
// See: https://github.com/mono/mono/blob/90574987940959fe386008a850982ea18236a533/sdks/wasm/src/driver.c#L318-L319
16-
[MethodImpl(MethodImplOptions.InternalCall)]
17-
[Obsolete]
18-
public static extern TRes InvokeJS<T0, T1, T2, TRes>(out string exception, ref JSCallInfo callInfo, [AllowNull] T0 arg0, [AllowNull] T1 arg1, [AllowNull] T2 arg2);
19-
2010
[JSImport("Blazor._internal.invokeJSJson", "blazor-internal")]
2111
public static partial string InvokeJSJson(
2212
string identifier,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
#nullable enable
2+
*REMOVED*Microsoft.AspNetCore.Components.WebAssembly.Authentication.AccessTokenResult.AccessTokenResult(Microsoft.AspNetCore.Components.WebAssembly.Authentication.AccessTokenResultStatus status, Microsoft.AspNetCore.Components.WebAssembly.Authentication.AccessToken! token, string! redirectUrl) -> void
3+
*REMOVED*Microsoft.AspNetCore.Components.WebAssembly.Authentication.AccessTokenResult.RedirectUrl.get -> string?
4+
*REMOVED*Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService<TRemoteAuthenticationState, TAccount, TProviderOptions>.RemoteAuthenticationService(Microsoft.JSInterop.IJSRuntime! jsRuntime, Microsoft.Extensions.Options.IOptionsSnapshot<Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationOptions<TProviderOptions>!>! options, Microsoft.AspNetCore.Components.NavigationManager! navigation, Microsoft.AspNetCore.Components.WebAssembly.Authentication.AccountClaimsPrincipalFactory<TAccount!>! accountClaimsPrincipalFactory) -> void
5+
*REMOVED*Microsoft.AspNetCore.Components.WebAssembly.Authentication.SignOutSessionStateManager
6+
*REMOVED*Microsoft.AspNetCore.Components.WebAssembly.Authentication.SignOutSessionStateManager.SignOutSessionStateManager(Microsoft.JSInterop.IJSRuntime! jsRuntime) -> void
7+
*REMOVED*virtual Microsoft.AspNetCore.Components.WebAssembly.Authentication.SignOutSessionStateManager.SetSignOutState() -> System.Threading.Tasks.ValueTask
8+
*REMOVED*virtual Microsoft.AspNetCore.Components.WebAssembly.Authentication.SignOutSessionStateManager.ValidateSignOutState() -> System.Threading.Tasks.Task<bool>!

src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ public RemoteAuthenticationApplicationPathsOptions ApplicationPaths
106106

107107
[Inject] internal AuthenticationStateProvider AuthenticationProvider { get; set; } = default!;
108108

109-
#pragma warning disable CS0618 // Type or member is obsolete, we keep it for now for backwards compatibility
110-
[Inject] internal SignOutSessionStateManager SignOutManager { get; set; } = default!;
111-
#pragma warning restore CS0618 // Type or member is obsolete, we keep it for now for backwards compatibility
112-
113109
[Inject] internal ILogger<RemoteAuthenticatorViewCore<TAuthenticationState>> Logger { get; set; } = default!;
114110

115111
/// <inheritdoc />
@@ -282,9 +278,7 @@ private async Task ProcessLogInCallback()
282278

283279
private async Task ProcessLogOut(string returnUrl)
284280
{
285-
if ((Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) ||
286-
// For backcompat purposes, keep SignOutManager working, even though we now use the history.state for this.
287-
(Navigation.HistoryEntryState == null && !await SignOutManager.ValidateSignOutState()))
281+
if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState())
288282
{
289283
Log.LogoutOperationInitiatedExternally(Logger);
290284
Navigation.NavigateTo(ApplicationPaths.LogOutFailedPath, AuthenticationNavigationOptions with { HistoryEntryState = "The logout was not initiated from within the page." });

src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AccessTokenNotAvailableException.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ public void Redirect()
4141
}
4242
else
4343
{
44-
#pragma warning disable CS0618 // Type or member is obsolete
45-
_navigation.NavigateTo(_tokenResult.RedirectUrl!);
46-
#pragma warning restore CS0618 // Type or member is obsolete
44+
_navigation.NavigateTo(_tokenResult.InteractiveRequestUrl!);
4745
}
4846
}
4947

src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AccessTokenResult.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ public class AccessTokenResult
1212
{
1313
private readonly AccessToken _token;
1414

15-
/// <summary>
16-
/// Initializes a new instance of <see cref="AccessTokenResult"/>.
17-
/// </summary>
18-
/// <param name="status">The status of the result.</param>
19-
/// <param name="token">The <see cref="AccessToken"/> in case it was successful.</param>
20-
/// <param name="redirectUrl">The redirect uri to go to for provisioning the token.</param>
21-
[Obsolete("Use the AccessTokenResult(AccessTokenResultStatus, AccessToken, string, InteractiveRequestOptions)")]
22-
public AccessTokenResult(AccessTokenResultStatus status, AccessToken token, [StringSyntax(StringSyntaxAttribute.Uri)] string redirectUrl)
23-
{
24-
Status = status;
25-
_token = token;
26-
RedirectUrl = redirectUrl;
27-
}
28-
2915
/// <summary>
3016
/// Initializes a new instance of <see cref="AccessTokenResult"/>.
3117
/// </summary>
@@ -46,12 +32,6 @@ public AccessTokenResult(AccessTokenResultStatus status, AccessToken token, [Str
4632
/// </summary>
4733
public AccessTokenResultStatus Status { get; }
4834

49-
/// <summary>
50-
/// Gets the URL to redirect to if <see cref="Status"/> is <see cref="AccessTokenResultStatus.RequiresRedirect"/>.
51-
/// </summary>
52-
[Obsolete("Use 'InteractiveRequestUrl' and 'InteractiveRequest' instead.")]
53-
public string? RedirectUrl { get; }
54-
5535
/// <summary>
5636
/// Gets the URL to call <see cref="NavigationManagerExtensions.NavigateToLogin(NavigationManager, string, InteractiveRequestOptions)"/> if <see cref="Status"/> is
5737
/// <see cref="AccessTokenResultStatus.RequiresRedirect"/>.

src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,6 @@ public class RemoteAuthenticationService<
5757
/// </summary>
5858
protected RemoteAuthenticationOptions<TProviderOptions> Options { get; }
5959

60-
/// <summary>
61-
/// Initializes a new instance.
62-
/// </summary>
63-
/// <param name="jsRuntime">The <see cref="IJSRuntime"/> to use for performing JavaScript interop operations.</param>
64-
/// <param name="options">The options to be passed down to the underlying JavaScript library handling the authentication operations.</param>
65-
/// <param name="navigation">The <see cref="NavigationManager"/> used to generate URLs.</param>
66-
/// <param name="accountClaimsPrincipalFactory">The <see cref="AccountClaimsPrincipalFactory{TAccount}"/> used to generate the <see cref="ClaimsPrincipal"/> for the user.</param>
67-
[Obsolete("Use the constructor RemoteAuthenticationService(IJSRuntime,IOptionsSnapshot<RemoteAuthenticationOptions<TProviderOptions>>,NavigationManager,AccountClaimsPrincipalFactory<TAccount>,ILogger<RemoteAuthenticationService<TRemoteAuthenticationState, TAccount, TProviderOptions>>) instead.")]
68-
public RemoteAuthenticationService(
69-
IJSRuntime jsRuntime,
70-
IOptionsSnapshot<RemoteAuthenticationOptions<TProviderOptions>> options,
71-
NavigationManager navigation,
72-
AccountClaimsPrincipalFactory<TAccount> accountClaimsPrincipalFactory)
73-
: this(jsRuntime, options, navigation, accountClaimsPrincipalFactory, null)
74-
{
75-
}
76-
7760
/// <summary>
7861
/// Initializes a new instance.
7962
/// </summary>

src/Components/WebAssembly/WebAssembly.Authentication/src/Services/SignOutSessionStateManager.cs

Lines changed: 0 additions & 88 deletions
This file was deleted.

src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ public static IRemoteAuthenticationBuilder<TRemoteAuthenticationState, TAccount>
7171

7272
services.TryAddScoped<IRemoteAuthenticationPathsProvider, DefaultRemoteApplicationPathsProvider<TProviderOptions>>();
7373
services.TryAddScoped<IAccessTokenProviderAccessor, AccessTokenProviderAccessor>();
74-
#pragma warning disable CS0618 // Type or member is obsolete, we keep it for now for backwards compatibility
75-
services.TryAddScoped<SignOutSessionStateManager>();
76-
#pragma warning restore CS0618 // Type or member is obsolete, we keep it for now for backwards compatibility
7774

7875
services.TryAddScoped<AccountClaimsPrincipalFactory<TAccount>>();
7976

src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,6 @@ private static async ValueTask ApplyPreviousDeltasAsync(HotReloadAgent agent)
130130
private static HotReloadAgent? GetAgent()
131131
=> s_hotReloadAgent ?? (s_initialized ? throw new InvalidOperationException("Hot Reload agent not initialized") : null);
132132

133-
/// <summary>
134-
/// For framework use only.
135-
/// </summary>
136-
[Obsolete("Use ApplyHotReloadDeltas instead")]
137-
[JSInvokable(nameof(ApplyHotReloadDelta))]
138-
public static void ApplyHotReloadDelta(string moduleIdString, byte[] metadataDelta, byte[] ilDelta, byte[] pdbBytes, int[]? updatedTypes)
139-
{
140-
GetAgent()?.ApplyDeltas(
141-
[new UpdateDelta(Guid.Parse(moduleIdString, CultureInfo.InvariantCulture), metadataDelta, ilDelta, pdbBytes, updatedTypes ?? [])]);
142-
}
143-
144133
/// <summary>
145134
/// For framework use only.
146135
/// </summary>

src/Components/WebAssembly/WebAssembly/src/Infrastructure/JSInteropMethods.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Infrastructure;
1414
[EditorBrowsable(EditorBrowsableState.Never)]
1515
public static class JSInteropMethods
1616
{
17-
/// <summary>
18-
/// For framework use only.
19-
/// </summary>
20-
[Obsolete("This API is for framework use only and is no longer used in the current version")]
21-
public static void NotifyLocationChanged(string uri, bool isInterceptedLink)
22-
=> WebAssemblyNavigationManager.Instance.SetLocation(uri, null, isInterceptedLink);
23-
2417
/// <summary>
2518
/// For framework use only.
2619
/// </summary>

0 commit comments

Comments
 (0)