fsbolero / Bolero

Bolero brings Blazor to F# developers with an easy to use Model-View-Update architecture, HTML combinators, hot reloaded templates, type-safe endpoints, advanced routing and remoting capabilities, and more.
https://fsbolero.io
Apache License 2.0
1.06k stars 54 forks source link

Web Components not processed in HTML templates #221

Open AngelMunoz opened 3 years ago

AngelMunoz commented 3 years ago

Hello there!

I was working on a couple web component samples (using Lit) and using HTML templates when I loaded my web component inside an html template it doesn't get added in the DOM but after saving the file (and triggering the hot-reload mechanism) the web component gets attached to the dom not sure what's going on but I suspect that since it's not part of the standard html elements it gets ignored by the engine

Screen Shot 2021-05-12 at 10 28 54

here it is after saving the file

Screen Shot 2021-05-12 at 10 31 15

since web components "work as any other html tag" this might be troublesome in the future once design systems or in-house design systems (made with web components) become more mainstream

I made a repository showing this https://github.com/AngelMunoz/WCSample

AngelMunoz commented 3 years ago

also this might affect the event binding for the F# DSL since custom-events sent by web components may have any arbitrary name like on-my-click-event and they can be CustomEvents not just Events which differ on providing data via a .details property

xperiandri commented 12 months ago

Do you run client-only project or server?

AngelMunoz commented 11 months ago

I think when I was testing this it was on the client, but it should not matter on the server (specially when pre-rendering is on) these web components are picked up by the browser itself so I'd expect the final content to include the tag as is

AngelMunoz commented 11 months ago

But for events and other stuff... I think it wouldn't be as straight forward as it seems due blazor event handling docs