Using Blazor Wasm as an app shell in piral

627 views Asked by At

I chanced on Piral Framework for implementing micro-frontends and I wanted to implement it in my project.

However, my application comes as a Blazor wasm project and my aim is to use this current project as my app shell.

Is there any example on how I could implement that?

I can't really find my way around the documentation too.

Kindly note that I am a beginner. Thanks in advance.

2

There are 2 answers

0
Xander Selorm On BEST ANSWER

After searching around on how to actually implement the concept of micro-frontends using Blazor WASM as my app shell, I still didn't find any solution which helped me. So I came up with a custom solution which I wrote about in a blog. Basically, the solution makes use of the JS interop of Blazor as a medium of communicating between the other JS frameworks or libraries. Kindly have a read: https://dev.to/xanderselorm/introduction-to-micro-frontends-using-net-blazor-wasm-part-1-lc9

0
Florian Rappl On

For the app shell you cannot use Blazor.WASM. You can, however, make your app shell really lightweight (i.e., don't put almost anything in there) and have all the necessary layout parts defined in Blazor.

The idea boils down to the sample given at: https://github.com/piral-samples/piral-distributed-layout

Now instead of having pilet(s) in React / Angular / ... you use Blazor.

For Blazor pilets (and extensions using Blazor) you can check out the documentation at the README of Piral.Blazor: https://github.com/smapiot/Piral.Blazor/

Make sure to follow the instructions closely and use the right branch (named after the version of Blazor you are targeting).