Hacker News new | ask | show | jobs
by andrewfromx 502 days ago
Modern frontend frameworks like React, Vue, and Angular provide their own state management and DOM manipulation approaches that are more efficient than jQuery's direct DOM manipulation
2 comments

Wrong, it’s a lie some people forced years ago. “DOM manipulation” boils down to setting attributes and reordering children. It works the same for everyone cause it’s a browser API.

React, Vue and Angular work slower because they have to actually find a difference between the last two versions of their “virtual dom” to get a set of changes to apply to existing dom elements, which they then do in the same way as everyone else.

And web components (with Lit) give you the shadow DOM and total control over how you program and use HTML elements.

jQuery is code smell today. The most popular use case, directly touching a DOM element is built into JS now (querySelector) and you really don't want to be doing that anyway.