-
Notifications
You must be signed in to change notification settings - Fork 2.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
do we have plan to use Blazor? #2966
Comments
Right now the only release you can expect is Razor Components which is a server-side only technology. It's a different programming model than MVC. I don't think it replaces anything like Liquid. However I am a truly believer that we should create some data oriented Razor Components like Data Sources in Webforms, that could reuse the data from Orchard. This would, like Razor Pages, allow for some nice decoupled website development in Orchard Core. |
Nice post about the topic I found : Fun sample I tried yesterday : At this point I'd say it would be quite experimental. Though, fun project would be to try making Orchard Core work with Electron at the same time ! 😄 I'd say make it work with .NET Core 3.0 first. |
Has this been revisited now that ASP.NET Core 3 and Blazor serverside have been released? |
I took a couple hours trying to add server-side Blazor to Orchard Core and I've succeeded -- I am now able to add Blazor components in any Orchard Core modules or themes. Unfortunately, I had to implement a workaround that we should discuss (see below). First of all, what you need is to add a modular Startup file and add the server-side Blazor services and register the Blazor hub.
Secondly, inside the main Startup file of your web project add Finally, make sure that the layout has the Unfortunately, this is not enough to make it work because you will get 404 to the It would be great to find a solution for this but until then the workaround is to re-register the Blazor embedded file provider in the main Startup file. Since the ConfigureStaticFilesOptions is internal you need to add it somewhere near the Startup file and delete the codes that references other internal settings (which is also not a good idea but it works). Something like this:
And add the Please let me know your thoughts. |
As i have time i will look at it, i need to learn Blazor first ;) |
What would be the goal?
|
@sebastienros any of them, I don't have an exact goal yet, I'm just exploring the possibilities. Basically, I want to know how deep I can go using Blazor components in Orchard Core. Even if it's a SPA using webassembly or it's a ContentPart editor shape using Blazor components on Admin. For now, I didn't try using Webassembly because it's not released yet but server-side Blazor would make sense. |
How about having a Blazor version of Orchard Core's back-office. |
I like the idea, but not all of us like Blazor, some prefer Razor, AngularJS .. etc |
What I'm looking at is to create a modular Blazor application witch is the reason I ended up looking at the Orchard Core Framework. Hopefully there will be some way to marry these two. Does this make sense or should I be looking at something else? |
Should work but there's nothing so far planned about it I heard of. This is kind of a choice to make when building a module to use Vue.js or Angular or Blazor to make it work. We need to have some prototypes built first and see from there. |
There is a modular framework for Blazor called Octane that you could look at. https://www.oqtane.org/ |
I would like to build either a full blazor app, as an orchard core module and with other features and settings create a recipe to enable it as an app, multitenant mode. |
We are developing our ERP with Orchard Core because we want its modularity and because it allows to have different frontend technology on each module. It ensures us a gradual migration of our modules to future front end technologies. |
I've created a sample Orchard Core CMS website (not decoupled) with two sample modules using Since Orchard Core websites can be modularized and server-side Blazor can be integrated (with workarounds, see my comment) we can add Blazor components to Orchard Core modules. This way we can enable or disable some features implemented using Blazor. As for not server-side Blazor the approach is completely different because you will build an SPA using Blazor and use Orchard Core as backend which is separated. Please let me know if it helps. |
@barthamark do you want to demo it and talk about what it enables? |
Yes, sure. Let's talk about this. I'll go to one of the next meetings and demo it. Thanks. |
@barthamark Do you still want to make a demo during a meeting? |
Yes, let's do it next week. |
Unfortunately, I have to postpone this demo to next week because I got the cold and can't speak too much. Until next week, please let me know if you have a specific idea about where you'd find it useful to write modularized server-side Blazor components so I can create a couple more examples if needed. |
I would also love to see a POC that uses Blazor WebAssembly. See today's announcement: It would be a Blazor Wasm app that calls some REST or GraphQL apis exposed by an Orchard Instance. I created an issue about an Helper Library that would help to abstract the GraphQl calls to OC: #5434 |
My new recommendation: Use Blazor Wasm if you want, in the admin or the frontend. But we shouldn't change Orchard in any way to add custom support for it, even less Blazor Server. |
It could be a community driven project |
@barthamark meeting's now in case you are available |
Blazor Webassembly 3.2.0 is now fully released. Do you guys have plans to add a testproject with it in Orchard ? |
@kevinvdm88 we could add this into https://github.com/OrchardCoreContrib/OrchardCoreContrib.Themes |
We could use Orchard Core as Back-end Server and Blazor Wasm as standalone Front-end web application ( not as orchard module) - It could be Good candidate for How-to guide. |
Would be a Great How-to guide, and the right idea for seperation of concerns (IMHO) between back end Orchard Core and Blazor as a Front End |
Just wanted to include a reference to this nice post on this topic. For example, if someone wanted to work on a Blazor admin dashboard app. This could be somehow quite experimental but also a good thing to try. |
I have been experimenting with Blazor Blazor Web Assembly with Orchard Core
Other Orchard Core Blazor Videos: https://www.youtube.com/c/OrchardSkills/videos |
So instead of #2966 (comment) I added public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
{
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new ManifestEmbeddedFileProvider(typeof(IServerSideBlazorBuilder).Assembly),
});
routes.MapBlazorHub();
} and it works perfect for all tenants |
@xperiandri can you explain what you can accomplish with that? |
I render Blazor component on some page like this |
@sebastienros That's because StaticFileOptions are explicitly defined in OrchardCore instead of Resolved from DI by StaticMiddleware - resulted in This can be easily fixed in OC, will create PR soon. |
loading '_framework/blazor.server.js' works now by configuring the staticfileoptions with a ManifestEmbeddedFileProvider pointing to the blazor assembly. How would I achieve for also resolving the '_content/etc.css' file from a RCL? |
@psijkof check obj folder structure and inspect embedded resources of the assembly |
@psijkof @xperiandri did you figure this out and can share? I suspect something I have to do with UseStaticFiles (where I call it, what I pass to it, something). But no idea what... I am using Blazor8, BTW. TIA! |
As far as I remember I had to adjust the path of js according to module name |
it seems that after we use Blazor in client (webAssembly), we do not need Liquid.
https://blazor.net/docs/get-started.html
The text was updated successfully, but these errors were encountered: