News for hackers. Stuff that matters.
Re:HTML Web Components by webstrand on Monday November 13, 2023 @01:45PM (#38253602)
What's the advantage of this over just using divs for everything, though? If this used shadow dom, I could understand. But custom elements don't even behave like blocks by default. Namespace collisions with custom components are just as bad as class collisions, if not worse since you can't `.myns.button`. Is it just the `connectedCallback` versus some manual method of wiring up elements to their javascript behaviors?
Re:HTML Web Components by sirwhinesalot on Tuesday November 14, 2023 @10:54AM (#38264838)
Yup, connectedCallback is a lot nicer than a for loop applying the right code to the right divs.