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

Support for [JSImport] in MAUI Blazor App #13551

Closed
orosbogdan opened this issue Feb 24, 2023 · 1 comment
Closed

Support for [JSImport] in MAUI Blazor App #13551

orosbogdan opened this issue Feb 24, 2023 · 1 comment
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView proposal/open

Comments

@orosbogdan
Copy link

orosbogdan commented Feb 24, 2023

Description

I would like to use [JSImport] in MAUI Blazor App to improve performance on JS interop calls.

Public API Changes

System.Runtime.InteropServices.JavaScript.JSImport

The attribute above should be supported in .NET MAUI Blazor Apps since it uses Blazor WASM behind the door.

JSHost.ImportAsync
Currently I am getting the following error when trying to achieve this "(System.Runtime.InteropServices.JavaScript is not supported on this platform.)"

Intended Use-Case

In my app I want to be able to transfer array with large number of elements efficiently between the C# layer and the JS layer. My app uses MAUI Blazor App.

@jfversluis jfversluis added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Feb 27, 2023
@javiercn
Copy link
Member

javiercn commented Mar 1, 2023

@orosbogdan thanks for contacting us.

That attribute and support is specific to the .NET webassembly runtime and not something that Blazor supports (or wil be able to support).

Blazor Maui apps do not use webassembly, the .NET code runs directly on the device.

@javiercn javiercn closed this as completed Mar 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView proposal/open
Projects
None yet
Development

No branches or pull requests

3 participants