← Back to context

Comment by pas

1 month ago

> JQuery already had a feature that rendered the shadow DOM unnecessary, but it would require discipline that most developers did not have nor understand.

Could you explain this please?

It is the ability that JQuery gave us to scope the css selector to a particular node. If you know POSIX, similar to the "at" functions for filesystems. By CSS child selector, classes, IDs, and what JQuery gave us, you could already develop self contained components, HTML custom elements if you like, without the need for shadow DOM. If you teach people to write well defined CSS, they argue that the CSS is over qualified and similar nonsense. Then the industry turns around and invents the shadow DOM. Any fool can come up with a complicated solution, but the best mind comes up with the simplest. And simplicity is not easy.

Take a careful look at "http://eyeandtea.com/crxcmp", and see how the need for shadow DOM is completely absent.

And this simple thing is just one of the geniuses exposed by JQuery.