Hacker News new | ask | show | jobs
by thrashh 1294 days ago
It wasn’t a change in web browser tech

It was that someone put in the time to write a JS preprocessor that went along with their framework. That was React’s novel addition

Without a preprocessor, users of your framework either use plain JS to generate HTML (i.e. jQuery) or you use templates.

Both of them always looked really ugly on frontend

With React’s JSX preprocessor, you can write HTML by… writing HTML. And you can mix custom components without doing some weird and ugly syntax

Does React use a shadow DOM? Yes, but so could have jQuery or Handlebars.js too, and it wouldn’t have mattered. People don’t care how it works as long as it works. As far as libraries go, what gets adopted is what looks and feels the nicest — as it should be

2 comments

> Does React use a shadow DOM? Yes

No. You must be confusing it with virtual DOM.

As for React, what we are currently observing is that 1) it's a fairly large library in itself (~50kB of minified gzipped javascript); 2) it has a relatively slow DOM update mechanism; 3) it rerenders too eagerly, making it too easy to further degrade performance; 4) it's a lock-in into a non-standard jsx syntax, forever tying you to preprocessors.

What conclusions an architect would make looking at all this, I do not know.

Jquery got squashed from two directions. One being react and other data binding frameworks, the other side being browser tech modernizing and aligning, such that bare js could be used, without a thick compatibility layer in between.