3 ms·
I'll preface with saying I'm not too familiar with the technology, but I don't really get web components, everything I've seen online says they're a bad API and
by satvikpendem 3y ago
I'll preface with saying I'm not too familiar with the technology, but I don't really get web components, everything I've seen online says they're a bad API and abstraction. Does Lit fix those issues? Genuinely curious as I haven't used Lit or WC before, I've been mainly working with React.
The Failed Promise of Web Components: https://news.ycombinator.com/item?id=24640151 https://news.ycombinator.com/item?id=24640151
Why I don't use web components: https://news.ycombinator.com/item?id=20232628 https://news.ycombinator.com/item?id=20232628
- mock-possum 3y agoWeb components are just custom html elements, with the option of an added shadowDOM. Oh, and slots. But that’s it. If you’ve got an interface component that you find yourself using over and over - like say a complicated multi select drop down type thing - maybe you just make it a custom element, define a custom class that controls it, and drop instances of it throughout your site, the same as you’d drop default <select>s.
- deleted 3y ago[deleted]
- yellow_lead 3y agoThe first link complains about databinding a bit. Not a lit expert, but this seems to help with that: > Lit’s expressive, declarative templates (utilizing JavaScript tagged template literals) make it easy to describe how a component should be rendered. > Reactive properties represent a component’s public API and/or internal state; your component automatically re-renders whenever a reactive property changes. Also, good question, I would like to see more discussion here vs. downvote without comment.
- deleted 3y ago[deleted]