• Stars
    star
    253
  • Rank 160,776 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 5 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for the Introduction to Gatsby course.

Gatsby

Frontend Masters: Introduction to Gatsby

In this course, learn to build blazing fast apps and websites with React using Gatsby, a static PWA (Progressive Web App) generator. Over 50% of people will abandon a mobile site if it takes more than 3 seconds to load. Unless youโ€™re willing to give up half of your potential customers, performance is no longer optional on the modern web. Fortunately, there are a lot of tools available to help you build screaming fast websites. Unfortunately, thereโ€™s a frighteningly large number of performance considerations, and many of them are easy to get wrong.

What Youโ€™ll Learn

  • Learn how to leverage free, open source tools including Gatsby, React, and GraphQL to build high-performance websites.
  • Deliver an excellent experience to your users by providing only critical assets on load and prefetching assets for subsequent page loads.
  • Implement performance best practices, such as the PRPL pattern, lazy loading assets, and more.
  • Learn to build and deploy blazing fast websites in the fraction of time.
  • Create websites quickly with performance baked in.
  • Deploy your sites for free in minutes with Netlify.

A Note About Running the Code

We recommend getting the code running on your computer to build your confidence working with Gatsby. If you get stuck, use the Course Errata below to debug, or refer to the the step branches to see what is different between your code and the reference code.

Course Code Running on CodeSandbox

You can jump into the CodeSandbox for each branch without having to get the code running on your computer. Keep in mind, that if you want to modify the code, you'll need to create a CodeSandbox free account to fork a new sandbox and save it to your CodeSandbox account.

Getting Course Code Running on Your Machine

For windows users, go through the installation instructions for cross-env and add it to your package.json develop script.

  1. npm install
  2. npm run develop
  3. Open http://localhost:8000/

Course Slides (hit the right/down arrow keys to progress through the slides)

Refer to the Course Errata below if you are running into issues.

Prerequisites

  1. Have a text editor installed, i.e. VSCode
  2. Have the Gatsby CLI (gatsby-cli) installed globally by running: npm install -g gatsby-cli

Course Errata

Video: Rendering Components in MDX video at 1 minute, 32 seconds where Jason installs the Gatsby MDX plugin.

The gatsby-mdx plugin was deprecated in favor of gatsby-plugin-mdx.

Fixed code: See this commit to migrate to gatsby-plugin-mdx

npm install gatsby-plugin-mdx instead of gatsby-mdx

View the step4/mdx-blog branch for final code for the section.

Video: Adding Optimized Images to Post at 1 minute, 49 seconds where Jason configures remark images.

An additional config line needs to be added to configure gatsby-remark-images.

Fixed code: See this commit to configure gatsby-remark-images'

    {
      resolve: 'gatsby-plugin-mdx',
      options: {
        defaultLayouts: {
          default: require.resolve('./src/components/layout.js'),
        },
        gatsbyRemarkPlugins: ['gatsby-remark-images'],
        plugins: ['gatsby-remark-images'],
      },
    },

View the step6/blog-images branch for final code for the section.

Video: Getting Post by Slug at 4 minutes, 55 seconds where Jason gets the post body.

gatsby-plugin-mdx no longer requires body to be nested in code in the query

in post.js the query should be

export const query = graphql`
  query($slug: String!) {
    mdx(frontmatter: { slug: { eq: $slug } }) {
      frontmatter {
        title
        author
      }
      body
    }
  }
`

Instead of

export const query = graphql`
  query($slug: String!) {
    mdx(frontmatter: { slug: { eq: $slug } }) {
      frontmatter {
        title
        author
      }
      code {
        body
      }
    }
  }

More details in issue #27

More Repositories

1

front-end-handbook-2018

2018 edition of our front-end development handbook
HTML
4,187
star
2

front-end-handbook-2019

[Book] 2019 edition of our front-end development handbook
HTML
4,107
star
3

front-end-handbook-2017

2017 edition of our front-end development guide
HTML
3,824
star
4

front-end-handbook

The resources and tools for learning about the practice of front-end development.
HTML
1,799
star
5

front-end-handbook-2024

A guide to modern front-end web development / engineering.
HTML
1,182
star
6

learning-roadmap

The Front-End Developer Learning Roadmap by Frontend Masters
HTML
1,014
star
7

bootcamp

Frontend Masters Bootcamp
HTML
701
star
8

api-design-node-v3

[Course] API design in Node with Express v3
JavaScript
696
star
9

react-enlightenment

A thoughtful and complete introduction to React.
HTML
429
star
10

intro-node-js

[Course] Code for Introduction to Node.js
JavaScript
372
star
11

fullstack-graphql

JavaScript
370
star
12

fmmn

frontend masters minneapolis workshop notes
JavaScript
369
star
13

javascript-enlightenment

[Book] JavaScript (ES2015+) Enlightenment
HTML
308
star
14

api-design-node

[Course] API Design in Node.js code
JavaScript
256
star
15

remix-fundamentals

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. Get a jumpstart on Remix with this workshop.
TypeScript
255
star
16

api-design-node-v2

[Course] API Design in Node.js, v2: REST & GraphQL code
JavaScript
232
star
17

intro-to-graphql

[Course] Introduction to GraphQL
JavaScript
191
star
18

advanced-remix

Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.
TypeScript
186
star
19

intro-mongo-db

[Course] Introduction to MongoDB code
JavaScript
181
star
20

2015-02-13-React

[Course] Code for the 2015 React.js workshop with Ryan Florence
JavaScript
170
star
21

grid-flexbox-v2

Version 2 of the Flexbox and Grid course at Frontend Masters.
CSS
152
star
22

hardcore-functional-js-v2

Code for the Hardcore Functional JavaScript, v2 course
JavaScript
142
star
23

service-workers-offline

Code for the Service Workers / PWA section of the Service Workers & Offline course by Kyle Simpson
JavaScript
138
star
24

pure-react-state-management

Pure React State Management course documentation
134
star
25

serverless-with-aws

[Course] Serverless with AWS: Get a quick start into the world of Serverless functions with AWS Lambda.
JavaScript
134
star
26

fm-snippets

Code snippets for course annotations.
JavaScript
119
star
27

advanced-graphql

[Course] Advanced GraphQL - Learn advanced practices and techniques when when building a GraphQL API.
JavaScript
111
star
28

advanced-gql-v2

Code for the Advanced GraphQL Course on Frontend Masters
JavaScript
108
star
29

fm-transcripts

Transcripts of Frontend Masters Courses
91
star
30

ai-nodejs

JavaScript
85
star
31

react-state-management

64
star
32

hardcore-functional-architecture

JavaScript
57
star
33

angular-components

[Course] Code for the AngularJS 1.x Components & ES6 Course
JavaScript
57
star
34

react-web-starter

[Course] starter for react web app
JavaScript
53
star
35

ember-octane

Mike North's Ember Octane workshop
JavaScript
39
star
36

react-native-todo

[Course] Todo app for the React Native Course
Objective-C
32
star
37

ember-github-ui

[Course] Code for the Ember 2.x Course on Frontend Masters
JavaScript
28
star
38

getting-a-job-v3

Watch the course on Frontend Masters
28
star
39

sweat-book

[Course] Work out demo app for the React Native Course
26
star
40

observablish-values

JavaScript
25
star
41

web-workers

Code for the Web Workers section of the Service Workers course by Kyle Simpson
JavaScript
16
star
42

ember-commently

[Course] Code for the Comment.ly Ember.js app for the Advanced Ember 2.x course
CSS
12
star
43

ios-issues

Repository for managing publicly reported issues with the Frontend Masters iOS App
10
star
44

android-issues

Repository for managing publicly reported issues with the Frontend Masters Android App
6
star
45

fullstack-app-next-starter

TypeScript
5
star
46

blazingly-fast-js

JavaScript
5
star
47

javascript-fundamentals-v3

JavaScript
3
star
48

fem-htmx

JavaScript
2
star
49

gitbook-plugin-open-graph

Adds open graph and twitter share meta tags to gitbook
HTML
1
star
50

cielo24_php

[ARCHIVED] A PHP client library for the cielo24.com API
PHP
1
star