Live data from Hacker News

Hacker News Clone Using GraphQL and React

github.com

141–150 of 187 posts

Re: Hacker News Clone Using GraphQL and React

#141

Earlier quoted context omitted.

This is exactly what I feel. I get heavy request to build projects in React where their use case is pretty simple even wordpress can suffice.

Unless you're using a pre-made template I don't see how a WordPress installation is any simpler than an SSR React site.

Works out of the box, install or get a WP site and you're done. SSR React site implies doing development and hosting yourself.

Re: Hacker News Clone Using GraphQL and React

#142

I 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…

For me, the technology used in projects like these is far more interesting than the end result itself (I'll probably never actually run it, but I took a good look at the source code).

Re: Hacker News Clone Using GraphQL and React

#143

I really like the Apollo stack, but if you're thinking of using it in production right now, you should wait a little! There's a massive bug where if your graphql outputs 1 small error, the whole component does not get loaded. Imagine a components that lists a bunch of items. If 19 returned correctly but 1 has an error, the "data" prop doesn't get passed, all you receive back is the error prop. It's pretty shitty for…

Do you know which one is bad? Then requery and exclude the bad one?

Meanwhile the top comment is saying exactly what I was trying to say and got upvoted... I obviously didn't articulate myself well.

Re: Hacker News Clone Using GraphQL and React

#144

The way in which Apollo + GraphQL + React work together is just awesome sauce. I love that you can simply declare your data dependencies with a GraphQL query string and Apollo just fetches, wires up and injects the data into your component. I had the pleasure of using this stack for a project once. The speed at which you can move once you have the stack in place and a full grasp of it is pretty mind blowing.

Do you know a good learning resource that got you there? Esp. Apollo and GraphQl. I feel a little overwhelmed, similar to how i felt when i encountered flux/redux the first time. I figured it was easier than i thought after a while, but the first step was hard.

Re: Hacker News Clone Using GraphQL and React

#145
I understand that HN is a popular web property, but these projects humor me because Hacker News is probably the worst example of something to be improved / accelerated by these Javascript technologies.

Best examples are pages with complex & persistent state (like a chat window open on Facebook as you navigate around).

Re: Hacker News Clone Using GraphQL and React

#146
One of the things that interests me about client-side approaches like this is performance as perceived by the user.

Even though I suspect the times taken between real hacker news and the clone to load comments are similar, real HN feels a lot faster because the page only loads once the content is ready, rather than loading the page skeleton and then blinking the actual content when loaded.

Re: Hacker News Clone Using GraphQL and React

#147

I really dislike the tendency to couple graphql queries with components. Is this idiomatic? If you are comfortable with side effects in your presentation layer i’d much rather manage data at a higher level and have a component request the data it needs from that. As opposed to actually making HTTP requests. What happens when two components used in two totally different areas of a single page need common data? Relying…

Apollo manages your data store automatically. It uses Redux internally. Because Apollo wraps the queries and mutations, it smartly caches data and only fetches the minimal amount necessary to build the page. Apollo reduces the amount of Redux CRUD boiler plate dramatically (by as much as 2/3 or more). There are no traps there, everything is configurable. The documentation is really clean. Highly recommend Apollo. Onc…

> everything is configurable

Arguably that's it's own trap. Convention over configuration has saved millions of man hours in e.g. Rails projects, but a lot of JS land involves sinking a lot of time into the opposite.

Re: Hacker News Clone Using GraphQL and React

#149
post #111

The 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…

I also spend a lot of time on terrible internet connections, it really makes you realise how poorly optimised some websites are.

HN is one of the few websites that consistently loads properly for me.

Re: Hacker News Clone Using GraphQL and React

#150

I think it is not so hard to achieve something similar to HN. I think the added value of HN is: - Algorithm used to rank news - Community and culture

The algorithm is pretty simple - points from votes or flags, but weighted by time, so that new stuff floats to the top for a while. You can use a remarkably simple version of it and it's still very effective.

I agree the community (with all its flaws) is far more important than any tech used.

Post reply on HN