Skip to content

Instantly share code, notes, and snippets.

@kpuputti
Last active October 19, 2018 08:22
Show Gist options
  • Save kpuputti/56fa8f17cac3d04866870297f166bddb to your computer and use it in GitHub Desktop.
Save kpuputti/56fa8f17cac3d04866870297f166bddb to your computer and use it in GitHub Desktop.
Sharetribe Guild Hall presentation about GatsbyJS

Gatsby

“blazing fast modern site generator for React”

Background: The CMS problem

  • We really need CMSs
  • We hate developing sites with CMSs

Background: The Content mesh

  • Various services that solve a specific problem well
  • Headless CMS solutions

    => Content is spread out

With a single CMS monolith you’re constantly making compromises.

Background: The website project process

  • Adding new plugins
  • Adding more tracking
  • Integrating scripts and widgets

    => Performance regressions creep in

Background: Performance

“Performant is the new responsive.” [1]

“53% of visits are abandoned if a mobile site takes longer than 3 seconds to load.” [2]

“every 100ms of latency costs 1% of sales” [3]

Background: Performance reality check

This is not a complex CMS site!

Background: Performance first

  • Precompute all the things
  • Use all the cool new Webpack things
  • Output a static site
    • Trivialize caching, CDN usage, and hosting

Background: JAMstack

“Modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup.”

  • Pull in data -> build all the pages -> output a static site
  • When data changes, build process is triggered

Enter Gatsby

  • A comprehensive Webpack setup
  • Tons of data source integrations
    • Headless CMS services
    • Static files
    • etc.
  • Components define data needs using GraphQL
  • Lots of plugins
    • Data sources
    • Transformations
    • Third party services
    • Custom
  • Hot loading: code, data

Next level shit

  • Image optimization
    • Optimize, resize, lazy load
  • Inline critical CSS
  • Offline first, Service Workers
  • Prefetching
  • Guess.js

Let’s build a Gatsby site

npm install –global gatsby-cli

gatsby –help

Demo of a more complex site

https://reactjs.org/

Thanks!

Questions?

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment