4 ms·
So what do you do? Hand-craft Web Components?
by WA 4y ago
So what do you do? Hand-craft Web Components?
- dtagames 4y agoIn Lit, yes. It's hand-crafted web components with support for one-way data binding by parameter passing. Any other updates are by event notifications, as the commenter said.
- WA 4y agoAh thanks for clarifying, it sounded like you wouldn't recommend either Lit or Stencil.
- dtagames 4y agoSorry if I wasn't clear. I'm a huge fan of Lit! It gives you the freedom to make your own framework -- the parts you need. I respect the OP's comment and our difference of opinion, which is why I didn't reply negatively to it.
- baxuz 4y agoI avoid using them, except when having to expose a component to a third party, if they _really_ want the ergonomics of using WCs. Then I'd use something like https://github.com/preactjs/preact-custom-element https://github.com/preactjs/preact-custom-element, https://stenciljs.com/docs/custom-elements https://stenciljs.com/docs/custom-elements or https://github.com/solidjs/solid/tree/main/packages/solid-element#readme https://github.com/solidjs/solid/tree/main/packages/solid-el.... As far as I see, there is nothing that WCs provide which isn't already solved, in a better way, both for devs and users. And making a framework that use custom elements and shadow DOM for component-based logic and encapsulation seems like a purely philosophical approach to adhere to some vision of "platform purity".