curiosity-ai / h5

🚀 The next generation C# to JavaScript compiler
https://github.com/curiosity-ai/h5
Apache License 2.0
211 stars 30 forks source link

Add support for simpler HTTP requests #35

Closed theolivenbaum closed 2 years ago

theolivenbaum commented 3 years ago

Idea: https://github.com/mikeal/bent

ChrML commented 3 years ago

I would rather recommend implementing the .NET http client patterns:

Much more compatible with existing .NET code, and can also be written as oneliners async/await for getting data.

theolivenbaum commented 3 years ago

True! And simple enough to hide the abstraction! Will give it some thought

On Thu, Mar 25, 2021, 9:35 PM Christian Myhre Lundheim < @.***> wrote:

I would rather recommend implementing the .NET http client patterns:

  • HttpClient
  • IHttpClientFactory
  • The extension methods for JSON etc.

Much more compatible with existing .NET code, and can also be written as oneliners async/await for getting data.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/theolivenbaum/h5/issues/35#issuecomment-807437369, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDCOAZVXOT2S47OPTAZVE3TFOM7RANCNFSM4ZXUSRAA .

ChrML commented 3 years ago

I have implemented dependency injection patterns, and an API-client that is very easy to use in my library for Bridge.NET: https://github.com/ChrML/Bridge.Jolt

I think this front-end library has very many great ideas in one place for very simple front-end development, but it will eventually have to be ported to H5.

Not come around for the HttpClient part yet. But it makes sense that System.Net.Http is a part of H5's core features, since it's used a lot in frontends, and also a part of standard .NET.

theolivenbaum commented 3 years ago

Nice!

If you want to try porting, the effort will be a simple find and replace:

Bridge -> H5 Retyped -> H5.Core

And fully replacing the csproj file with a modern one with the right Nuget packages.

theolivenbaum commented 2 years ago

Closed with initial implementation in PR #61