Web Development With Blazor: Introduction
Preceding Blazor
In today's world, the
approach to app development has evolved. Frameworks like Angular, React,
Aurelia, and Vue have transformed the web experience from needing to refresh
the entire page to only updating specific sections dynamically. This method of
dynamic updates has made page loading faster, as the perceived loading time has
been reduced (although the total page load time might not have changed).
However, for many developers, adapting to this requires learning a completely
new skill set, particularly transitioning from a server-side environment to a
frontend built with JavaScript. On the backend, data objects are created in C#
and then converted into JSON, which is transmitted through an API and
subsequently reconstituted into JavaScript objects on the frontend.
In the past, JavaScript
functioned differently across various browsers, a problem that jQuery aimed to
address by providing a unified API that could be interpreted by web browsers.
Nowadays, the variations among different web browsers are significantly reduced,
which has made jQuery less relevant in many situations. JavaScript stands out
from many other programming languages because it isn't strictly object-oriented
or typed. In 2010, Anders Hejlsberg, who is recognized as the original creator
of C#, Delphi, and Turbo Pascal, began developing TypeScript, an
object-oriented language that can be compiled or transpiled into JavaScript.
TypeScript can be utilized with frameworks like Angular, React, Aurelia, and
Vue; however, ultimately, it is JavaScript that executes the code. In simple
terms, to build interactive web applications in today’s environment using
JavaScript or TypeScript, one has to alternate between languages and stay
updated on various frameworks.
Now, we know JavaScript
is no longer the only language that can run within a browser, thanks to
WebAssembly.
Introducing WebAssembly
One way of running Blazor
is by using WebAssembly.
WebAssembly is a compact
binary instruction format that is generated through compilation. It is
engineered for native performance, making it faster and more comparable to C++
than to JavaScript. In the case of JavaScript, the JS files (whether external or
embedded) must be downloaded, parsed, optimized, and just-in-time compiled;
however, many of those stages are unnecessary for WebAssembly.
WebAssembly employs a
rigorous security framework that safeguards users against faulty or harmful
code. It operates within a sandbox environment and cannot leave that
environment unless it utilizes the correct APIs. If you intend to interact with
anything outside of WebAssembly, such as modifying the Document Object Model
(DOM) or retrieving a file from the internet, you must accomplish that through
JavaScript interoperation.
Introducing .NET 5
To create Blazor
applications, it is essential to utilize .NET 5. .NET Core represented a
progression in the journey toward a more integrated .NET framework. It provided
Microsoft the opportunity to rethink the entire .NET platform and reconstruct
it from the ground up.
.NET 5 marks the
beginning of our path towards consolidating into a single .NET framework. This
unified toolchain ensures a consistent experience for creating, running, and
more across various project types. .NET 5 remains modular in much the same way
we are accustomed to, so we need not be concerned that combining all the
different .NET versions will lead to an unwieldy .NET.
Introducing Blazor
Blazor is an open-source
framework for building interactive Single-Page Applications (SPAs) with web UI.
Although that may sound complicated, it essentially allows you to develop
engaging SPA web apps using HTML, CSS, and C#, while offering comprehensive
support for bindings, events, forms, validation, dependency injection, debugging,
and much more.
The term Blazor is
derived from merging the words Browser and Razor (the framework that integrates
code with HTML). The addition of an L was simply to enhance the name's appeal,
but it doesn't carry any significant meaning or represent an acronym. Blazor
Server has several variations, including Blazor WebAssembly, WebWindow, and
Mobile Bindings.
Conclusion
Basic introduction of Blazor is done accordingly.
Comments
Post a Comment