aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

API proposal for new JS interop methods

Open javiercn opened this issue 5 months ago • 1 comments

+Microsoft.AspNetCore.Components.Web.Internal.IInternalWebJSInProcessRuntime.InvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> string!

+override Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.BeginInvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> void +override Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> string!

+abstract Microsoft.JSInterop.JSInProcessRuntime.InvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> string? +abstract Microsoft.JSInterop.JSRuntime.BeginInvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> void +Microsoft.JSInterop.IJSInProcessObjectReference.GetValue<TValue>(string! identifier) -> TValue +Microsoft.JSInterop.IJSInProcessObjectReference.InvokeNew(string! identifier, object?[]? args) -> Microsoft.JSInterop.IJSInProcessObjectReference! +Microsoft.JSInterop.IJSInProcessObjectReference.SetValue<TValue>(string! identifier, TValue value) -> void +Microsoft.JSInterop.IJSInProcessRuntime.GetValue<TValue>(string! identifier) -> TValue +Microsoft.JSInterop.IJSInProcessRuntime.InvokeNew(string! identifier, params object?[]? args) -> Microsoft.JSInterop.IJSInProcessObjectReference! +Microsoft.JSInterop.IJSInProcessRuntime.SetValue<TValue>(string! identifier, TValue value) -> void +Microsoft.JSInterop.IJSObjectReference.GetValueAsync<TValue>(string! identifier) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.IJSObjectReference.GetValueAsync<TValue>(string! identifier, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.IJSObjectReference.InvokeNewAsync(string! identifier, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.IJSObjectReference.InvokeNewAsync(string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.IJSObjectReference.SetValueAsync<TValue>(string! identifier, TValue value) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.IJSObjectReference.SetValueAsync<TValue>(string! identifier, TValue value, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.IJSRuntime.GetValueAsync<TValue>(string! identifier) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.IJSRuntime.GetValueAsync<TValue>(string! identifier, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.IJSRuntime.InvokeNewAsync(string! identifier, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.IJSRuntime.InvokeNewAsync(string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.IJSRuntime.SetValueAsync<TValue>(string! identifier, TValue value) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.IJSRuntime.SetValueAsync<TValue>(string! identifier, TValue value, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.Implementation.JSInProcessObjectReference.GetValue<TValue>(string! identifier) -> TValue +Microsoft.JSInterop.Implementation.JSInProcessObjectReference.InvokeNew(string! identifier, object?[]? args) -> Microsoft.JSInterop.IJSInProcessObjectReference! +Microsoft.JSInterop.Implementation.JSInProcessObjectReference.SetValue<TValue>(string! identifier, TValue value) -> void +Microsoft.JSInterop.Implementation.JSObjectReference.GetValueAsync<TValue>(string! identifier) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.Implementation.JSObjectReference.GetValueAsync<TValue>(string! identifier, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.Implementation.JSObjectReference.InvokeNewAsync(string! identifier, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.Implementation.JSObjectReference.InvokeNewAsync(string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.Implementation.JSObjectReference.SetValueAsync<TValue>(string! identifier, TValue value) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.Implementation.JSObjectReference.SetValueAsync<TValue>(string! identifier, TValue value, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.Infrastructure.JSCallType +Microsoft.JSInterop.Infrastructure.JSCallType.FunctionCall = 1 -> Microsoft.JSInterop.Infrastructure.JSCallType +Microsoft.JSInterop.Infrastructure.JSCallType.GetValue = 3 -> Microsoft.JSInterop.Infrastructure.JSCallType +Microsoft.JSInterop.Infrastructure.JSCallType.NewCall = 2 -> Microsoft.JSInterop.Infrastructure.JSCallType +Microsoft.JSInterop.Infrastructure.JSCallType.SetValue = 4 -> Microsoft.JSInterop.Infrastructure.JSCallType +Microsoft.JSInterop.Infrastructure.JSInvocationInfo +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.ArgsJson.get -> string! +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.ArgsJson.init -> void +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.AsyncHandle.get -> long +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.AsyncHandle.init -> void +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.CallType.get -> Microsoft.JSInterop.Infrastructure.JSCallType +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.CallType.init -> void +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.Identifier.get -> string! +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.Identifier.init -> void +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.JSInvocationInfo() -> void +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.ResultType.get -> Microsoft.JSInterop.JSCallResultType +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.ResultType.init -> void +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.TargetInstanceId.get -> long +Microsoft.JSInterop.Infrastructure.JSInvocationInfo.TargetInstanceId.init -> void +Microsoft.JSInterop.JSInProcessRuntime.GetValue<TValue>(string! identifier) -> TValue +Microsoft.JSInterop.JSInProcessRuntime.InvokeNew(string! identifier, params object?[]? args) -> Microsoft.JSInterop.IJSInProcessObjectReference! +Microsoft.JSInterop.JSInProcessRuntime.SetValue<TValue>(string! identifier, TValue value) -> void +Microsoft.JSInterop.JSRuntime.GetValueAsync<TValue>(string! identifier) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.JSRuntime.GetValueAsync<TValue>(string! identifier, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<TValue> +Microsoft.JSInterop.JSRuntime.InvokeNewAsync(string! identifier, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.JSRuntime.InvokeNewAsync(string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +Microsoft.JSInterop.JSRuntime.SetValueAsync<TValue>(string! identifier, TValue value) -> System.Threading.Tasks.ValueTask +Microsoft.JSInterop.JSRuntime.SetValueAsync<TValue>(string! identifier, TValue value, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +static Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSObjectReference! jsObjectReference, string! identifier, params object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +static Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSObjectReference! jsObjectReference, string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +static Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSObjectReference! jsObjectReference, string! identifier, System.TimeSpan timeout, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +static Microsoft.JSInterop.JSRuntimeExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSRuntime! jsRuntime, string! identifier, params object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +static Microsoft.JSInterop.JSRuntimeExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSRuntime! jsRuntime, string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!> +static Microsoft.JSInterop.JSRuntimeExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSRuntime! jsRuntime, string! identifier, System.TimeSpan timeout, object?[]? args) -> System.Threading.Tasks.ValueTask<Microsoft.JSInterop.IJSObjectReference!>

javiercn avatar Jun 17 '25 12:06 javiercn

Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:

  • The PR contains changes to the reference-assembly that describe the API change. Or, you have included a snippet of reference-assembly-style code that illustrates the API change.
  • The PR describes the impact to users, both positive (useful new APIs) and negative (breaking changes).
  • Someone is assigned to "champion" this change in the meeting, and they understand the impact and design of the change.

I have split the proposal into two issues to handle the "user-facing" and "internal" layer separately:

  • https://github.com/dotnet/aspnetcore/issues/62454
  • https://github.com/dotnet/aspnetcore/issues/62455

oroztocil avatar Jun 24 '25 07:06 oroztocil