DEV Community

Rlogical Techsoft Pvt Ltd
Rlogical Techsoft Pvt Ltd

Posted on

Angular vs Blazor

In this blog, you will learn about Blazor, its pros, and a lot more compared to the popular AngularJS development services, which developers have preferred for years.

Overview of AngularJS
alt text

It is undoubtedly a largely used JavaScript framework that allows you to execute client web apps in browsers and create native apps. Angular apps consist of various components written with TypeScript or JavaScript. These are decorated with directives for handling things such as binding the HTML or markup to data. Your codes written with Angular will not run directly on web browsers. Therefore, you need compilers to change your code to something which the browsers can easily run.

As Angular 9 uses the Ahead-of-time compiler for transforming the code as a part of the publishing process, the browser can easily download and execute the compiled code. Similarly, one can use a Just-in-time compiler for compiling an app in the web browser. When users access an Angular application, the browser’s JavaScript engine starts to run the app’s code.

Overview of Blazor

alt text

Blazor is a framework that allows creating client web apps for running in browsers but through C# rather than TypeScript. During Blazor development, the apps arrive along with selected packages which are essential for making everything work. For installing the additional packages, you need NuGet.

From there, you create an application as an array of components through the markup language of Razor with UI logic. The browsers cannot directly execute the C# code. Like the Angular Ahead-of-time approach, you have to depend on C# compilers to compile your Razor and C# codes into various .dll files.

For publishing your application, you have to use .NET’s in-built publish commands that bundle up the app into numerous files like HTML, JavaScript, DLLs, CSS, etc. These files then get published to web servers that can serve these static files. If users access the Blazor WASM app, then the JavaScript file supersedes it. This downloads the runtime of .NET, your app, and its dependency before executing the app using WebAssembly. The framework Blazor then updates the DOM renders elements and forwards events to the app code.

Here are the following comparison between Blazor and Angular with details:

1.Production Ready

As Angular is much older, it is extremely production-ready in comparison with Blazor.

2.Learning Curve

Angular has a larger learning curve compared to easy learning with Blazor.

3.Performance

Blazor is less mature in performance.

4.Bundle Size

Blazor supports 622kb, and Angular supports less than 50kb.

Learn more here pros of Blazor and Angular with comparison table between them: https://www.rlogical.com/blog/angular-vs-blazor-which-is-the-best-one-to-opt-for-web-development/

Top comments (0)