←back to thread

218 points mdhb | 4 comments | | HN request time: 0.02s | source
Show context
pier25 ◴[] No.44392178[source]
The web really needs native templating, reactivity, and data binding.

I can't even begin to imagine how much CPU and bandwidth is wasted with billions of users downloading, parsing, and executing something like React.

replies(4): >>44392500 #>>44393120 #>>44393371 #>>44400323 #
1. nwienert ◴[] No.44392500[source]
React isn’t templating though.
replies(3): >>44395047 #>>44399021 #>>44400338 #
2. ASalazarMX ◴[] No.44399021[source]
Respect for focusing on semantics but not contesting the CPU and bandwidth waste. That takes honesty.
3. ivape ◴[] No.44400338[source]
That's kind of like saying React isn't just a bunch of a functions (it is). What do the JSX templates compile down to?
replies(1): >>44465949 #
4. nwienert ◴[] No.44465949[source]
Missed this but - there’s a very meaningful difference between templates and React at least how most people think of templates.

React lets you return dynamic tree structures and insert code anywhere inline in that structure. Most templates explicitly don’t allow that for good reason. Further, most but not all templating frameworks have special syntax for conditional logic and loops.

If JSX is templating then templating has no meaning. Would createElement() be a template? In that case all functional programming is.