blog-core icon indicating copy to clipboard operation
blog-core copied to clipboard

Blazor for the project

Open thangchung opened this issue 5 years ago • 8 comments

The Blazor road map with a lot of features need to investigate https://github.com/aspnet/AspNetCore/issues/8177

And priority items to work on: https://github.com/aspnet/AspNetCore.Docs/projects/35#card-23892118

What news with Blazor: Docs and .NET Core 3.0 Preview 6 news

Microsoft samples:

  • https://github.com/SteveSandersonMS/presentation-2019-06-NDCOslo
  • https://github.com/dotnet-presentations/blazor-workshop
  • https://github.com/aspnet/samples/tree/master/samples/aspnetcore/blazor/FlightFinder
  • https://github.com/danroth27/BlazingPizza

Blazor features:

  • https://github.com/dodyg/practical-aspnetcore/blob/master/projects/blazor/README.md
  • https://github.com/dodyg/practical-aspnetcore/blob/master/projects/blazor-ss/README.md

Blazor validation & FluentValidation:

  • https://chrissainty.com/using-fluentvalidation-for-forms-validation-in-razor-components/. Source code at https://github.com/chrissainty/FluentValidationWithRazorComponents ==> have an issue with is-invalid style which needs to customize the https://github.com/aspnet/AspNetCore/blob/master/src/Components/Components/src/Forms/InputComponents/InputBase.cs

UI:

  • https://github.com/stsrki/Blazorise
  • https://github.com/SamProf/MatBlazor

Real projects:

  • https://github.com/vietnam-devs/coolstore-microservices/tree/ce2a3e87c6665be2c36e14fcb1ea4a4f5e0a6274
  • https://github.com/enkodellc/blazorboilerplate
  • https://github.com/lohithgn/blazor-tour-of-heroes
  • https://github.com/gpeipman/BlazorDemo
  • https://github.com/chrissainty/worddaze
  • https://github.com/azunyuuuuuuu/MusicThingy
  • https://github.com/stavroskasidis/BlazorWithIdentity
  • https://github.com/ardalis/CleanArchitecture
  • https://github.com/maraf/Money/tree/master/src/Money.UI.Blazor
  • https://github.com/duracellko/planningpoker4azure/tree/master/src/Duracellko.PlanningPoker.Client

thangchung avatar May 25 '19 07:05 thangchung

SQL Server with docker-compose guidance at https://docs.docker.com/compose/aspnet-mssql-compose/

thangchung avatar Jun 10 '19 10:06 thangchung

Authn & Authz https://gist.github.com/SteveSandersonMS/175a08dcdccb384a52ba760122cd2eda

thangchung avatar Jun 16 '19 06:06 thangchung

State management discussion and libs at https://github.com/aspnet/AspNetCore/issues/5467

thangchung avatar Jun 18 '19 11:06 thangchung

Support Rest actions for current HttpClient. The same at https://github.com/aspnet/AspNetCore/blob/a6bc6ce23dad5a9d02596cf2e91e3c4f965c61bc/src/Components/Components/src/HttpClientJsonExtensions.cs

thangchung avatar Jun 24 '19 14:06 thangchung

Trying with SSR with Blazor so that we can be easy to do debug and other stuffs

thangchung avatar Jul 13 '19 04:07 thangchung

State management (circuit) for blazor at https://gist.github.com/SteveSandersonMS/ba16f6bb6934842d78c89ab5314f4b56

thangchung avatar Jul 13 '19 08:07 thangchung

Staring at Grpc.Net.Client, tried it but still got an error when run with .NET Standard 2.1. Example at https://github.com/heikovetter/BlazorGrpcSample. With this coming lib, we can set up gRPC service on the server and use Grpc.Net.Client to call to the server through HttpContext integrated with gRPC, just like an example at https://github.com/grpc/grpc-dotnet/blob/master/examples/Clients/Ticketer/Program.cs

Cool thing for gRPC on DataContract at https://github.com/protobuf-net/protobuf-net.Grpc

thangchung avatar Jul 14 '19 06:07 thangchung

/// <summary>
/// Ref to https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/8a942cae26/monitoring/api/AlertSample/Program.cs
/// </summary>
public class ProtoMessageConverter : JsonConverter
{
    public override bool CanConvert(Type objectType)
    {
        return typeof(IMessage).IsAssignableFrom(objectType);
    }

    public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
    {
        var converter = new ExpandoObjectConverter();
        var o = converter.ReadJson(reader, objectType, existingValue, serializer);

        var text = JsonConvert.SerializeObject(o);

        var message = (IMessage)Activator.CreateInstance(objectType);
        return JsonParser.Default.Parse(text, message.Descriptor);
    }

    public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
    {
        writer.WriteRawValue(JsonFormatter.Default.Format((IMessage)value));
    }
}

Usage:

JsonConvert.SerializeObject(data, new ProtoMessageConverter());
var data = JsonConvert.SerializeObject<TData>(data, new ProtoMessageConverter());

thangchung avatar Jul 19 '19 10:07 thangchung