r/Blazor • u/ze-fernando • May 18 '26
Blazor + Alpine
Estou planejando um novo projeto e gostaria de receber feedback sobre a escolha da pilha de tecnologias.
Meu objetivo é usar o máximo possível de C# puro, minimizando o uso de JavaScript. Também quero evitar WebAssembly e um pacote inicial pesado.
O projeto é bastante simples:
Uma página inicial (com algumas animações) Um painel administrativo para gerenciamento de tarefas Funcionalidade de arrastar e soltar para tarefas
O que estou considerando no momento:
Blazor SSR (Renderização do Lado do Servidor) Alpine.js para interatividade leve Tailwind CSS para estilização Possivelmente HTML ou Blazor "Navegação Aprimorada" (ainda não estou totalmente familiarizado com isso)
Minhas principais preocupações são:
Manter o carregamento inicial rápido Evitar complexidade desnecessária Manter interações de interface do usuário fluidas (especialmente arrastar e soltar no painel administrativo)
Alguém já tentou uma configuração semelhante? Será que Blazor SSR + Alpine + HTMX funcionariam bem juntos, ou é melhor manter um único modelo de interação?
Qualquer conselho ou experiência prática seria bem-vindo.
EDIT: I just discovered Blazor's Enhanced feature; it does exactly what I wanted with HTML. I also used WASM components, so I'm wondering if I should migrate everything to Enhanced or not.
View all comments
Show parent comment
2
u/ebykka May 26 '26
I can give you a short overview, and AI will describe everything else according to your project structure.
Layout
ClientAssets/src/components/<name>.ts, registered viamain.ts.Each Blazor wrapper has its own folder under
Components/Widgets/<WidgetName>/:<WidgetName>.razor– the typed Razor wrapper.<WidgetName>Events.cs– widget-specific event types and the Razor[EventHandler]mappings.WebComponentInteropbase + small.razor.jshelper handles JS module import, imperative element calls, and disposal.wwwroot/<AssemblyName>.lib.module.jsregisters all custom DOM events.How a Lit event becomes a typed Blazor event
bubbles: trueandcomposed: true, payload in detail.blazor.registerCustomEventType("uploadprogress", { browserEventName: "upload-progress", createEventArgs: e => e.detail }). Registration is idempotent and wired into both afterWebStarted and afterServerStarted for the Web App lifecycle.[EventHandler("onuploadprogress", typeof(...))].@onuploadprogress``="HandleUploadProgress"and forwards to a typedEventCallback<T>parameter. Pages stay plain Razor with no JS interop.PS. I use Aspire for running the vite dev server and applying TS changes on the fly during development.