News for hackers. Stuff that matters.
Re:MDN (beta) is now built with React by jammygit on Tuesday July 16, 2019 @12:27PM (#20451505)
I can’t imagine a more suitable use case for a static site than for documentation. Why on earth?
Re:MDN (beta) is now built with React by anchpop on Tuesday July 16, 2019 @12:54PM (#20451736)
I find react to be a very pleasant way to make websites, even static ones. And for static sites you can use SSR or something like GatsbyJS to make everything load as if you had actually written the html (i.e. no dependence on javascript). That's the approach I use for my blog and according to google pagespeed the only problem with it is that the TTFB is too high (which is surprising because I host it as a totally static site on AWS)
Re:MDN (beta) is now built with React by pier25 on Tuesday July 16, 2019 @03:16PM (#20453015)
How is it surprising that rendering a React website is slower than simple HTML?
Re:MDN (beta) is now built with React by anchpop on Tuesday July 16, 2019 @04:22PM (#20453519)
The server doesn't do any rendering before serving the page. All the "SSR" is done exactly once at build time. To the server it's no different from serving any other site.
Re:MDN (beta) is now built with React by pier25 on Tuesday July 16, 2019 @05:17PM (#20453997)
I'm not too familiar with Gatsby but something has to be slowing you down if TTFB is too high.
Re:MDN (beta) is now built with React by anchpop on Tuesday July 16, 2019 @05:30PM (#20454084)
It's not that high, Google says I might be able to save .8 seconds. I might try hosting on netlify and see if that improves things
Re:MDN (beta) is now built with React by robertoandred on Tuesday July 16, 2019 @03:32PM (#20453121)
An SSR React site IS simple HTML.
Re:MDN (beta) is now built with React by pier25 on Tuesday July 16, 2019 @03:43PM (#20453220)
Doesn't matter, React has to rehydrate which blocks the CPU.

SSR solves waiting for the API but not the CPU problem.

Re:MDN (beta) is now built with React by robertoandred on Tuesday July 16, 2019 @04:59PM (#20453850)
That doesn't affect TTFB.
Re:MDN (beta) is now built with React by pier25 on Tuesday July 16, 2019 @05:15PM (#20453976)
Ah you are right, my bad. I was thinking of TTFI.
Re:MDN (beta) is now built with React by tscangussu on Tuesday July 16, 2019 @01:01PM (#20451810)
Because static sites are not cool anymore unless you use Gatsby and its GraphQL interface to read your markdown files, because directly read markdown from your disk is not cool either.
Re:MDN (beta) is now built with React by robertoandred on Tuesday July 16, 2019 @01:14PM (#20451946)
Why keep reading markdown from disk and regenerating the page when you can just compile the site once and be done with it? Much easier to cache.
Re:MDN (beta) is now built with React by pier25 on Tuesday July 16, 2019 @03:15PM (#20453009)
I think you missed the sarcasm from parent poster.
Re:MDN (beta) is now built with React by smt88 on Tuesday July 16, 2019 @12:48PM (#20451682)
Docs can be really dynamic, like the ones that have runnable sample code in various languages. It's just that these docs... aren't.
Re:MDN (beta) is now built with React by beatgammit on Tuesday July 16, 2019 @10:44PM (#20455961)
Even for those, it's completely reasonable to have most of the page be static and only have the runnable parts be dynamic. You could use React for the dynamic bits and regular HTML for the rest.

Unfortunately, React typically takes over the whole page, so it's a little less straight forward.