AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

How to mix Blazor with apps that use existing frontend JS frameworks (Angular, React, etc.)

Open danroth27 opened this issue 7 years ago • 5 comments

Many customers have already built apps using existing frontend JS frameworks, like Angular, React, etc, but now want to start using Blazor in these apps. We should provide guidance on how to do this.

danroth27 avatar Jun 19 '19 19:06 danroth27

Any progress on this concept? I think it would be high value It seems to have gone dormant

RedWingBB avatar Oct 02 '20 21:10 RedWingBB

I also think it is extremely important for the success of Blazor when there is a perspective how to migrate from any JS framework to Blazor step by step a. Starting from scratch is no option for many real projects.

The JavaScript Component Generation sample from the ASP.NET samples shows the way how to do it (currently), however the provided code does not compile at the time of this writing because of some open issues, and it was still not fixed.

Based on the ideas of this sample, I've created a working demo project, see https://github.com/Xenoage/BlazorInAngularDemo . However, lots of steps are still required and the build process is quite fragile. I've collected my problems in the README file.

Xenoage avatar Nov 28 '21 19:11 Xenoage

@Xenoage We haven't attempted to provide migration guidance from existing JS frameworks to Blazor because there are many popular frontend JS frameworks and they evolve quickly, so any content we provide would likely go stale very quickly. The JS component generation sample demonstrates just one potential approach. The sample has now been updated to .NET 6 and should compile cleanly.

danroth27 avatar Nov 29 '21 22:11 danroth27

@danroth27 this is a very broad area to document, especially when you think about auth integration and publishing problems. Would you mind scoping this to a clear list of thing that you'd like us to address as part of this work? Thanks!

mkArtakMSFT avatar Apr 25 '22 18:04 mkArtakMSFT

I think this is largely covered by the work we did to enable Blazor components to be rendered from JS: https://docs.microsoft.com/aspnet/core/blazor/components#render-razor-components-from-javascript. In .NET 7 we will also finish up supporting building custom HTML elements with Blazor.

danroth27 avatar Apr 25 '22 19:04 danroth27