zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
168 stars 38 forks source link

Support for Blazor? #94

Closed zijianhuang closed 4 years ago

zijianhuang commented 4 years ago

Related to #92.

I have just a quick look at some posts about Blazor, rather than Microsoft Docs about Blazor. I just wonder if there's some limitation of transforming/rendering C# client codes into WASM/Javascript to be running on the browser.

Would it be possible to generate a client TS library with Fetch or Axios and use the TS lib in the Razor Views? or just go the MVC way of rendering server data directly in the view?

References: https://docs.microsoft.com/en-us/aspnet/core/blazor/call-web-api?view=aspnetcore-3.1

ChristianWeyer commented 4 years ago

We are talking about Blazor WebAssemlby here. This means the code runs on the client in the browser entirely. The C# code is compiled to .NET assemblies, those DLLs are loaded into the browser and are executed as .NET code in the .NET WASM runtime.

zijianhuang commented 4 years ago
  1. Can you confirm other client API functions other than the one involving dynamic are working well?
  2. Google "WASM newtonsoft" reveals a few interesting posts:

https://github.com/mono/mono/issues/13314

I am not sure if what you had reported in new or related to these posts.

ChristianWeyer commented 4 years ago
  1. Yep, they all work fine.
  2. Good question 😊 🤷🏼‍♂️
zijianhuang commented 4 years ago

It will be good that you report this to the mono team if this is a new issue.

I myself generally use Angular to build fat clients, because of http://webandlife.blogspot.com/2018/04/why-angular.html

zijianhuang commented 4 years ago

apparently some shortfall of Blazor currently.