KEMBAR78
Gatsby v2: Faster build times, guess.js, and more! | PPTX
Gatsby v2:
Faster build times, Guess.js, and More!
Webinar
September 27, 2018
Welcome
Presenters
Linda Watkins
Director of
Marketing
Gatsby
Kyle Mathews
CEO & Co-founder
Gatsby
Dustin Schau
Software Engineer
Gatsby
Panelists
Sam Bhagwat
Co-founder & Head of Enterprise
Gatsby
Jason Lengstorf
Head of Developer Relations
Gatsby
Amberley Romo
Software Engineer
Gatsby
Overview
How to use React for
*websites*?
Is there a tool that can solve
similar problems as Drupal but
with modern engineering
practices?
“All fast websites are alike, but
slow websites are slow in
different ways.”
- Leo Tolstoy (sort of)
Over 50% of people will
abandon a mobile site if it takes
more than 3 seconds to load
Why Gatsby?
Build blazing fast, modern
apps and websites with
React
Modern JavaScript and CSS
stack so development is fun
and productive
The Modern Web
● React
● webpack
● babel
● GraphQL
● Modern Javascript
● CSS-In-JS
Performance is baked in
to the framework
Gatsby makes it *hard*
to build slow sites
How to solve the “integration
problem” of decoupled CMSs
Traditional Monolithic CMS
Presentation Layer
Content Backend
Unbundling:
The Headless CMS
Decoupled CMS
Presentation Layer
Headless CMS
Gatsby:
The “presentation layer” for the web
Decoupled CMS
Presentation Layer
Headless CMS
GraphQL integration layer
An Integration layer
lets you...
...use the best tool for the job
...experiment with different CMSes
without needing to change the
development workflow
There are now source plugins for:
● Drupal
● Contentful
● WordPress
● Airtable
● Trello
● Google Spreadsheets
● and dozens more!
Gatsby “glues” data and
code and compiles it into the
fastest website possible
The Future is Fast
Get performance out of the box
Bring Your Own Content
● CMS (WordPress, Drupal, Contentful, etc)
● Static files
● Markdown
● Database(s)
Instantly Scalable
Hosted on the edge
~26k GitHub stars
~600k NPM downloads/month
1133 contributors
Reactjs.org built with Gatsby
Use Cases
Stitch Fix
Braun
SendGrid: Docs Site
Yaaaaassss!
Gatsby can handle apps with:
● User authentication
● Dynamic data
● Asynchronous requests
● Ecommerce
● Full-blown SaaS
Meetfabric.com: Web App
Web App: store.gatsby.org
Case Study:
Hopper.com
Hopper.com
Website built by Narative.co
● Website was outdated
● Hard time recruiting people
● Wanted to use React
Hopper.com
● Fast! 58% improvement in page load times
● Instant navigation (from 2s subsequent
page loads)
● 1.24M pageviews/month
‘Wow, we finally have a
world-class website’
-Hopper Investors
Improving Gatsby
Performance
Dustin Schau
Gatsby v2 is faster!
Faster sites
Faster builds
Why?
● React 16
● @reach/router
Name Size %
React 49.8kb -> 34.8 kb 30%
react-router ->
@reach/router
18.4kb -> 6kb 67%
78.5kb -> 53.9kb
31% size reduction
Small wins add up
Build tooling is faster
New speed record
100k pages = 75.38 seconds
Webpack 1 -> Webpack 4
Babel 6 -> Babel 7
… and!
Gatsby
Gatsby
v1
Build 50s
Develop 30s
v2
25s
12s
Up to 75% improvement!
Improving Accessibility
Gatsby v2 is more
accessible
@reach/router
New router from Ryan Florence
Why should you care?
Your users care
Gatsby v2 routes are accessible
by default
Smaller package + better
accessibility + simplified APIs
import { Link } from 'gatsby';
export default function IndexPage() {
return (
<Link to="/about">About</Link>
)
}
Keep using the Link component
That’s it.
Upgrade.
It’s easy.
Guide
Highlights of the v2
release
Power without the pain
with
performance built-in
React 16
Complete rewrite w/ new features!
● Fragments
● error boundaries
● Portals
● support for custom DOM attributes
● reduced file size
https://reactjs.org/blog/2017/09/26/react-
v16.0.html
React 16
● Dramatic improvements to build times
● New code splitting algorithm
● New first-class support for lazy-loading
CSS chunks.
webpack 4
Babel helps ensure the JavaScript you write
works across different browsers
● Improved build speed
● automatic polyfilling
● Support for more syntax e.g. TypeScript
and JSX Fragments
Babel 7
Natively Query GraphQL APIs
Query for data in
components with <StaticQuery />
How can I query for data in my components?
Now you can with <StaticQuery /> component
Improvements to gatsby-
plugin-offline
Bug fixes & handles more edge cases
Add tracing support
Guess.js + Gatsby
Data-driven speed improvements
Use Analytics data + machine learning to speed
prefetching data needed for the next click
Gatsby swag!!
store.gatsbyjs.org
New Docs IA
Site showcase
Upgrade to v2!
Migration Guide:
https://www.gatsbyjs.org/docs/migrating-from-v1-to-v2/
Get Started:
https://www.gatsbyjs.org/docs/
Thank you!

Gatsby v2: Faster build times, guess.js, and more!

Editor's Notes

  • #19 http://houseplansandmore.com/projectplans/projectplan097D-9069.aspx
  • #38 Hello Fabric/ gatsby store
  • #39 Hello Fabric/ gatsby store