aspnet / samples

Samples for ASP.NET Core
Other
986 stars 1.14k forks source link

JS component generation for a custom DLL #81

Open Stamo-Gochev opened 3 years ago

Stamo-Gochev commented 3 years ago

I am looking at the JS component generation example at: https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/JSComponentGeneration

and would like to run the tasks for an external DLL that contains blazor components.

@MackinnonBuck

  1. Can you add some insights how to do that? Adding some details how to do it for the BlazorAppGeneratingJSComponents project and re-generating the Counter component will also be helpful. Still, my main scenario is to run the generator over a custom set of UI components and see which of them are "generatable" and potentially update the generator when necessary.

@SteveSandersonMS

  1. Looking at the custom elements sample Can you add some details if the following statement for child content: https://github.com/dotnet/AspNetCore.Docs/blob/5417884bf9f97ce9724092a7e2836ccff2662a82/aspnetcore/blazor/components/prerendering-and-integration.md#dynamically-add-root-components

    [!NOTE] Rendering child content of a dynamically-rendered component isn't supported.

is a current limitation and whether it can be supported in the future? The official docs does not have this section, but most of the components in my 3rd party library have child components in their definition, so as far as I understand it, they cannot be used in custom elements/angular/react/etc scenarios, e.g:

<BlazorComponent>
    <ChildComponent1></ChildComponent1>
</BlazorComponent
SteveSandersonMS commented 3 years ago

[!NOTE] Rendering child content of a dynamically-rendered component isn't supported.

That statement is incorrect. Sorry for the confusion. As far as I'm aware, that statement was removed from the final docs. Dynamically-added components can have child components in the normal ways. If the docs still claim this anywhere please let us know so we can change it!