Blazorators: C# Source Generators for Blazor
summary
An open-source tool claims to source-generate JS interop for Blazor by parsing TypeScript declarations and emitting C# partial interfaces, implementations and generates DI hooks as NuGet packages. It currently supports generics and callbacks, custom serialization and dependent types, and demos show localStorage persistence, a geolocation prompt that renders coordinates, and speech synthesis voices working from the generated APIs. Implementation uses C# Source Generators + a homemade TypeScript parser (now regex-based, being rewritten to a proper AST), the project is functional but incomplete and invites community contributions.
AI-written summary · about
chapters (10)
- 0:00Welcome to Blazorators
- 1:33Design goals
- 5:21Source Generators in C#
- 8:06Generating JS interop code
- 14:19Demo in action
- 21:05Generated code structure
- 23:34Local storage & geolocation demo
- 26:04Speech synthesis with Telerik REPL
- 29:16Future work & community
- 31:47Resources & contribution
related talks
01h 00mASP.NET Blazor programming 101
01h 04mA fistful of Blazor; Its .NET in the browser
01h 01mBlazor, a new framework for browser-based .NET apps
01h 02mBlazor in more depth
54mExploring Source Generators
51mComponent-based C# and Razor Programming in Blazor
01h 12mC# Source Generators in Action
53mCreating Next-Generation Applications with Blazor
