3 ms·
The title is probably correct, but not sure it matters. Most applications will not live that long. I recently tried using Web Components, and something that is
by locallost 3y ago
The title is probably correct, but not sure it matters. Most applications will not live that long. I recently tried using Web Components, and something that is very simple in any framework like using a <slot> was, um, eh, incredibly confusing and complicated to setup. This maybe doesn't matter if your component is just a <pixelart-demo>, but if you're building an application in JS then using slots is for me a critical feature because it allows me to have composable components. Debugging with "shadow dom" was also really confusing in dev tools.
- mmis1000 3y ago> incredibly confusing and complicated to setup. And some being almost impossible to work correctly without MutationObserver or some polyfill of it. The renderProp in react (or scoped slot in vue) is so commonly used to inject data from the parent component into child component. But replicate such behavior in webcomponent is simply... impossible without MutationObserver hacks. The assumption of web component that child/parent component never need to know the info of each other just don't make sense in real world. And the assumption that child component is always loaded and initiated regardless of parent component is also falsy in most frameworks. In most frameworks, the parent component decided whether child should be actually loaded or initiated.