+16

Why WebAssembly

High Performance

WebAssembly rusn in near-native performance, it's compact, quick to download and parse, designed for modern processors, and it's low-level binary compiled.

Secure

WebAssembly runs in the JavaScript VM, it's sandboxed, and has a memory-access constraints to ensure the browser and device's security

Beyond JS

Even if you have never written in JavaScript, WebAssembly opens the door for you to build web apps using powerful languages like C/C++, C#, Rust, and more...

Easy to Debug

WebAssembly supports the DWARF debugging format. Debug using tools inside and outside the browser. And in Blazor debug directly from Visual Studio.

Why Blazor WebAssembly

It's ASP.NET Core

Blazor WebAssembly is a new and exciting part of ASP.NET, the well-known and widely used framework for developing web applications that run on the server. Blazor WebAssembly enables you to build rich and advanced single-page applications that run entirely on the client-side, without requiring a server connection. And with .NET 8.0, it will offer you even more features and benefits!

C# is the Language

C# is a powerful and versatile web language with a rich syntax and features. It supports object-oriented, functional, and asynchronous programming styles.

Mature Enough

C# in the browser was an experiment by Microsoft in 2017. It became Blazor in 2018, an official product in 2019, and a popular enterprise web framework since then.

Razor for the Components

Blazor components are built using Razor, a language that combines C# and HTML markup. Razor gives you the flexibility to create simple or complex UI components with ease, unlike any other framework.

Develop Web Apps Like Never Before

With the power of Blazor and WebAssembly, you will be able to build astonishing applications with ease. Mastering Blazor WebAssembly you will guide you step by step from the starting point and introducing Blazor up to helping you test and launch your app to the cloud

Chapters

Mastering Blazor WebAssembly is a complete resource that teaches you everything you need to build client-side web applications using C# & .NET 7.0.

The book was written to ensure the perfect balance between the theortical and pratical parts. Details are taken in consideration to make sure that you will be able to understand the concepts and apply them in your projects.

Mastering Blazor WebAssembly features transition from the introduction, basics, and the core concepts of Blazor WebAssembly to the advanced topics and techniques that help you build efficient and reliable apps.

The content is written in .NET 7.0, but because the book only focused on WebAssembly, it's still valid for .NET 8.0. A blog post was released on my website you can find the differences between .NET 7.0 and .NET 8.0 and stay up-to-date

Check out: Mastering Blazor WebAssembly .NET 8.0 Book Notes


01

Blazor WebAssembly Project Anatomy

Introduces Blazor WebAssembly, guides you to set up a project and understand its structure, and covers essential topics such as environments and dependency injection.

02

Components in Blazor

Explains the concept of components in Blazor WebAssembly and SPAs, covering how to build, communicate, and style them.

03

Developing Advanced Components in Blazor

Introduces advanced component types such as layouts, templated components, and dynamic components, showing you how to use Razor class library projects to build reusable components.

04

Navigation and Routing

Explains the navigation process in a SPA and how to implement it in your Blazor apps. The chapter also covers how to use query parameters, send and receive data via a URL, and respond to navigation changes.

05

Catching User Input with Forms and Validations

Explains how to create and submit forms in Blazor, use the built-in input components, validate user input, and create your own custom input component.

06

Consuming JavaScript in Blazor

Explains how and when to use JS in your Blazor WebAssembly project and how to call JS code from your Blazor app, and vice versa. It also shows how to wrap an existing JS package into a Blazor component using JS.

07

Managing Application State

Introduces the concept of state management in an SPA and shows three different techniques to preserve the state of your application – using local storage, in-memory, or a URL.

08

Consuming Web APIs from Your Blazor App

Provides an overview of web APIs and web API clients, showing you how to understand an existing web API and send HTTP requests to it from Blazor. It also covers delegating handlers, IHttpClientFactory, and how to organize API calls in your app.

09

Authenticating and Authorizing Users in Depth

Explains what authentication and authorization are, and then deep-dives into how Blazor handles authentication and how to develop your custom authentication flow with JSON Web Tokens. It also shows how to control the UI and the app logic based on the authentication state and call secured web API endpoints.

10

Error Handling

Shows you how to make your app reliable and the techniques to handle errors efficiently in your apps.

11

Provides you with advanced mechanisms in Blazor that help you make your app as efficient as possible, by increasing the rendering speed and reducing the app size for faster load time.

12

RenderTree in Blazor

Explains in detail how Blazor renders components and manages the Document Object Model (DOM), introducing the concept of RenderTree. It also shows how you can improve your app performance by learning how things work under the hood.

13

Testing Blazor WebAssembly Apps

Introduces the concept of component testing and the bUnit library, providing you with what you need to write efficient unit tests for your components. The chapter also covers End to End (E2E) testing and the Playwright package.

14

Publishing Blazor WebAssembly Apps

Shows the checks to do before publishing an app, introduces the Blazor WebAssembly ASP.NET Core Hosted app model, and guides you step by step to release your apps to Azure App Service and Azure Static Web Apps.

15

What’s Next

Provides an overview of more components and use cases to help you apply what you learned in this book.

Reviews!

Ukraine
Sami Alan Abdullah

Simply Magnificent

September 04 2023

Thank you mister Ahmad for giving the time and effort to write such an amazing book. It was a wonderful journey reading and getting enlightened of how powerful Blazor is, the potential of building sophisticated apps using such a monstrous framework. Your book made every tiny bit easier and fun. I particularly adored the fact that it goes comprehensively through the needed technical details... Read More...

5

Ukraine
John

A Deep Dive Into Blazor WebAssembly: A Senior Developer's Perspective

August 18, 2023

Having navigated the seas of software development for over 25 years, I've witnessed the ebb and flow of various technologies and frameworks. With the ascent of Single Page Applications and JavaScript frameworks, the landscape has certainly become interesting. Enter Blazor WebAssembly, a framework that promises to combine the robustness of C# with the flexibility of modern web development, and I was all ears. "Mastering Blazor WebAssembly" has been an enlightening guide in this journey.... Read More...

5

Ukraine
Daniel Dickey

Great Balance - Well Organized

August 31, 2023

I am a .NET developer who loves C# and lives in the Microsoft tech stack so Blazor is my favorite framework for interactive web applications. This rare gem of a book strikes a great balance between accessibility and technical depth. Here's a few things I like about Mastering Blazor WebAssembly:

Depth
With "Mastering" in the title you expect there to be technical depth, and that is what you get with this book. Ahmad pulls back the curtain in every section to help the reader understand the inner workings of Blazor... Read More...

5

Ukraine
R. Sutherland

Great for Beginner and Intermediate Blazor Developers

August 21, 2023

The book as a whole, and each chapter in part, takes the user from basics to deep understanding through straightforward content and examples. Before reading this book, I contributed to a Blazor project on a team because I knew C#. After reading, I can contribute to a Blazor project because I know and understand Blazor and C#

There are three things that I appreciate about this book. First, each chapter (except the final) ends with a "Further reading" section. This is a curated list of valuable resources to dig... Read More...

5

Ukraine
Quinn Sampica

Comprehensive for the aspiring mid-level developer

August 22, 2023

Really good content that requires some familiarity with modern .NET/ASP.NET Core concepts. I liked how the focus was simply on WebAssembly as trying to tackle the complexities of both Server/WASM under one hood can get confusing (as well as with .NET 8, this is becoming even more confusing).

Great book if you're a tenured junior or mid-level developer already familiar with .NET and looking to hone your Blazor craft.... Read More...

5

Ukraine
Rasheed Mozaffar

The only needed resource to master Blazor Wasm

August 19, 2023

Mastering Blazor WebAssembly is by far the most thorough resource for learning Blazor WebAssembly with modern .NET. The book goes far beyond the basics to teach you the inner workings and anatomy of Blazor so that you can take your client-side projects to the next level. With clear and practical examples, the book covers it all in a swift and simple manner...

The book starts by introducing the Blazor WebAssembly project template and dissects the... Read More...

5

View More

There is a Free Chapter For You

You can access Chapter 11 for free and download it to see the quality of the content. This chapter teaches you how to improve the performance of your application using Blazor. You will learn various techniques and features that will make your app load faster and run smoother especially for data-intesive applications

Get Chapter 11

Who Should Read This Book?

C# Developers

If you are a C# developer willing to advance their skills and start developing single-page applications. And developers who wants to develop apps for the mobile and desktop using MAUI hybrid.

JS Developers

JavaScript developers can finally land on stable framework that's maintained by Microsoft. WebAssembly is faster and more secure, and using C# will take your career and skills to a fully new level.

Curios People

Curios developers who are excited to see how WebAssembly works in production, and how you can leverge it to build enterprise-level apps. This book is just the right thing for you!

Paperback Edition

Nerds always prefer holding the papers in hand for better focusing and commiting. Physical books are inspiring, espeically when the book is for a technology like Blazor. This book will enhance your skills and open huge doors for you in your career, either you are a professional employee or a hoppiest, this title is just of you

Kindle Edition

You can kick of your Blazor WebAssembly journey with the Amazon Kindle edition. If you are fan of reading on the eReader, you can get "Mastering Blazor WebAssembly" copy delivered to your Kindle through the following link:

Author

Ahmad Mozaffar

Senior Software Engineer, Cloud Developer, and Trainer who currently works at ContraForce responsible for developing SaaS platforms using Blazor, Azure, AI, and other modern technologies. His originally from Syria and his passion for software development started at a very early age.
Worked on Blazor since it was an experiment in 2018, and using it in production ready-apps for 5 years and counting...
Technical author, trainer, and open-source developer