Re:Show HN: Trends – A GitHub trending PWA
by Mithorium on Tuesday July 24, 2018 @04:33PM
(#17604673)
Never used next, looks interesting. So with this setup, the browser doesn't do any work, all pages are loaded as if they were static, and rendered server side?
[ Parent
| on HN ]
Re:Show HN: Trends – A GitHub trending PWA
by jack_hanford on Tuesday July 24, 2018 @04:46PM
(#17604767)
Correct!
The way that is achieved is pretty neat, Next.js has a <Document />[1] component that you can extend. This Document is essentially your application shell that is used when server side rendering.
Here is the trends Document component[2] where you can see I'm simply omitting `NextScripts` which ends up being the frontend bundle with react + application code
[1] https://github.com/zeit/next.js#custom-document
[2] https://github.com/hanford/trends/blob/master/pages/_documen...
I'd seen references to next before this but never really dug in deep enough to get a sense of whether it was worthwhile. Thanks for giving it enough context to show how cool and accessible next is.