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

JSInterop support for invoking constructors, properties, and supplying callbacks #31151

Open
3 tasks
javiercn opened this issue Mar 23, 2021 · 11 comments
Open
3 tasks
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-jsinterop This issue is related to JSInterop in Blazor Pillar: Complete Blazor Web Priority:1 Work that is critical for the release, but we could probably ship without
Milestone

Comments

@javiercn
Copy link
Member

  • Support invoking constructor functions either detecting them automatically or with a new method.
  • Support invoking callback objects (maybe this works already), either with a new JS/Dotnet callback.
  • Support accessing object properties directly (automatically or via a new method).
@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-jsinterop This issue is related to JSInterop in Blazor labels Mar 23, 2021
@javiercn javiercn added this to the Next sprint planning milestone Mar 23, 2021
@ghost
Copy link

ghost commented Mar 23, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@javiercn
Copy link
Member Author

We had several reports of these things in this area and some of them block using basic JS functionality without having to write a wrapper.

@campersau
Copy link
Contributor

For wasm only apps there is https://github.com/dotnet/runtime/tree/main/src/libraries/System.Private.Runtime.InteropServices.JavaScript if you aren't afraid of the Private part.

@javiercn
Copy link
Member Author

We don't recommend using those directly, since they are wasm specific and I believe might change in the future

@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jul 27, 2021
@ghost
Copy link

ghost commented Aug 10, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@TanayParikh TanayParikh modified the milestones: Backlog, .NET 7 Planning Oct 19, 2021
@TanayParikh TanayParikh added the Priority:2 Work that is important, but not critical for the release label Oct 21, 2021
@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 7 Planning, Backlog Nov 11, 2021
@ghost
Copy link

ghost commented Nov 11, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ghost
Copy link

ghost commented Oct 12, 2022

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT mkArtakMSFT added the Priority:1 Work that is critical for the release, but we could probably ship without label Nov 15, 2022
@gerneio
Copy link

gerneio commented Feb 13, 2023

100% needed in order to develop JS interop w/o having to develop a custom JS wrapper module for nearly every JS library. As it stands, pretty much any moderately complex/large JS lib that you want to call via JS interop is not possible without a JS wrapper. IIRC, a big pitch of Blazor was the goal of writing C#, HTML, CSS w/o JS. But pretty much any JS lib requires us to write JS to make it work with C#.

So really hope these features don't keep get being pushed back after 2+ years.

@ghost
Copy link

ghost commented May 1, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@danroth27 danroth27 changed the title [JSInterop] Little improvements JSInterop little improvements Aug 25, 2023
@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, BlazorPlanning Nov 5, 2023
@ghost
Copy link

ghost commented Dec 19, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@SteveSandersonMS SteveSandersonMS changed the title JSInterop little improvements JSInterop support for invoking constructors, properties, and supplying callbacks Jan 24, 2024
@trungnt2910
Copy link

Raising my support for this issue. With the current IJSRuntime mechanism, even for simple properties like document.title, if eval is blocked, there's no way other than a wrapper function (a certain bug in .NET's implementation prevents the usage of valueOf for primitive types).

Something like giving IJSObjectReference functions like GetProperty[...]Async and SetProperty[...]Async similar to what JSObject already has would be highly desirable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-jsinterop This issue is related to JSInterop in Blazor Pillar: Complete Blazor Web Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

No branches or pull requests

9 participants