News for hackers. Stuff that matters.
Re:Hacker News Clone Using GraphQL and React by zappo2938 on Sunday October 01, 2017 @08:18PM (#15380715)
Clone: 22 requests | 1.1 MB transferred | Finish:2.86 s | DOMContentLoaded 636 ms | Load:2.87 ms

Real Hacker News: 6 requests | 11.5 KB transferred | Finish: 336 ms | DOMContentLoaded: 325 ms | Load: 343 ms

Hacker News is just a static cached webpage

Re:Hacker News Clone Using GraphQL and React by chrisco255 on Sunday October 01, 2017 @09:37PM (#15381122)
They've implemented this as a SPA so all the pages are downloading at once not just the home page. Probably could be optimized with some lazy loading. Still, vanilla HN obviously has no framework so no need to download React/Apollo, etc. I'm gonna go out on a limb and assume that they're using this as a learning tool and a teaching tool. Just like no one needs a framework to implement a TO DO list, but that's the go to example app.
Re:Hacker News Clone Using GraphQL and React by kuschku on Sunday October 01, 2017 @09:03PM (#15380954)
That’s on first load – all future loads are significantly faster on this clone.
Re:Hacker News Clone Using GraphQL and React by codedokode on Tuesday October 03, 2017 @06:10AM (#15391331)
1.1Mb is 100 times larger than 11Kb.
Re:Hacker News Clone Using GraphQL and React by kuschku on Tuesday October 03, 2017 @04:23PM (#15395845)
That would be the case when the bandwidth was the limit, but it’s not.

The limit is in the immense latency for opening a new connection.

Opening a network socket with TLS can take over 4 seconds on mobile, which is why ideally you’d even use an open websocket for communication instead of new GET requests. Navigating to a page in this version causes one or two network requests, in the real HN it takes far more just to check if the images have changed, the CSS has changed, etc.

Re:Hacker News Clone Using GraphQL and React by codedokode on Tuesday October 03, 2017 @06:20PM (#15396691)
Using websocket looks like overengineering because HTTP/2.0 allows to use a single connection for multiple parallel requests.

Using React to build a simple (student level) site like HN is overengineering too in my opinion. If you don't want to reload the page when navigating you can just reload HTML content with jQuery or fetch() without using client side rendering, without draining device battery and without loading 1 Mb of Javascript that will take much more space in RAM.

SPA approach should be used for interactive applications able to work in offline mode, able to provide rich experience on mobile devices etc.

Re:Hacker News Clone Using GraphQL and React by orange8 on Monday October 02, 2017 @12:41AM (#15381744)
What is the technical difference between Finish, DOMContentLoaded and Load?