News for hackers. Stuff that matters.
Re:The Cost of JavaScript Frameworks by nicoburns on Friday May 08, 2020 @03:21PM (#23118407)
I'm not convinced that the 100kb is what's causing the perf problems though. It's not that hard to make a React app that loads almost instantly. There are lots of huge, slow react apps, but that's due to poor engineering choices not the framework.
Re:The Cost of JavaScript Frameworks by dwoot on Friday May 08, 2020 @04:21PM (#23118998)
You have not looked at Svelte. You've still the overhead of a virtual DOM and its diffing. People that turn a blind eye to Svelte will be blind-sided. It's like writing vanilla JS without all the baggage, because it's a compiler (think C++ versus Python).

I highly doubt that one can build a ReactJS app that loads faster than a Svelte one. I encourage you to try and share it. This is coming from someone that is a backend engineer that doesn't really do JS, but have had to for my own personal project and both perf and the subjective bit of expressiveness and joy of writing are important. Contrary to popular belief, people think that Svelte is trading perf for ugliness and lack of expressiveness.

Re:The Cost of JavaScript Frameworks by nicoburns on Saturday May 09, 2020 @10:53AM (#23125143)
So I had (an admittedly brief) look into Svelte on the back of your comment. And one thing that stands out to me is that it appears to be using string templating. This isn't a complete dealbreaker, but it's definitely a step back from the React world where everything is JavaScript. This was by far the biggest pain point in other frameworks like Angular, so I'd be pretty reluctant to go back to it.

Looking at the framework benchmarks (https://krausest.github.io/js-framework-benchmark/current.ht...), svelte is indeed a good bit faster than React. However, Inferno which takes a react-like virtual DOM approach but better optimised is faster still. So I'd be more inclined to go with that if I were willing to give up the React library ecosystem.

Re:The Cost of JavaScript Frameworks by uhoh-itsmaciek on Saturday May 09, 2020 @02:56AM (#23122832)
I see TypeScript support is on the road map. I haven't used it yet, but that's exciting.
Re:The Cost of JavaScript Frameworks by postalrat on Friday May 08, 2020 @11:23PM (#23121986)
I love react. But when I hear developers say their react app loads instantly I think:

1) Their app is pretty small

2) Their machine is really fast