Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Web Development with Blazor

You're reading from   Web Development with Blazor A practical guide to building interactive UIs with C# 12 and .NET 8

Arrow left icon
Product type Paperback
Published in Apr 2024
Publisher Packt
ISBN-13 9781835465912
Length 366 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jimmy Engström Jimmy Engström
Author Profile Icon Jimmy Engström
Jimmy Engström
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Hello Blazor FREE CHAPTER 2. Creating Your First Blazor App 3. Managing State – Part 1 4. Understanding Basic Blazor Components 5. Creating Advanced Blazor Components 6. Building Forms with Validation 7. Creating an API 8. Authentication and Authorization 9. Sharing Code and Resources 10. JavaScript Interop 11. Managing State – Part 2 12. Debugging the Code 13. Testing 14. Deploying to Production 15. Moving from, or Combining with, an Existing Site 16. Going Deeper into WebAssembly 17. Examining Source Generators 18. Visiting .NET MAUI 19. Where to Go from Here 20. Other Books You May Enjoy
21. Index

Preceding Blazor

You probably didn’t get this book to read about JavaScript, but it helps to remember that we came from a pre-Blazor time. I recall that time – the dark times. Many of the concepts used in Blazor are not far from those used in many JavaScript frameworks, so I will start with a brief overview of where we came from.

As developers, we have many different platforms we can develop for, including desktop, mobile, games, the cloud (or server side), AI, and even IoT. All these platforms have a lot of different languages to choose from, but there is, of course, one more platform: the apps that run inside the browser.

I have been a web developer for a long time, and I’ve seen code move from the server to run within the browser. It has changed the way we develop our apps. Frameworks such as Angular, React, Aurelia, and Vue have changed the web from reloading the whole page to updating small parts on the fly. This new on-the-fly update method has enabled pages to load quicker, as the perceived load time has been lowered (not necessarily the whole page load).

But for many developers, this is an entirely new skill set – that is, switching between a server (most likely C#, if you are reading this book) to a frontend developed in JavaScript. Data objects are written in C# in the backend and then serialized into JSON, sent via an API, and then deserialized into another object written in JavaScript in the frontend.

JavaScript used to work differently in different browsers, which jQuery tried to solve by having a common API that was translated into something the web browser could understand. Now, the differences between different web browsers are much more minor, which has rendered jQuery obsolete in many cases.

JavaScript differs slightly from other languages since it is not object-oriented or typed, for example. In 2010, Anders Hejlsberg (known for being C#, Delphi, and Turbo Pascal’s original language designer) started working on TypeScript. This object-oriented language can be compiled/transpiled into JavaScript.

You can use Typescript with Angular, React, Aurelia, and Vue, but in the end, it is JavaScript that will run the actual code. Simply put, to create interactive web applications today using JavaScript/TypeScript, you need to switch between languages and choose and keep up with different frameworks.

In this book, we will look at this in another way. Even though we will talk about JavaScript, our primary focus will be on developing interactive web applications mainly using C#.

We now know a bit of history about JavaScript, which is that it is no longer the only language that can run within a browser, thanks to WebAssembly, which we will cover in the next section.

You have been reading a chapter from
Web Development with Blazor - Third Edition
Published in: Apr 2024
Publisher: Packt
ISBN-13: 9781835465912
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime