What does HackerNews think of panel?

Web Components + Virtual DOM: web standards for powerful UIs

Language: JavaScript

Webcomponents will outlive React 13? Sure. Will they outlive React entirely or its cousins like Solid and Svelte? Perhaps not.

Webcomponents and React look like they solve the same problem but they do not.

Webcomponent api is pretty shallow. You get connected/disconnnected/attributeChanged call back but gotta write your own property setter and getters, slots, template, shadow dom and that’s mostly it. Shadow dom becomes a pain to work with if something needs to pierce it. No built-in webcomponent api for efficiently applying state changes to dom. All attributes have to be strings and other types need to be parsed.

Mixpanel went all in on webcomponents. They made their own framework on top of webcomponents. https://github.com/mixpanel/panel

Worked on panel lib and webcomponent UI for many years. Webcomponents are not a silver bullet.

The issue with webcomponents is there are a ton of libraries that fill in the missing gaps. There’s not a lot you can do with pure vanilla webcomponent api. Google has their own thing, Microsoft had multiple internal libs across orgs, Reddit does their own thing.

The most standard thing for frontend with wide adoption right now is React.

vanilla webcomponents are good for simple widgets in a vanilla html/css page. To build complex single page applications, would not recommend it. You’d be building you’re own bespoke framework to fill in the gaps.

We have been using a small bit of glue code to write Web Components declaratively with Snabbdom for a couple of years at Mixpanel: https://github.com/mixpanel/panel. Happy to talk further about our experience!
Yeah, 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-compo... and https://github.com/mixpanel/panel). I do hope some of these concerns eventually get addressed in the standards though.
Easy: web components have not implemented a single part of the original promise [1].

It's not Web Components that are happening, it's the dozens of frameworks required to make them work that are happening.

Even mixpanel's library "does so by providing an easy-to-use state management and rendering layer built on Virtual DOM (the basis of the core rendering technology of React). Through use of the Snabbdom Virtual DOM library and first-class support for multiple templating formats" [2]

Web Components are a very low-level extremely limited crummy DOM-based API that no one in their right mind wants to use. They are not happening.

---

[1] https://fronteers.nl/congres/2011/sessions/web-components-an...

[2] https://github.com/mixpanel/panel

We've been using Web Components + Virtual DOM to build our web apps for the last year at Mixpanel: https://github.com/mixpanel/panel. The biggest issues have been dealing with polyfill issues (especially Shadow DOM leakage) and versioning elements (given the global namespace issue of "registerElement")