4 ms·
As an outsider, I feel like React both does too much (a virtual DOM? Aren't current web standards enough to make a flower shop website?) and too little -- there
by thanatropism 6y ago
As an outsider, I feel like React both does too much (a virtual DOM? Aren't current web standards enough to make a flower shop website?) and too little -- there's all these terms/technologies/subframeworks that people are using like "create-react-app" and "Redux" and so on.
It's neither an overarching architecture that makes normal web technology obsolete but runs on it, like Windows 95, nor a website generator like Wordpress. Web tech confuses me thoroughly, and I read HN all day.
- quxbar 6y ago> As an outsider, I feel like the Model-T does too much (an internal combustion engine? Aren't current horses enough to carry our wagons?) If you don't need a virtual DOM, nobody will judge you for not having one. But once you really feel 'behind the wheel' of a framework like react or vue, it's hard to go back. Not only is it easier to hack out something quick over a weekend, it's also more suitable for collaborating large, complex applications.
- 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/