Live data from Hacker News

Hacker News Clone Using GraphQL and React

github.com

11–20 of 187 posts

Re: Hacker News Clone Using GraphQL and React

#11
post #2

Impressive first load w/ Is this served from a CDN? Great job putting together a robust example application.

Nothing is being served on a CDN, nor even being cached. It's just a demo running on Google Cloud with Kubernetes/Docker.

Doesn't it cache the HN API results in memory however?

You literally have a function called seedCache() :-)

Re: Hacker News Clone Using GraphQL and React

#13

Awesome job. This is not a knock on JavaScript in particular, but the amount of brain bandwidth and dependencies to launch a modern web app is getting a bit absurd. I'm turning into that old grumpy hacker who prefers the simple good ole' days of LAMP. :-) React - (UI Framework) GraphQL - (Web Data API) Apollo - (GraphQL Client) Next - (Routing, SSR, Hot Module Reloading, Code Splitting, Build tool uses Webpack) Redux…

I see these kind of posts often. What's a reasonable benchmark? What useful projects have only a handful of dependencies? You could say the same about a project in any language -- it's just more noticeable in the JavaScript ecosystem because best practices are still developing.

Re: Hacker News Clone Using GraphQL and React

#14

Awesome job. This is not a knock on JavaScript in particular, but the amount of brain bandwidth and dependencies to launch a modern web app is getting a bit absurd. I'm turning into that old grumpy hacker who prefers the simple good ole' days of LAMP. :-) React - (UI Framework) GraphQL - (Web Data API) Apollo - (GraphQL Client) Next - (Routing, SSR, Hot Module Reloading, Code Splitting, Build tool uses Webpack) Redux…

[deleted]

Re: Hacker News Clone Using GraphQL and React

#15
post #4

Damn, those load times. This is on all my tests – fast internet or dialup, 2016 desktop or ancient android phone – significantly faster than the real HN. Wow.

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

#16
post #4

Damn, those load times. This is on all my tests – fast internet or dialup, 2016 desktop or ancient android phone – significantly faster than the real HN. Wow.

It caches HN API in memory (probably why the demo site is out of sync with live HN)

https://github.com/clintonwoo/hackernews-react-graphql/blob/...

Re: Hacker News Clone Using GraphQL and React

#17
post #4

Damn, those load times. This is on all my tests – fast internet or dialup, 2016 desktop or ancient android phone – significantly faster than the real HN. Wow.

This new site is around 1MB, regular HN is around 50KB. They're not even close. It's just that navigating to new pages is faster since it doesn't take a full page refresh.

[deleted]

Re: Hacker News Clone Using GraphQL and React

#18

Awesome job. This is not a knock on JavaScript in particular, but the amount of brain bandwidth and dependencies to launch a modern web app is getting a bit absurd. I'm turning into that old grumpy hacker who prefers the simple good ole' days of LAMP. :-) React - (UI Framework) GraphQL - (Web Data API) Apollo - (GraphQL Client) Next - (Routing, SSR, Hot Module Reloading, Code Splitting, Build tool uses Webpack) Redux…

>launch a modern web app

It took me a long time to realize that "launching the app" is not really what these tools are for. You can create perfectly fine awesome web apps with just HTML/CSS/ES5.

But as it gets more complex, or you add collaborators, or you feel how much easier/faster certain things would be if you could operate at a different level of abstraction... the world does tend to pull you towards these tools. None of them are necessary though, they just trade a little ramp at the beginning for a lot of saved headaches later on. I still don't use have of this stuff, but I recall recently debugging an issue that was a couple of clicks into an SPA (in an interview no less) and I sure wished I had jumped through the hoops to get hot module reloading on that one! Likewise, I'm kind of ready for tests now, to make sure the rendered HTML is what I expect in various scenarios, rather than walk through the app like a paranoid moron after every change.

I think the way to stay sane in modern front-end development is to not overthink the tools - if your project is already using them, great, use them the right amount for your team. If you don't use, say, Redux, but your state management is causing lots of pain, hey, maybe it's time for Redux now. If you already write only beautiful ES5 that runs correctly an is easy to reason about, who needs Babel.

My favorite situation is when somebody else picked the tools and the build process and I don't have to give a crap about evaluating all the options. Knowing and caring about all of the pros and cons IS a lot of bandwidth!

Re: Hacker News Clone Using GraphQL and React

#19
post #4

Damn, those load times. This is on all my tests – fast internet or dialup, 2016 desktop or ancient android phone – significantly faster than the real HN. Wow.

This new site is around 1MB, regular HN is around 50KB. They're not even close. It's just that navigating to new pages is faster since it doesn't take a full page refresh.

Which makes for a better user experience. What’s your point?

Re: Hacker News Clone Using GraphQL and React

#20

Earlier quoted context omitted.

Nothing is being served on a CDN, nor even being cached. It's just a demo running on Google Cloud with Kubernetes/Docker.

Doesn't it cache the HN API results in memory however? You literally have a function called seedCache() :-)

Yes that's true but the page doesn't get cached so in that regard there's still lots of room for real world performance improvements :)
Post reply on HN