4 ms·
Web components work very well in isolation, and/or within a homogenous web component framework/library. However, it is still pretty challenging to pass data th
by nevir 8y ago
Web components work very well in isolation, and/or within a homogenous web component framework/library.
However, it is still pretty challenging to pass data throughout web components (in a way that allows you to build a complete application). HTML attributes are not great for data transfer (string serialization for everything). JS properties are a bit opaque (not represented by markup). And everyone ends up wanting some sort of property binding system, which may be unrealistic to standardize.
I think there will always be a place for some amount of framework/library support necessary for application builders.
- ravenstine 8y agoOh I definitely agree. I'm not at all proposing that components make frameworks obsolete. It's just that I would like a future where the Web Component standard becomes the first answer to the frontend development question before moving on to more specialized solutions. Existing frameworks and Web Components would go hand in hand.
- tdumitrescu 8y agoYeah, the way we use web components at Mixpanel involves sticking to the vanilla APIs for lifecycle management, but we still need libraries to handle inter-component communication, state and rendering (see my discussion at https://engineering.mixpanel.com/2018/06/12/making-web-components-work/ https://engineering.mixpanel.com/2018/06/12/making-web-compo... and https://github.com/mixpanel/panel https://github.com/mixpanel/panel). I do hope some of these concerns eventually get addressed in the standards though.
- spankalee 8y agoIt's quite easy to pass properties between elements and build entire apps out of Web Components. Many have been doing it for years. Yes, it requires not just using plain markup - but template systems or JSX+VDOM are really good at this, and there's a huge choice in libraries. SkateJS is a library that allows you to plug-in several renderers to build components. LitElement uses lit-html. Polymer, Svelte, Vue, and Angular (the last when compiled to Custom Elements) have their own... There also is a chance at standardization with the Template Instantiation proposal from Apple.
- petilon 8y ago> HTML attributes are not great for data transfer (string serialization for everything). You can JSX (as first introduced by React) to pass objects to Web Components. See: https://github.com/wisercoder/uibuilder https://github.com/wisercoder/uibuilder