4 ms·
I'm a bit confused by your examples. Lit templates and massively different from Angular templates, and more like React templates if anything. All Lit control f
by spankalee 3y ago
I'm a bit confused by your examples.
Lit templates and massively different from Angular templates, and more like React templates if anything. All Lit control flow and expressions are just JavaScript in Lit, like React, and different from Angular.
Directives in Lit are just JavaScript function calls you use in bindings. In Angular they are things that get access to the template and contents themselves.
Angular doesn't have a concept similar to Reactive Controllers that I know of. They are more similar to custom React hooks.
- no_wizard 3y agoNot how it works per se, its how it feels. I admit this to be a subjective metric, but it felt all kinds of Angular-like when I authored web components. Lots of boilerplate and indirection that I didn't enjoy. Its not the declarative authoring experience I was hoping for. Stencil was the cleanest to me because components felt like components, and could be interacted with more naturally. There's just alot of missing pieces. Tooling matters. Ecosystem matters. Developer Experience matters. There's a reason so many people turn to Next.js or Nuxt etc.
- WickyNilliams 3y agoHaving worked with both stencil and lit for years each, there's very little difference between them in how they operate? Stencil uses jsx, lit uses template literals. Otherwise there's a striking degree of similarity. You could probably convert a stencil component to lit in an hour or so (in fact, I have done this multiple times as I migrated away from stencil). If anything lit has some additional niceties, a better ecosystem, and less restrictions that gets imposed by stencil's compiler
- spankalee 3y agoTo reply to the reply below: I still don't understand the criticism. Lit template have HTML elements, bindings, and control flow. They're pretty JSX-like just within standard JS syntax. Stencil is the same, but JSX instead of HTML strings. Do you have any specifics on what the extra boilerplate is to you? What makes Stencil components feel like "components"? Are you just saying you like JSX?