Aspnetcore: Consider Index.html -> Index.cshtml or tag where Blazor will render head html

Created on 17 May 2018  路  3Comments  路  Source: dotnet/aspnetcore

Not sure if this has already been mentioned or not but it would be nice, if possible, if the wwwroot/index.html could initially be configured server side so that we could add Partials to it? Or similar functionality added possibly another way. Sometimes we like to use partial views in the head tag for example (e.g. favicons). Not sure how we can reach the head tag any other way?

I think this is somewhat related to https://github.com/aspnet/Blazor/issues/842

area-blazor

Most helpful comment

This fits into what we have planned for aspnet/Blazor#108.

Basically the idea is that we'll simplify the Blazor startup process to being a regular <script> tag (not the magic blazor-boot tag) and/or JS function call. Then you can embed it into any server-generated page.

All 3 comments

I think that if someone finds a solution to problems mentioned in aspnet/Blazor#842 your problem will be solved also.

Allowing to load a Blazor component/app from a tag-helper in an MVC/WebPages application would fix this and would allow loading multiple smaller Blazor apps/components in a bigger MVC/WebPages application.

In any .cshtml file, something like this:

  • <blazor component="app" />
  • <blazor startup="app" />
  • <blazor entryPoint="app" />
  • <SomeNamespaceOrPrefix:app someProperty="value" />

    • ex.: this would allow loading components with the same name from different assemblies

  • Anything else that would be better :)

Use case 1: for an application with lots of basic UI elements (like CRUD modules) but with one or more places that would require a more complex UI. This would allow to easily leverage the power of both SPA and classic client-server models in a mix and match matter, maximizing development efficiency.

Use case 2: slowly migrating an existing application toward a richer UI model. Since most companies don't have an unlimited budget (especially smaller ones), this would allow migrating an application gradually or partially integrating newer UI elements (Blazor) in an existing application cost-effectively.

If you think this would be better as it's own issue, I can create one.

This fits into what we have planned for aspnet/Blazor#108.

Basically the idea is that we'll simplify the Blazor startup process to being a regular <script> tag (not the magic blazor-boot tag) and/or JS function call. Then you can embed it into any server-generated page.

Was this page helpful?
0 / 5 - 0 ratings