Blazor

The Same Definitions on Blazor Server: What Has to Change?

DEV Community: #blazor Jeff Tsai
Blazor

Polhem's Blazor Server template renders ERP-style forms from imported Excel definitions, with no Razor page per screen. The post follows a 7-minute video to show how a layout edit reaches users without a redeploy or a new sign-in, and how it differs from the Avalonia version.

Key points

  • One project: `dotnet new install Polhem.Templates` then `dotnet new polhem-blazor-server`, with the back end hosted inside the website.
  • In-process page calls count as trusted local calls; the template warns against passing browser values into them.
  • No Razor pages per form: Blazor components render each screen from the FormLayout definitions in the Define folder.
  • DefineEditor's globe preview uses the same Blazor screens, so it matches production before you save with ⌘S.
  • Saving a definition invalidates its cache entry, but a form already open keeps the old layout until reopened.
  • At phone width the form drops to a single column and the side menu becomes a sliding button.
  • The two-column layout shrinks as the window narrows, and the list grid scrolls horizontally on narrow screens.

Why it matters

If you maintain internal line-of-business apps where the same form is reworked a dozen times a year, the interesting part here is not Blazor but the cache invalidation behind the layout preview: saving a definition drops the cached entry so the next form open reads the new layout. That removes the deploy-and-sign-out cycle, yet an open form silently keeps the stale layout until the user navigates away, which is worth writing down for support.

The trade-offs are the usual Blazor Server ones: one SignalR connection per signed-in user, screen state held on the server and no offline story. Also take the template's warning seriously — in-process calls are treated as trusted, so don't forward browser-supplied values into them.

Real-world use

  • An internal back office with dozens of data-entry forms whose layout changes several times a year
  • Teams that want layout fixes to reach users without a redeploy and without a new sign-in
  • Browser-first field use where the same form must collapse to one column on a phone
  • Mixed setups that later add Avalonia desktop or mobile front ends to the same back end over a JSON-RPC endpoint

This summary was generated by the agent from the original post on DEV Community: #blazor. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message