Live data from Hacker News

Hacker News Clone Using GraphQL and React

github.com

61–70 of 187 posts

Re: Hacker News Clone Using GraphQL and React

#61

Hey, so, uh... all you need to clone HN is Postgres and some HTML/CSS and a smidgen of JavaScript. Good God, must we pull in the entire JavaScript ecosystem for a simple forum now?

This is why the JS community is so fucked. They take what should be a simple website and needlessly complicate it by (poorly) reimplementing what web browsers can already do.

You’ve completely missed the point.

Re: Hacker News Clone Using GraphQL and React

#62

Hey, so, uh... all you need to clone HN is Postgres and some HTML/CSS and a smidgen of JavaScript. Good God, must we pull in the entire JavaScript ecosystem for a simple forum now?

It's called a 'reference architecture'. It's intended to be used as a teaching tool and learning tool for a stack that has tremendous benefits for applications more complex than HN. Since everyone is familiar with HN on HN, they can look at that code and understand how it fits in with the big picture without having to learn a new app PLUS a new architecture. [1] https://en.wikipedia.org/wiki/Reference_architecture

Good god look at all these over-engineered todo lists! All you need is a piece of paper and a pencil. Maybe a pen if you’re on the immutability bandwagon.

Re: Hacker News Clone Using GraphQL and React

#63
post #56

The latency of clicking on the "comments" link is greater than actual HN (about 0.9s) for an example I tried, of which about half is spent in the POST network request, another half in JavaScript and layout/rendering/painting. For actual HN the whole process is well below 0.5s. Seems like with more comments it is much slower.

the hn api could be to blame for the slow i/o:

https://github.com/HackerNews/API#design

Re: Hacker News Clone Using GraphQL and React

#64
post #29

Earlier quoted context omitted.

The slightly higher upfront cost is only incurred once.

Well, it's incurred each time you navigate away and then back to HN, which happens any time you click on a link on the front page, right?

Browser cache

Re: Hacker News Clone Using GraphQL and React

#65
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 on a cache feels like a hack.

I really love React but really dislike the way I see it being used these days. I think of it as a polyfill for a UI component that should be stateless and free of side effects. Not an end to end controller/fetcher/renderer.

Re: Hacker News Clone Using GraphQL and React

#67

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…

So basically you prefer something more along the lines of Model View Controller. Me too. When React was first released it was advertised as “the ‘V’ in MVC”. Unfortunately the developer community took it in a different direction.

Re: Hacker News Clone Using GraphQL and React

#68
The real link: http://www.hnclone.win/

Fantastic resource! The key point of this is it provides working example code to start a project from. Everything is MIT Licensed so that means you get to download it and just start hacking.

I would love to see some accompanying video tutorials!

Of course people are also free to post their own examples using their own favorite technologies. I would love for 'HN Clone' to become a benchmarking standard for comparing stacks. It seems like a bit too much work for such a purpose, but that's the point! :-)

I don't think authentication is actually working in the demo, by the way. Don't be tempted to actually log in to your own account! But I tried creating a new account and it failed.

Re: Hacker News Clone Using GraphQL and React

#70
post #68

The real link: http://www.hnclone.win/ Fantastic resource! The key point of this is it provides working example code to start a project from. Everything is MIT Licensed so that means you get to download it and just start hacking. I would love to see some accompanying video tutorials! Of course people are also free to post their own examples using their own favorite technologies. I would love for 'HN Clone' to become…

> Everything is MIT Licensed

Besides GraphQL you mean

Post reply on HN