sps014 / BlazorBindGen

MIT License
16 stars 2 forks source link

[Idea] Blazor Component with BlazorBindGen in .NET Interactive #12

Closed GeorgeS2019 closed 2 years ago

GeorgeS2019 commented 2 years ago

Discussion: Blazor Component with BlazorBindGen in .NET Interactive

GeorgeS2019 commented 2 years ago

FYI: https://github.com/plbonneville/BlazorInteractive

GeorgeS2019 commented 2 years ago

@sps014

This is not urgent,

Imagine running BlazorBindGen in .NET interactive notebook through RazorLight

Possible to make @inject IJSRuntime JS works through RazorLight in RazorInteractive

The key is how to do in .NET interactive notebook.

@using Microsoft.JSInterop;
@inject IJSRuntime JS

The problem is that one needs to inherit the abstract class IJSRuntime

Here is an example

BlazorHybridJSRuntime.cs

After that using RazorLight to inject the concrete IJSRUntime class.

This is obviously a simplication.

However, I find that interesting and the prospect of SHOWING blazorBindGen in .NET interactive for e.g. teaching

sps014 commented 2 years ago

@sps014

This is not urgent,

Imagine running BlazorBindGen in .NET interactive notebook through RazorLight

Possible to make @inject IJSRuntime JS works through RazorLight in RazorInteractive

The key is how to do in .NET interactive notebook.

@using Microsoft.JSInterop;
@inject IJSRuntime JS

The problem is that one needs to inherit the abstract class IJSRuntime

Here is an example

BlazorHybridJSRuntime.cs

After that using RazorLight to inject the concrete IJSRUntime class.

This is obviously a simplication.

However, I find that interesting and the prospect of SHOWING blazorBindGen in .NET interactive for e.g. teaching

Microsoft has already built an alternative JS interop mechanics (to be released in NET 7 RCs). Also adding support of .NET Interactive is out of scope of this project, as one of my primary concerns before creating this project was performance, a lot of code need rewriting and I have to introduce some overhead as we can't directly plug a new IJSRuntime implementation.

sps014 commented 2 years ago

See .NET JavaScript interop on WebAssembly in this release note.

GeorgeS2019 commented 2 years ago

@sps014 Interested to get your view on that, perhaps in the discussion?

Ref1: [API Proposal]: JavaScript interop with [JSImport] and [JSExport] attributes and Roslyn

sps014 commented 2 years ago

@sps014 Interested to get your view on that, perhaps in the discussion?

Ref1: [API Proposal]: JavaScript interop with [JSImport] and [JSExport] attributes and Roslyn

Haven't played with the API, will do in few weeks, then I can have some discussion.

GeorgeS2019 commented 1 year ago

@sps014 Have you had time to play with it?

Very curious what you think for the next version of this project :-)

GeorgeS2019 commented 1 year ago

@sps014

Any update, curious what is next for this project!

[API Proposal]: JavaScript interop with [JSImport] and [JSExport] attributes and Roslyn

sps014 commented 1 year ago

@sps014

Any update, curious what is next for this project!

[API Proposal]: JavaScript interop with [JSImport] and [JSExport] attributes and Roslyn

The goal of the project is complete , most of scenarios are covered, that I planned, if any one has any suggestions that fits this project is more than welcome.