question

mehmoodtekfirst-9443 avatar image
0 Votes"
mehmoodtekfirst-9443 asked ZhiLv-MSFT commented

How to Develop a Shareable Widget in Blazor Web Assembly with Sass (Core 6) ?

Hi,

I had developed a shareable widget for my client in reactjs with asp.net mvc core 6.

My problem is that I need to deliver at simple url to my client end applications like

 <script src="https://www.widgeturl.com/pamer" />

It seems that we can't use reactjs because of its deployment build nature ( it creates hash and chunks js and css files ).

We don't want to use jQuery but we can develop through it with asp.net mvc core 6.

We need to use sass with ASP.NET MVC CORE 6 including EF core 6 features.

What do you recommend for it ?

Either we should go for Asp.net MVC Core 6 with Jquery or Can/Should we use Blazor WebAssembly ?


Eventually , In the end, We need to embed it in a page Div rather than using Iframe.









dotnet-aspnet-core-blazor
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @mehmoodtekfirst-9443,

If you want to create the client widget using react, you can search online, there have multiple resource you can refer to them.

If you want to create a shared view/component using asp.net core, you can try to use the partial view or the Razor class library, then reuse them in the Asp.net core application. Refer this article: Create reusable UI using the Razor class library project in ASP.NET Core.

1 Vote 1 ·

thank you ZhiLv

0 Votes 0 ·
Bruce-SqlWork avatar image
1 Vote"
Bruce-SqlWork answered

as you are looking for a client widget. asp.net core is immaterial as its the server side.

you can bundle your react as a widget (just create a build script), but you need a predefined html element to bind to, or additional javascript to bind. you will run into the same issue with any widget technology. office 365 and Sharepoint both support react widgets (they use a different build script rather than the react SPA template).

blazor WASM will have similar build issues as the default react SPA template (dependance on index.html), but while with react you can easily change the build, it not easy with blazor. also as the browser only supports one web assembly per page, you might run into conflicts.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

mehmoodtekfirst-9443 avatar image
0 Votes"
mehmoodtekfirst-9443 answered ZhiLv-MSFT commented

you can bundle your react as a widget (just create a build script), but you need a predefined html element to bind to, or additional JavaScript to bind.


Ok Thank you Bruce. Can you refer some material because we are thinking to replace react with javascript/jquery?


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Can you refer some material because we are thinking to replace react with javascript/jquery?

Here is a simple sample about Build a web widget (using jQuery), you can refer to it. You can also search "How to build a web widget using jQuery" use google or Bing to find more resource.

0 Votes 0 ·