<p><span>Take advantage of your C# skills to build UI components and client-side experiences with .NET. With this practical guide, you'll learn how to use Blazor WebAssembly to develop next-generation web experiences. Built on top of ASP.NET Core, Blazor represents the future of .NET single-page app
Learning Blazor: Build Single-Page Apps with WebAssembly and C#
β Scribed by David Pine
- Publisher
- O'Reilly Media
- Year
- 2022
- Tongue
- English
- Leaves
- 327
- Edition
- 1
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Take advantage of your C# skills to build UI components and client-side experiences with .NET. With this practical guide, you'll learn how to use Blazor WebAssembly to develop next-generation web experiences. Built on top of ASP.NET Core, Blazor represents the future of .NET single-page application investments.
Author David Pine, who focuses on .NET and Azure content development at Microsoft, explains how WebAssembly enables many non-JavaScript-based programming languages to run on the client browser. In this book, you'll learn about real-time web functionality with ASP.NET Core SignalR and discover strategies for bidirectional JavaScript interop. David also covers component data binding, hierarchical event-driven communications, in-memory state management, and local storage.
This book shows you how to:
- Create a beautiful, feature-rich Blazor app
- Develop and localize an enterprise-scale app using GitHub Actions and Azure Cognitive Services Translator
- Create advanced validation scenarios for input-based components with forms
- Automatically deploy and host to Azure Static Web Apps, and rely on HTTP services
- Use a geolocation service and speech synthesis and recognition native to the browser
- Author a custom modal verification mechanism for validating a user
β¦ Table of Contents
Cover
Copyright
Table of Contents
Foreword
Preface
Why Blazor?
Who Should Read This Book
For .NET Developers
For Web Developers
Why I Wrote This Book
How to Use This Book
Roadmap and Goals of This Book
Conventions Used in This Book
Using Code Examples
OβReilly Online Learning
How to Contact Us
Acknowledgments
Chapter 1. Blazing into Blazor
The Origin of Blazor
Blazor Hosting
Blazor Server
Blazor WebAssembly
Blazor Hybrid
Single-Page Applications, Redefined
Why Adopt Blazor
.NETβs Potential in the Browser
.NET Is Here to Stay
Familiarity
Safe and Secure
Code Reuse
Tooling
Open Source Software
Your First Blazor App with the .NET CLI
Build the App
Install Dev-cert
Run the App
The Code Must Live On
Perusing the βLearning Blazorβ Sample App
Summary
Chapter 2. Executing the App
Requesting the Initial Page
App Startup and Bootstrapping
Blazor WebAssembly App Internals
Detecting Client Culture at Startup
Layouts, Shared Components, and Navigation
Summary
Chapter 3. ββComponentizing
Design with the User in Mind
Leveraging βPwnedβ Functionality
βHave I Been Pwnedβ Client Services
Restricting Access to Resources
The Introduction Component Says βHiβ
The Joke Component and Services
Aggregating Joke ServicesβLaughter Ensues
DI from Library Authors
Forecasting Local Weather
Summary
Chapter 4. Customizing the User Login Experience
A Bit More on Blazor Authentication
Client-Side Custom Authorization Message Handler Implementation
The Web.Client ConfigureServices Functionality
Native Speech Synthesis
Sharing and Consuming Custom Components
Chrome: The Overloaded Term
Modal Modularity and Blazor Component Hierarchies
Exploring Blazor Event Binding
Summary
Chapter 5. Localizing the App
What Is Localization?
The Localization Process
The Language Selection Component
Automating Translations with GitHub Actions
Localization in Action
Summary
Chapter 6. Exemplifying Real-Time Web Functionality
Defining the Server-Side Events
Exposing Twitter Streams and Chat Functionality
Writing Contextual RPC and Inner-Process Communication
Configuring the Hub Endpoint
Consuming Real-Time Data on the Client
Configuring the Client
Sharing a Hub Connection
Consuming Real-Time Data in Components
Summary
Chapter 7. Using Source Generators
What Are Source Generators?
Building a Case for Source Generators
C# Source Generators in Action
Source Generating the localStorage API
Source Generating the Geolocation API
Example Usage of the ILocalStorageService
Summary
Chapter 8. Accepting Form Input with Validation
The Basics of Form Submission
Framework-Provided Components for Forms
Models and Data Annotations
Defining Component Models
Defining and Consuming Validation Attributes
Implementing a Contact Form
Implementing Speech Recognition as User Input
Reactive Programming with the Observer Pattern
Managing Callbacks with a Registry
Applying the Speech Recognition Service to Components
Form Submission Validation and Verification
Summary
Chapter 9. Testing All the Things
Why Test?
Unit Testing
Defining Unit-Testable Code
Writing an Extension Method Unit Test
Component Testing
End-to-End Testing with Playwright
Automating Test Execution
Summary
Appendix. Learning Blazor App Projects
Web Client
Web API
Pwned Web API
Web Abstractions
Web Extensions
Web HTTP Extensions
Web Functions
Web Joke Services
Web Models
Web Twitter Components
Web Twitter Services
Index
About the Author
Colophon
π SIMILAR VOLUMES
<p><b>Discover blueprints that explore various components of Blazor, C#, and .NET to help you build web apps without learning JavaScript</b></p><h4>Key Features</h4><ul><li>Explore complete, easy-to-follow web projects using Blazor</li><li>Build projects such as a weather app, expense tracker, and K
<p><span>Build exciting web apps following step-by-step instructions and video examples.</span></p><p><span>Purchase of the print or Kindle book includes a free eBook in PDF format.</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Explore and build complete, easy-to-follow web project
<p><b>Build real-time apps at lightning speed using the most powerful full-stack JavaScript framework</b></p> <h2>About This Book</h2><ul><li>Create a complete web blog from frontend to backend that uses only JavaScript</li><li>Understand how Web 2.0 is made by powerful browser-based applications</l
<p><b>Build real-time apps at lightning speed using the most powerful full-stack JavaScript framework</b></p> <h2>About This Book</h2><ul><li>Create a complete web blog from frontend to backend that uses only JavaScript</li><li>Understand how Web 2.0 is made by powerful browser-based applications</l