News for hackers. Stuff that matters.
Re:Web Components could replace frontend frameworks? by johncolanduoni on Thursday April 11, 2019 @09:22PM (#19641062)
I would argue that for what the OP was discussing `textContent` (From the linked example) is very much like `innerHTML` (As it’s a safer version of the former). I’m not sure what you mean by the DOM being neither stateful or stateless, or describing an implementation of logic. Could you clarify?
Re:Web Components could replace frontend frameworks? by austincheney on Thursday April 11, 2019 @09:43PM (#19641170)
The DOM is a model of a markup language instance plus access methods. State describes memory of properties resulting from a change. For example HTTP is stateless.

The DOM can be both stateful and stateless, neither, or one of. The statefulness depends on your application logic rather than any intrinsic quality of the DOM itself.

Re:Web Components could replace frontend frameworks? by johncolanduoni on Friday April 12, 2019 @02:25AM (#19642468)
Any stateful data structure is stateless if it’s not changed. That doesn’t seem to me to be a particularly deep revelation about the DOM.

Back to your original point, that code example you linked attatches a shadow dom, creates an element in it and then puts text in it. I fail to see how that’s declarative or stateless, and AFAIK that’s the only way to populate a shadow DOM (the original HTML of the document cannot put elements there).

Re:Web Components could replace frontend frameworks? by bicknergseng on Thursday April 11, 2019 @11:23PM (#19641667)
Ah yes, the quantum DOM.