-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
SPA template using Blazor #394
Comments
I like the idea behind Blazor. Will work on that template. Thank you for your suggestion. |
Everyone would love to not use JS :P I haven't been following it too closely other than its hit v .5 last week I think. But we know MS tends to issue breaking changes a lot so that's the only gotcha with the early life cycle stuff Just look at .net core. |
@bbakermmc Right. I tried Blazor using GraphQL as server-side query language that was amazing and is made building UX/UI for our modular app very very very simple. @hikalkan Sir, are you haven't plan to start GraphQL integration? #86 |
We are not starting GraphQL is the next weeks. But we will work on soon (probably in ~2 months). |
Personally I dont see the huge reason for GraphQL, especially if you go with ServerSide Rending in Blazor. How do you throttle GraphQL, does it check permissions to see if the user has access to the table? Why does someone need to query the data? Sure maybe it makes front-end developers jobs slightly easier but they should learn how to do it properly, this is just another abstraction like EF which could generate horrid sql once you get into complex scenarios. |
@bbakermmc GraphQL is not any specific framework or database query language but rather a specification that describes the capabilities and requirements of data models in client‐server applications.
you can add this by design or using available libraries like this |
And this is what I would say is bad, the exact reason applies to EF also. It may not always generate the best/optimized query plan for the data. Sure it makes your life easy because you just deal with models, but it doesn't mean it generates proper response. And why not just make an endpoint that returns what you need. Why do I need to send back "everything". A product could have 1000000 reviews, hmm sending that back is bad. Also wouldnt this in return issue multiple SQL calls? 1x per object per repo? So in the end it didnt really save performance, not really, the db still has to issue 6 queries. Not saying GraphQL isnt fine, but it has its place, and I dont see it taking over, its just another abstraction that I personally dont want to deal with :p Like I said its basically and ORM for the front end like EF. So now we need two ORMs lol? Its just a way for client side folks to get data w/out having to go to the DB people just like EF/ORMS are the same thing for the server side. |
I didn't work with GraphQL yet, but read a lot.
This is one point I hesitate about. It would not be good to open entire database (or a subset model) to clients if they query unnecessary data which may lead to non optimized queries in the server side. Anyway, as I said, I didn't work in practical. From my current understanding, we will provide a GraphQL endpoint for each module with their own schema/model. We will also provide full REST-style API for each module. |
@hikalkan Right, from my understanding it seems it needs to be tied to an IQueryable since its going to be doing its own "magic". REST isn't "better" by any regards, but you cant expose an IQueryable :p, you at-least know what will be sent back and can make better predictions. So in the SPA template you making to versions now, one REST and one GraphQL :)? |
It'e very early for me to decide/answer that. I even don't know how to create Blazor template for ABP yet. |
When a new technology is introduced, it certainly has its own fans and critics. Given the idea behind the vNext framework, the VOLO has been able to meet the needs of the majority of users. Professional users like you and novice users like me. The GrapgQL for users, who want to run their software on the cloud, has an easy and practical solution. I'm using GraphQL in my ZERO app at Web.Host layer with own controllers for calling my application methods at "myDomain.domainType/graphql" endpoint. That was useful for building my mobile app and my public website in angular. |
@hitaspdotnet Right. It just comes down to implementation and maintenance. If you want to use GraphQL why would you implement all the AppServices and REST stuff :p. I'm looking at it from a maintainability/performance standpoint. Once you offer multiple choices on things maintaing the code becomes a nightmare. I assume youre not running, React, Angualar, MVC, and Blazor right? But if the vNext supports them all you now have to make sure each one is implemented correctly and then if you now say we will support REST and GraphQL now you multiplied the number of updates :p Then you have security, well if its included as a package in the project but not used, its still potentially a "security" risk, just look at the NPM package hacks and stuff. Maybe @hikalkan comes up with some super amazing UI to generate permissions per object per field, makes dtos, linked, objects, endpoints, and GraphQL would work great with it, then sure by all means just use GraphQL for the templates. We see it now with AspNetZero where there are patches after a major release to fix things not caught. Everyone is excited for vNext and we want the fancy new features. |
@hikalkan |
Seems a good framework: https://github.com/oqtane/oqtane.framework Also, see these UI component libraries: |
Do you have any date when Blazor UI template will be ready? |
No date. This is an open source project :D Our first goal to finalize the v1.0. Then we will prioritize other works. |
Even without the template I’m sure we can make it work out of the box, at least on server side blazor |
Like it so far! I'm wondering how much effort would it take to get at least Wasm client to work with recently shipped .NET 5 RC1. Tons of improvements for Blazor across the board and I'd like to start While it's supposed to be fully backwards compatible with .NET Standard, upgrade yields some errors. Any insight on how to get through would be appreciated. Changing the MyCompanyName.MyProjectName.Blazor.csproj to <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.1.2" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0-rc.1.20451.17" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0-rc.1.20451.17" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0-rc.1.20451.14" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="E:\GitHub\abp\framework\src\Volo.Abp.Autofac.WebAssembly\Volo.Abp.Autofac.WebAssembly.csproj" />
<ProjectReference Include="E:\GitHub\abp\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj" />
<ProjectReference Include="E:\GitHub\abp\modules\identity\src\Volo.Abp.Identity.Blazor\Volo.Abp.Identity.Blazor.csproj" />
<ProjectReference Include="E:\GitHub\abp\templates\app\aspnet-core\src\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj" />
</ItemGroup>
</Project> |
@hikalkan - Great news that this is almost ready to use, should we create new questions here or in the support forum? |
Published the ABP Framework & ABP Commercial 3.2.0-rc.1, so you can try the Blazor UI now: https://blog.abp.io/abp/ABP-Framework-ABP-Commercial-3.2-RC-With-The-New-Blazor-UI Blazor UI with this release is experimental, we are completing the features. I am currently updating the application development tutorial to support the Blazor UI. I really want to move to .NET 5 and develop the Blazor UI based on it. However, this means a major version change for the ABP Framework and we have already scheduled it (see https://github.com/abpframework/abp/milestones). Current milestone is 3.3 (in progress, finishes on October 15) and the next milesone is 4.0. We will upgrade to .NET 5 with the 4.0. So, a little more patient, we are working hard for this :) if you are using the ABP Commercial, please ask on the support web site. Thanks. |
For anyone didn't heard yet, @stsrki, the creator of the Blazorise, is joining to the core ABP Framework team in the next weeks: https://twitter.com/MladenMacanovic/status/1306878684251422720 |
Wow thats great news. I have a question. The default template will target server side blazor or webassembly? Thanks and great job! |
@wocar we are more focused on the webassembly at the beginning. So, default template is webassembly. |
I like "Microfrontends": https://micro-frontends.org/ |
Getting started & Web Application Development tutorials are updated for the Blazor UI:
Also, just released the v3.2.0-rc.2. |
this comment by Steve Sanderson is worth a read: dotnet/aspnetcore#24599 (comment) |
I've just been giving the ABP Book example stuff a go and I'm running into an odd issue when trying to edit a Book. Adding a mapping configuration for object --> CreateUpdateBookDto works but this can't be correct can it? I suspect there's something else not working here. Also after adding the mapping I can edit the Book but the data is not automatically populated in the modal. |
The error message I'm getting is before mapping it to an object. Adding a mapping configuration to System.Object resolves the error. |
I managed to get the above resolved, as it turns out I also needed to specify the mapping configuration in the Blazor client itself. I'm now getting a different issue trying to build the client in release mode:
I only get this when compiling in Release mode, has anyone else tried this and know if it works? Thanks. |
@aicreed this is the AutoMapper configuration you need to do: https://docs.abp.io/en/abp/3.2/Tutorials/Part-3?UI=Blazor&DB=EF#automapper-configuration using Acme.BookStore.Books;
using AutoMapper;
namespace Acme.BookStore.Blazor
{
public class BookStoreBlazorAutoMapperProfile : Profile
{
public BookStoreBlazorAutoMapperProfile()
{
CreateMap<BookDto, CreateUpdateBookDto>();
}
}
} The "release mode" error can be related to tree shaking:
https://blog.stevensanderson.com/2018/02/06/blazor-intro/ ABP uses dynamic proxying and some reflection. This can be the problem. I created an issue to work in the next milestone: #5646 Current Blazor UI is experimental, so not tested on release mode yet. |
@hikalkan may be the solution should be to use Source Generators to create dynamic proxies. More info here and here. Source generators not only can solve the problem but also will made much faster the execution and the proxy can be used in any c# cliente, like a xamarin, windows or linux application. |
We are following the source generators. However, it is early to decide. |
Grate! |
Hi @hitaspdotnet , I have downloaded ABP.IO project with Angular UI and i wrote some api's also. So, now I want to use Blazor UI in abp.io way. I have checked documentation in abp.io site, but I unable to find the solution, so plz help me out this issue. How to convert Angular UI to Blazor client without changing existing abp.io api's? |
@SuriyaArul ABP application services can automagically be injected in Blazor. No additional coding required in your API. From official tutorial:
|
Hi @Stirda Thanks for you message, I completely agree with your reply, But I am having ABP application with Angular UI, So I need to convert Blazor UI instead of Angular without changing Server side, Becoz I wrote around 30 api in my ABP application. |
It is no easy task. You should do a migration plan and do it by parts. It is basically rewriting the front end |
@wocar Thank you |
Thank you all to join into this discussion. This was the most commented issue in the ABP Framework history :) With the release of ABP 4.0 RC.1 in the next week (probably at Nov 11), we will have a production ready Blazor UI (based on the stable .NET 5.0). So, closing this issue here. Please open new issues if you have problems or suggestions related to the Blazor UI. Thanks again for your great attention. |
What Blazor is: An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly
Resources:
Blazor in action:
https://blazor-demo.github.io/
The text was updated successfully, but these errors were encountered: