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

mehmood tekfirst 771 Reputation points
2022-05-25T13:08:03.697+00:00

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.

Developer technologies | .NET | Blazor
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2022-05-25T18:42:36.3+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. mehmood tekfirst 771 Reputation points
    2022-05-26T07:15:34.447+00:00

    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?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.