Post

Nice post! I think a couple of claims are a little off though, in particular there are common patterns that make web components easily do things you say they can't in the article...

Like setting properties. This is not a Lit abstraction. Properties are plain JS. You can implement them without any helpers. And you can set them from plain JS too, or from frameworks an libraries like React, Angular, Vue, Lit, Stencil, FAST, etc. Lit just provides a way to do it from templates.

In my other posts I gush over the lit context. It's the only reasonable way to share live javascript in a somewhat ergonomic way. Technically though... a provider shouldn't know what should be put in its slots, and there are many that say reaching into your assigned slots is a bad pattern

0 reposts0 likes

I think the thing is that there are ways to share state, but it's just different when you're doing it through DOM apis and events. The average front ender is not used to this because of frameworks.

I don't think firing events really counts as knowing what's in slots, but also I don't think it's bad to know what's in slots. All this stuff is very flexible, you can use it in lots of different ways. There may be some HTML-related best practices, but I don't want people to feel overly constrained.

HTML already has lots of parent/child requirements. Forms, detail/summary, picture, etc. Even without that, if a parent interacting with a child meets the use case, then go ahead! Do what works.