logo
episode-header-image
About this episode

In this episode, Wes and Scott debate Gatsby vs Next — how they compare, the pros and cons of each, why you might chose one over the other for your next project, and more!

LogRocket - Sponsor

LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session replayer and a performance monitor. Get 14 days free at https://logrocket.com/syntax.

The Armoury - Sponsor

The Armoury is a men’s clothing and accessories retailer that provides some of the highest quality clothing you can buy. Designed for those of you who want the highest quality clothing that feels great and will last forever. Buy less, buy better. Follow them on Instagram @thearmourynyc and check out their website TheArmoury.com.

Show Notes

5:07 - Server Side Rendering

  • Next.js will render on demand — this allows you to have server rendered pages on demand.
    • Think of a blog website — publish a new blog post and it will immediately start working.
    • Authenticated pages can be server rendered, and thus, pre-loaded for better performance.
  • Gatsby runs at build time only — so you need to have all of your data ready at build time.
    • Pro: This makes for very fast page load.
    • Con: Large websites can take a long time to build.
    • Con: Gatsby can do network fetches from the client, but these lose the benefit of SSR.
  • Ease of SSR:
    • Next.js requires a complicated document.js file if you are fetching data anywhere other than a page component.
      • This will probably get easier with Suspense. Demos are simple, but any real application requires harder config.
    • Gatsby is Easy Peeezy!

11:09 - Data

  • Next.js is unopinionated. Like React, it doesn’t care where your data comes from.
    • getInitalProps();
  • Gatsby has a number of “source” plugins which will pull in data from sources — markdown, WordPress, API, file system. Once you have that data sourced, you can query it with GraphQL.

22:50 - Routing and Creating Pages

  • Next.js makes you create a page in a pages directory. You can nest these as deep as you like. If you want to pass query params, you must do so with a ?query=string. There are several third-party options for getting around this that require a node server.
  • Gatsby allows you to programmatically create pages with their createPage API.
  • For both navigating between pages, they make a Link Component available.

30:49 - Plugins

  • In Gatsby, everything goes through the Gatsby pipeline. This makes things like image compression, pagination, sass, service workers and many other progressive web app pieces very easy.
  • Gatsby makes building a really good website easy.
  • Gatsby Image is SOOOOO amazing.
  • The scope of Next.js is much smaller. They give you a few things, but you generally bring your own approach for most things
    • Routing
    • Linking and prefetching
    • Dynamic Importing

38:42 - Deploying and Hosting

  • Gatsby is just HTML, CSS, and JS at the end of the day, so it can be deployed almost anywhere — Netlify, Github Pages, cheap PHP hosting, etc.
  • Next.js is a Node app. It can be integrated into an existing Express app, or run by itself. Requires a Node server to run it.
  • Next.js has a static generation option, but you’re better off using Gatsby for that.

44:41 - The verdict?

  • Us Next.js for Apps, Gatsby for Websites

Links

××× SIIIIICK ××× PIIIICKS ×××

Shameless Plugs

Tweet us your tasty treats!

Up next
Jul 9
918: Extreme Native Perf on the Web with Superhuman
Wes and Scott talk with Loïc Houssier about how Superhuman builds lightning-fast, delightfully-designed email software. They dig into engineering philosophy, offline-first architecture, local databases, AI-powered productivity, and what it takes to create tools that people love. ... Show More
48m 54s
Jul 7
917: AI Tools You Should Know
Scott and Wes round up the hottest AI tools you should have on your radar; from text-to-speech wizards to self-hosted image generators. They break down what they’re using, what’s worth paying for, and which tools are changing their workflows. Show Notes 00:00 Welcome to Syntax! 0 ... Show More
37m 48s
Jul 2
916: I got fired, what should I focus on?
In this potluck episode of Syntax, Wes and Scott answer your questions about maintaining popular open-source projects, where to start after a layoff, impostor syndrome, Scott’s recording setup, whether a computer science degree is still worth it in the age of AI, and more! Show N ... Show More
58m 24s
Recommended Episodes
Jul 2020
"GraphQL is the bacon that'll make everything better" (JS Party #134)
KBall, Jerod, and Nick Nisi dive into GraphQL – what it can do, what the challenges are, and how it differs from REST – all with a generous helping of metaphor about buffets, restaurants, and of course bacon. Discuss on Changelog News Changelog++ members support our work, get clo ... Show More
54m 13s
Jul 2020
"GraphQL is the bacon that'll make everything better"
KBall, Jerod, and Nick Nisi dive into GraphQL – what it can do, what the challenges are, and how it differs from REST – all with a generous helping of metaphor about buffets, restaurants, and of course bacon. Discuss on Changelog News Changelog++ members support our work, get clo ... Show More
54m 13s
Aug 2020
Amal joins the party 🎉
The gang officially welcomes Amal Hussein as a panelist! After that it’s Pro Tip Time, then we finish up by attempting to demistify CSS Sweeper and the Space Toggle Trick. Discuss on Changelog News Changelog++ members save 2 minutes on this episode because they made the ads disap ... Show More
47m 40s
Mar 2022
Enabling performance-centric engineering orgs (JS Party #216)
This week Amal and Nick are joined by Dan Shappir, a Performance Tech Lead at Next Insurance, to learn about enabling a performance-first mindset within your engineering org. Dan recently left his 7+ year tenure leading performance at Wix where he and his team improved, and monit ... Show More
1h 13m
Dec 2021
Frontend Feud: React Advanced Edition (JS Party #206)
Jerod, Nick, and a node_modules-worthy collection of JS friends played an intense game of Frontend Feud at React Advanced London’s after-party back in October. Today, you get to play along with us! Leave us a comment Changelog++ members save 3 minutes on this episode because they ... Show More
1h 5m
Mar 2022
Web development for beginners (JS Party #218)
Jen Looper from Web Dev for Beginners and Front-end Foxes joins Jerod and Ali to discuss the exciting (but also intimidating) prospect of getting in to web development in 2022! Where should you start? What technologies should you focus on? Is it better to go all-in on a framework ... Show More
53m 23s
Jun 2022
Ahoy hoy, JSNation & React Summit!
Nick went to Amsterdam for JSNation & React Summit 2022 and he joins Jerod to report on all the goodness! He also sits down with two special guests involved with the confs to talk Jest Preview and GraphQL Cache Discuss on Changelog News Changelog++ members save 4 minutes on this ... Show More
1h 11m
Nov 2023
What's new in CSS land
Una Kravets, developer advocate at Google & web platform ambassador, joins Amal & Nick to take them CSS to school as they start this podcast in CSS kindergarten and end it with a Level-Up CSS Diploma. (LUCD?) We explore all the amazing features which have recently landed in CSS — ... Show More
1h 14m
Aug 2022
Qwik is a new kind of web framework
AngularJS creator Miško Hevery has a new web framework he wants to tell us about, but he’s not pitching just another framework, but with different DX. He says that Qwik is a fundamental rethinking of how a web application should work. And he’s here to convince Jerod & KBall that ... Show More
1h 2m
Mar 2024
AI vs software devs
Daniel and Chris are out this week, so we’re bringing you conversations all about AI’s complicated relationship to software developers from other Changelog pods: JS Party, Go Time & The Changelog.Join the discussionChangelog++ members save 2 minutes on this episode because they m ... Show More
57 m