header background image

I migrated my homepage from GatsbyJS to Next.js

2022年11月5日☕️ 4 min read

Thoughts

Three and a half years ago, the Next.js maintainers were not very friendly and helpful to community. Documentation was not extensive too. If you had a problem, you had to find out the answer from the source code. On top of that, Next.js does SSR (server-side rendering) by default, but many libraries did not support that which caused serious FOUC (Flash of unstyled content) problems. The famous material-ui didn't work well with Next.js in those days. So I created a library to solve this problem. https://github.com/thundermiracle/next-mui-helper

That's when I met GatsbyJS with Jamstack, GraphQL, a nicely documentation site, tons of starter projects, a plugin eco system that is very easy to implement, Gatsby image even handling responsive images automatically. It was very attractive. By the way, React.js Documentation and creator of Redux Dan's blog are also made with GatsbyJS.

However, time has changed. While it is said that Next.js is often 'stealing' excellent ideas, but yes, it is much more popular and easier to use nowadays. Unfortunately, I can't really recommend studying GatsbyJS to those who want to enter the React eco system now.

I've migrated my homepage from GatsbyJS to Next.js. GatsbyJS was the top of the SSG frameworks in my opinion, even with Next.js, but time flies, everything changed a lot. I'd like to share my thoughts about GatsbyJS and Next.js in past and now.

Comparison three and a half years ago

GatsbyJSNext.jsDescription(GatsbyJS)Description(Next.js)
ease of creating blogs and documentation websites×Framework created for Static sites in the first place.by getInitialProps only
i18n(multilingual support)×Community plugins make it easyNo support for path-based multilingualism, and can be created in a nutshell using react-intl
Automatic image processing×Supported by gatsby-imageno way
Speed of siteFast because of static htmlHas next export, but basically requires SSR
Ease of deploymentEasy to deployBecause of SSR, now(became to Vercel) is required
Difficulty of learningdifficult for those not familiar with GraphQLEasy to learn first but hell to deal with SSRs
Kindness to the community×Friendly, answers questions wellIssues that are unanswered and just CLOSED are noticeable
Documentation×Clean and tidyOnly README.md with a learn next website

Comparison now

GatsbyJSNext.jsDescription(GatsbyJS)Description(Next.js)
ease of creating blogs and documentation websitesThe STATIC part remains the same as before, but the more pages you have, the longer the build timenew IF getStaticPaths, getStaticProps with wonderful on-demand ISR
i18n(multilingual support)Community plugins make it easyOfficial support
Automatic image processingthe same as before, but the more images you have, the longer the build timenext/image is excellent
Speed of siteFast because of static htmlSSR, but it has improved a lot
Ease of deploymentEasy to deployEdge Function and Serverless Function are becoming more popular make Next.js easier to deploy
Difficulty of learningdifficult for those not familiar with GraphQLA lot of sample of SSRs, not difficult anymore
Kindness to the communityThe decision to exclude Community Starter from the documentation site was a real bad decisionIt changed to be so kind because it became a Vercel project
DocumentationClean and tidyClean and tidy with large numbers of examples, really easy to catch-up
Support of pnpmCommunity-based plugin that doesn't work wellOfficial support

Finally

Apart from that, Next.js has 'pirated' Layouts RFC from Remix, added Turborepo for monorepo, and announced the amazing bundling tool Turbopack, which is a competitor to Webpack. Three years ago, Next.js, GatsbyJS and create-react-app against each other, but in future, it may be inevitable that Next.js will be the dominant player.

Thanks, GatsbyJS. ByeBye!

ThunderMiracle

Blog part of ThunderMiracle.com

Comments load when in view