GraphQL is a very nice spec for building APIs that have many sources of data and then building a modern frontend with proper caching etc. on top of it. The ugliest part of it, or one requiring most hacky solutions, is optimising queries. For example, there are some nasty N+1 traps or "oops-I-joined-your-entire-database" problems when using SQL. JoinMonster helps with this, but it is a bit too much of a "full solution…
Hacker News Clone Using GraphQL and React
131–140 of 187 posts
Re: Hacker News Clone Using GraphQL and React
#132I feel a little mixed about projects like this. It's fantastic to see people share their knowledge, and turn theory into practice. It's very easy to spout on about best practices and good ideas without demonstrating how they can be implemented in the real world. And this application does demonstrate some good ideas. ...But some bad ideas also. I think one problem we have in the frontend world is that developers of ve…
That's just how we learn to apply things correctly. If the first time you use a tool is to build a scale-appropriate project, you will stumble and likely fail. Imagine you want to sail across the Atlantic and, to acclimate to the necessary tasks, you started small: sailing down the Thames, then sailing to Calais, then sailing farther and into the deeper ocean, before you decide to take the big trip. Now imagine you p…
That's fine when we're writing personal projects, but don't professional gigs require a greater standard of care?
Imagine you need to need to transport water to your home. You start by consulting best practices and blogs and conclude that the only way to take water somewhere is using a helitanker. This is a dual rotor helicopter with an enormous hold. You consult a building planner to construct a helipad on your roof. You seek an expert helicopter pilot. You spend several weeks poring over different models of helicopter.
You can do a lot of iteration and eventually reach the right result, but that still won't stop your house burning down in this analogy.
Re: Hacker News Clone Using GraphQL and React
#133The original HN is one of the fastest loading sites I regularly visit. You fixed that pretty good. Disclaimer: I'm on terrible internet connections most of the time and it really makes you hate all this modern web crud. Often "dynamic" sites don't load at all because while the initial HTTP request eventually gets through, one or more of the following XMLHttpRequests or whatever fail, and a lot of the time there is no…
Just tested that :) Clean load 22 requests, 1.1 MB 38sec vs 6 requests 48.8 KB 4sec
This is a pretty good example of older websites vs 'web 2.0' I guess.
Re: Hacker News Clone Using GraphQL and React
#134Earlier quoted context omitted.
That's just how we learn to apply things correctly. If the first time you use a tool is to build a scale-appropriate project, you will stumble and likely fail. Imagine you want to sail across the Atlantic and, to acclimate to the necessary tasks, you started small: sailing down the Thames, then sailing to Calais, then sailing farther and into the deeper ocean, before you decide to take the big trip. Now imagine you p…
> That's just how we learn to apply things correctly. That's fine when we're writing personal projects, but don't professional gigs require a greater standard of care? Imagine you need to need to transport water to your home. You start by consulting best practices and blogs and conclude that the only way to take water somewhere is using a helitanker. This is a dual rotor helicopter with an enormous hold. You consult…
I was referring to projects like the one linked, which are quite clearly either technology demonstrations or practice stuff.
Re: Hacker News Clone Using GraphQL and React
#135Damn, 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.
All these actions are a lot faster on that site than on real HN with Firefox Nightly on PC and mobile.
Re: Hacker News Clone Using GraphQL and React
#136Re: Hacker News Clone Using GraphQL and React
#137Damn, 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.
I'm trying this in Firefox nightly (stylo enabled, webrender not).
Even on an old phone over throttled internet, that page is faster than real HN for page transitions, but the same happens on 100Mbps WiFi with my Nexus 5X, or on LAN with my desktop.
In all cases, that site is significantly faster than real HN in loading and rendering (I can see the real HN's icon slowly load on every page refresh — that page doesn't do that).
If you get different results, you're probably using Chrome, which is over-aggressively caching.
Re: Hacker News Clone Using GraphQL and React
#138Re: Hacker News Clone Using GraphQL and React
#139Earlier quoted context omitted.
Just tested that :) Clean load 22 requests, 1.1 MB 38sec vs 6 requests 48.8 KB 4sec
To be fair, it does seem to be pre-loading the pages the links at the top of the page lead to... Except then it also makes a request which ends up being ~7-8kb in size when you switch to a tab for the first time. This is a pretty good example of older websites vs 'web 2.0' I guess.
Re: Hacker News Clone Using GraphQL and React
#140I feel a little mixed about projects like this. It's fantastic to see people share their knowledge, and turn theory into practice. It's very easy to spout on about best practices and good ideas without demonstrating how they can be implemented in the real world. And this application does demonstrate some good ideas. ...But some bad ideas also. I think one problem we have in the frontend world is that developers of ve…
Be that as it may, praise the author for creating a fully-functioning case study from which audiences could learn and discuss.