presentation on gatsby to sf static web tech meetup

26
Gatsby: A React.js Static Site Generator Kyle Mathews

Upload: kyle-mathews

Post on 08-Jan-2017

1.655 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Presentation on Gatsby to SF Static Web Tech Meetup

Gatsby: A React.jsStatic Site GeneratorKyle Mathews

Page 2: Presentation on Gatsby to SF Static Web Tech Meetup

@kylemathewsCo-founder RelateRocket(Enterprise SaaS, data science,GraphQL, Relay, React.js, React Native)Hiring 1st engineer soon!

Page 3: Presentation on Gatsby to SF Static Web Tech Meetup

My website development tools history… or how Gatsby came to be

Page 4: Presentation on Gatsby to SF Static Web Tech Meetup

2006 — Drupal2011 — Backbone2014 — Static sites + React.js/Webpack/React-Router/Hot-Loader

Page 5: Presentation on Gatsby to SF Static Web Tech Meetup

Love stack for building web apps but what about web sites…? Want React.js + ecosystem + simplicity of static sites.

Page 6: Presentation on Gatsby to SF Static Web Tech Meetup

Spark of inspiration — auto-generate React.js web app from staticMarkdown files?

Page 7: Presentation on Gatsby to SF Static Web Tech Meetup

Obsessed over idea for several months until I took a week off startup work and built v0.1 of Gatsby

Page 8: Presentation on Gatsby to SF Static Web Tech Meetup

Shockingly it worked…

Page 9: Presentation on Gatsby to SF Static Web Tech Meetup

Was able to glue together Webpack, React.js, React-Router, and React-Hot-Loader

Page 10: Presentation on Gatsby to SF Static Web Tech Meetup

gatsby(markdown) => SPA

Page 11: Presentation on Gatsby to SF Static Web Tech Meetup
Page 12: Presentation on Gatsby to SF Static Web Tech Meetup
Page 13: Presentation on Gatsby to SF Static Web Tech Meetup

8 months old but quite a few sites are built on it already

Page 14: Presentation on Gatsby to SF Static Web Tech Meetup
Page 15: Presentation on Gatsby to SF Static Web Tech Meetup
Page 16: Presentation on Gatsby to SF Static Web Tech Meetup
Page 17: Presentation on Gatsby to SF Static Web Tech Meetup
Page 18: Presentation on Gatsby to SF Static Web Tech Meetup
Page 19: Presentation on Gatsby to SF Static Web Tech Meetup

Here I make a case for why Gatsby is best choice in 2016 for building static websites

Page 20: Presentation on Gatsby to SF Static Web Tech Meetup

Gatsby has native support for Best Parts of 2016 Web Dev ecosystem

Postcss, Webpack, Components, React.js, NPM, etc.

Page 21: Presentation on Gatsby to SF Static Web Tech Meetup

Comparing static site generators with Gatsby

* Markdown — same* HTML/Templates — same-ish* CSS — more or less same, most support

Sass/Less/Postcss, etc.* Javascript — many… awkward jQuery

enhancement level, Gatsby very easy* Components — Gatsby pretty unique here w/

1st class support

Page 22: Presentation on Gatsby to SF Static Web Tech Meetup

Gatsby Developer experience

* Batteries included* Boilerplate + Gatsby “apps” (tentative

names)* Hot reloading* Feel very natural to React dev* Entire React ecosystem available to static

sites (npm install my-favorite-component)

Page 23: Presentation on Gatsby to SF Static Web Tech Meetup

Gatsby User experience

* Fast!* No-reload page transitions* Easy service worker support for client

caching + offline

Page 24: Presentation on Gatsby to SF Static Web Tech Meetup

DEMO

Page 25: Presentation on Gatsby to SF Static Web Tech Meetup

The future

* Revamp data transformation* New Plugin API* Support Gatsby “apps”

Page 26: Presentation on Gatsby to SF Static Web Tech Meetup

extends: { require(‘gatsby-documention-app’),},plugins: [ require(‘gatsby-plugin-markdown’), require(‘gatsby-plugin-postcss’)({ modules: true, }),],// Implement Gatsby APIspostBuild: (pages) => { // Do something after site is built.}