Skip to content

Blazor interactive render modes compatibility #347

Open
@Tarmil

Description

Based on my experimentations, Bolero is mostly compatible with the new .NET 8 Blazor interactive modes (aka Blazor United, ie InteractiveServer, InteractiveClient and InteractiveAuto render modes). See https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0

There is a caveat that Bolero's routing is not compatible with having different render modes for different pages; you need to specify a mode on the ProgramComponent. Using different render modes for different pages only works with Blazor's built-in, attribute-based routing.

We need some improvements to integrate it better:

  • An attribute to put on a component to indicate its render mode. For .razor components, Blazor generates a custom attribute for each component that has a @rendermode; we can instead create one attribute that takes an enum as argument to specify the render mode.
  • Add an option to AddBoleroHost, or an alternative method, that enables interactive render modes. This will make boleroScript always include _framework/blazor.web.js instead of *.server.js or *.webassembly.js.
  • Add an option to the project template to use interactive modes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions