News for hackers. Stuff that matters.
Re:Reddit Is Raising Funds at a Valuation of $1.7B by Roritharr on Saturday June 17, 2017 @04:33AM (#14574913)
I'm in a weird position there. I've recently decided on react for most of our frontend in the future because of all the technical advantages this offers and the productivity benefits I see, but I still harbor reservations against react because in practice I've rarely seen react pages that feel snappy and fast, rather than choppy and slow.
Re:Reddit Is Raising Funds at a Valuation of $1.7B by SkyMarshal on Saturday June 17, 2017 @05:08AM (#14574984)
Interesting observation, b/c one of the original value propositions of React's virtual dom model was faster rendering than most other frontend frameworks at the time. I wonder if it's gotten so complicated it lost that?

If so, there are a number of other intentionally lightweight virtual dom frontend frameworks. Mithril, Riot, Preact, virtual-dom all come to mind, and there are a probably a few more.

Re:Reddit Is Raising Funds at a Valuation of $1.7B by coldtea on Saturday June 17, 2017 @06:38AM (#14575210)
>Interesting observation, b/c one of the original value propositions of React's virtual dom model was faster rendering than most other frontend frameworks at the time. I wonder if it's gotten so complicated it lost that?

That has been shown to not hold in actual benchmarks. The real DOM is plenty fast if you do it right.

Here's Facebook's Dan Abramov (of Redux fame): "Myth: React is “faster than DOM”. Reality: it helps create maintainable applications, and is fast enough for most use cases."

https://twitter.com/dan_abramov/status/842329893044146176?la...

https://objectpartners.com/2015/11/19/comparing-react-js-per...

Re:Reddit Is Raising Funds at a Valuation of $1.7B by bauerd on Saturday June 17, 2017 @05:47AM (#14575072)
React's virtual dom/diffing is certainly not "slow". It's not the tool that's the problem, but how it's used. There's also more to perceived slowness than how fast your library reconciles the DOM, e.g. I too often encounter pages that will "preload" all their assets behind stupid loading screens, ill-timed CSS animations, modals on top of modals, React Components that badly wrap jQuery plugins, leaked callbacks, …

tl;dr Don't blame tools but their usage

Re:Reddit Is Raising Funds at a Valuation of $1.7B by quadrupleslap on Saturday June 17, 2017 @05:11PM (#14577769)
React can certainly be fast enough but isn't it completely unnecessary for a mostly-static site like Reddit?
Re:Reddit Is Raising Funds at a Valuation of $1.7B by komali2 on Monday June 19, 2017 @01:29PM (#14588677)
Yea, I would say so... I guess from a developer standpoint it makes it easy to just have a "Post" component with various elements. I did this for a Reddit clone using Angular and ng-repeat and whatnot. I don't think it's performance beneficial though.
Re:Reddit Is Raising Funds at a Valuation of $1.7B by NewEntryHN on Saturday June 17, 2017 @07:50AM (#14575458)
Most of the performance loss is due to using a frontend framework at all. Differences in such frameworks is then little. You need two round-trips at each page-load because you need the base HTML page then the data and rendering in the browser is orders of magnitude slower than rendering server-side with a good rendering engine.

I understand the point of frontend frameworks for SPA, not so much for Reddit profile pages which are literally single, static, pages.

Re:Reddit Is Raising Funds at a Valuation of $1.7B by p49k on Saturday June 17, 2017 @08:11AM (#14575549)
You can render React server-side on first page load, though, and there will be no lag waiting for the page to render and initialize. I think that most people don't do it because there is extra work involved, but IMO if you're a huge site like Reddit, there's no excuse for not doing so, it seems like laziness.
Re:Reddit Is Raising Funds at a Valuation of $1.7B by sotojuan on Saturday June 17, 2017 @07:09AM (#14575315)
It's not React specifically. It's just JS. Reddit already has the worst performing mobile site because it's full of JS.