Live data from Hacker News

React, Relay and GraphQL: Under the Hood of the Times Website Redesign

open.nytimes.com

111–113 of 113 posts

Re: React, Relay and GraphQL: Under the Hood of the Times Website Redesign

#111
post #109

Earlier quoted context omitted.

The string building approach is the fastest, and it's the benchmark to beat. Any other abstraction is just piling more work on top and is generally just a more inefficient way to output HTML. The most lightweight pseudo-DOM implementations are still going to be significantly slower than string concatenation, and I have benchmarks to back up that claim [0]. Realistically, a server-side rendered JS app is also going to…

I'd imagine at the Times' scale they're not server-side rendering every page view though. I'm sure they'd be caching the HTML result at the CDN level.

Yes, they likely have reverse proxies that cache static content. But this won't work well for any sort of dynamic content, i.e. apps that require login, when data changes in real-time, etc.

Re: React, Relay and GraphQL: Under the Hood of the Times Website Redesign

#112
post #108

This is very similar to the stack we use at BDG Media (bustle.com, romper.com, etc) We use Amazon Lambda, GraphQL, a custom model layer with data loader and redis, and preact. We haven't seen a clear benefit from Relay or Apollo with out front end apps (tbd on our admin apps) but we have enjoyed the Relay spec to help set server side conventions. GraphQL has helped us make an api that is easy to understand, easy to c…

I thought Bustle was big on Ember and Ember FastBoot, has that changed?

We still use Ember and fastboot on a few applications but it's being replaced for the user side of bustle. I believe we did it because we were able to get faster and smaller server side renders and a smaller js payload. I spend more on the infrastructure side so I can't speak to the exact reasonings.

Re: React, Relay and GraphQL: Under the Hood of the Times Website Redesign

#113
post #101

Earlier quoted context omitted.

> It's possible to build a server rendered React app What's the advantage of server rendered React app over server rendered anything e.g. php jsp etc?

You can make use of the JavaScript ecosystem. React is a nice was to structure code. There are a tonne of modules available on npm, etc. If and when you do want to build client elements you can reuse parts of your code. That said, I'm not aware of anyone doing this at scale. I know the BBC were considering it. My company will be using it to product AMP pages from our JS stack.

Being done at scale here: https://www.nfl.com/super-bowl Plans to release solution across ecosystem by August Based on open-source universal app here: https://github.com/nfl/react-wildcat

Documentation and infrastructure setup for this project aren't great at the moment, but will get a facelift shortly.

Post reply on HN