20 ms·
> a virtual DOM? Aren't current web standards enough to make a flower shop website? Of today's frameworks, all but Svelte use a virtual DOM.
by MaxBarraclough 6y ago
> a virtual DOM? Aren't current web standards enough to make a flower shop website?
Of today's frameworks, all but Svelte use a virtual DOM.
- jcbrand 6y agoNot true. litElement (used by Polymer) uses tagged template literals and no vdom.
- MaxBarraclough 6y agoYou're right, LitElement and Polymer don't use a VDOM. [0][1] I don't think Polymer 3 uses LitElement though. Seems to say they're highly compatible, but that Polymer 3 uses PolymerElement, not LitElement. [2] [0] https://lit-html.polymer-project.org/ https://lit-html.polymer-project.org/ [1] https://www.infoq.com/news/2019/06/polymer-lit-html-element-release/ https://www.infoq.com/news/2019/06/polymer-lit-html-element-... [2] https://github.com/Polymer/polymer https://github.com/Polymer/polymer
- spankalee 6y agoPolymer 3 and LitElement are separate projects by the same team. LitElement is the successor to Polymer 3. It would have been named Polymer 4, but it's quite different. They're highly compatible because they are both web components-based. There's no "framework" that creates component instances, the browser does that when it sees the custom elements. So each component is in control of its own lifecycle and rendering. You can have a Polymer element use LitElements (or Stencil, or Lightening, etc) or vice-versa.
- MaxBarraclough 6y agoHow does it work with data-binding? Isn't that a Polymer-specific feature, rather than a feature of Web Components?
- spankalee 6y agoAs mentioned, LitElement doesn't use a vdom, but neither does Angular, Ember/Glimmer, Solid, incremental-dom, and many others. VDOM diffing is pretty slow, memory intensive, and unnecessary. It's very good it's not the only game in town.
- MaxBarraclough 6y agoThanks, I see I'm mistaken. Could've sworn Angular was VDOM-based, but no. [0] [0] https://stackoverflow.com/a/39739739/ https://stackoverflow.com/a/39739739/