SPA template using Blazor
What Blazor is: An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly
- see: https://github.com/aspnet/Blazor
Resources:
- Blazor project website
- Steve Sanderson's demo at NDC Minnesota (Video)
- A collection of awesome Blazor resources
Blazor in action:
https://blazor-demo.github.io/
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 I can help in building modules schema. I'm only waiting for integration.
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 use Application/Domain services + Repositories as GraphQL objects for building schemas. Each module can have own schema at own endpoint.
For example, when you need a list of your store categories and their products and reviews and balabalabala with REST API you need to create the request for each data you needed, but this can be done easily with one request in single line code!! This not useful for multi clients applications?
You can see GraphQL in action on Facebook Mobile UserProfile page. All data of a user (pages, friends, videos, books, places, ....) comes with a single query and a single parameter UserID.
does it check permissions to see if the user has access to the table?
you can add this by design or using available libraries like this
For example, when you need a list of your store categories and their products and reviews and balabalabala with REST API you need to create the request for each data you needed, but this can be done easily with one request in single line code!! This not useful for multi clients applications?
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.
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.
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. But it's also valid for REST. Client may perform many unnecessary API calls.
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 :)?
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.
@bbakermmc
this is what I would say is bad, the exact reason applies to EF also.
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 Bootstrap 4 Components for Blazor Framework: https://github.com/chanan/BlazorStrap Maintainable CSS with Blazor Framework: https://github.com/chanan/Blazorous
Seems a good framework: https://github.com/oqtane/oqtane.framework Adding link here for a reference.
Also, see these UI component libraries:
- https://blazorstrap.io/
- https://blazorise.com/
Do you have any date when Blazor UI template will be ready?
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
Sure, you can do it. It is appreciated if anyone creates an article / medium post about it :)
I am also very interested in creating a SPA using Blazor Server Side have been playing with Blazor in Preview 9 and it is really cool in a way it reminds me of the old ASP.NET 1.0 days.
I have made some progress just need to work out how to use OAuth and get a token from ABP I have tried using connect/token but it is not working for me
Any ideas which oAuth library I should use ?
@mehmet-erim which library you've used for the Angular UI?