Skip to content

Commit

Permalink
Merge branch 'master' into ts-migrate-eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed Mar 16, 2020
2 parents b78bff5 + af07ac0 commit 5b99c9b
Show file tree
Hide file tree
Showing 237 changed files with 17,841 additions and 14,606 deletions.
1 change: 1 addition & 0 deletions docs/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ starter:
- Styling:PostCSS
- Styling:SCSS
- Styling:Tailwind
- Styling:Milligram
- Styling:Other
- Styling:None
- Testing
Expand Down
42 changes: 42 additions & 0 deletions docs/docs/mdx/importing-and-using-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,48 @@ Because the `<Message />` and `<Chart />` components were passed into the provid
lessonTitle="Make React components globally available as shortcodes in MDX"
/>

## Lazy-loading components

When you use components in your `.mdx` files, Gatsby will bundle them into the main application bundle. This can cause performance problems.

In the future, [`gatsby-plugin-mdx`](/packages/gatsby-plugin-mdx) will address this. In the meantime, it can be prudent to lazy-load very large dependencies. The following snippet provides an example for lazy-loading an imaginary `Thing` component:

```jsx:title=src/components/LazyThing.js
import React from "react"

const Placeholder = () => null

const LazyThing = props => {
// While the component is loading, we'll render a fallback placeholder.
// (The Placeholder is a component that renders nothing).
const [Component, setComponent] = React.useState(() => Placeholder)

// After the initial render, kick off a dynamic import to fetch
// the real component, and set it into our state.
React.useEffect(() => {
import("./Thing.js").then(Thing => setComponent(() => Thing.default))
}, [])

return <Component {...props} />
}

export default LazyThing
```

Inside your MDX, swap out any references to `Thing` with `LazyThing`:

```diff
-import Thing from "../components/Thing/Thing.js"
+import LazyThing from "../components/Thing/LazyThing.js"

## Introducing Things

Here is a demo:

-<Thing hi={5} />
+<LazyThing hi={5} />
```

### Additional resources

- Follow this detailed [example on using MDX](/examples/using-MDX) to import and render components.
11 changes: 11 additions & 0 deletions docs/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10044,3 +10044,14 @@
- Marketing
- Video
featured: false
- title: Mob HQ
main_url: https://hq.yt-mob.com/
url: https://hq.yt-mob.com/
description: >
Mob HQ is the Headquarters for the World Cup winning Downhill Mountain Bike Race Team, and also a full-time Ride Center for YT bikes.
categories:
- Sports
- Travel
built_by: Built by Rebels Ltd.
built_by_url: https://builtbyrebels.com/
featured: false
22 changes: 22 additions & 0 deletions docs/starters.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
- url: https://delog-w3layouts.netlify.com/
repo: https://github.com/W3Layouts/gatsby-starter-delog
description: A Gatsby Starter built with Netlify CMS to launch your dream blog with a click.
tags:
- Blog
- CMS:Netlify
features:
- Simple blog designed for designer and developers
- Manage Posts with Netlify CMS
- Option to add featured image and meta description while adding posts
- url: https://styxlab.github.io
repo: https://github.com/styxlab/gatsby-starter-try-ghost
description: A Gatsby starter for creating blogs from headless Ghost CMS.
Expand Down Expand Up @@ -5594,3 +5604,15 @@
- Custom GraphQL API for handling checkout and payment
- Postmark for order notifications
- Strong Customer Authentication
- url: https://koop-blog.netlify.com/
repo: https://github.com/bagseye/koop-blog
description: A simple blog platform using GatsbyJS and MDX
tags:
- Blog
- Markdown
- MDX
features:
- Responsive design
- Styled 404 page
- Lightweight
- Styled Components
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"devDependencies": {
"@babel/core": "^7.7.7",
"@babel/node": "^7.7.7",
"@babel/plugin-transform-typescript": "^7.7.4",
"@babel/runtime": "^7.7.7",
"@babel/core": "^7.8.7",
"@babel/node": "^7.8.7",
"@babel/plugin-transform-typescript": "^7.8.7",
"@babel/runtime": "^7.8.7",
"@lerna/prompt": "3.18.5",
"@types/babel__code-frame": "^7.0.1",
"@types/bluebird": "^3.5.29",
"@types/bluebird": "^3.5.30",
"@types/cache-manager": "^2.10.2",
"@types/eslint": "^6.1.8",
"@types/express": "^4.17.2",
"@types/fs-extra": "^8.0.1",
"@types/express": "^4.17.3",
"@types/fs-extra": "^8.1.0",
"@types/got": "^9.6.9",
"@types/jest": "^24.0.23",
"@types/jest": "^24.9.1",
"@types/joi": "^14.3.4",
"@types/lodash": "^4.14.149",
"@types/node": "^12.12.11",
"@types/node": "^12.12.30",
"@types/stack-trace": "^0.0.29",
"@types/webpack": "^4.41.0",
"@types/webpack": "^4.41.7",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"babel-eslint": "^10.0.3",
"babel-eslint": "^10.1.0",
"babel-jest": "^24.9.0",
"chalk": "^2.4.2",
"chokidar": "^3.3.0",
"chokidar": "^3.3.1",
"cross-env": "^5.2.1",
"danger": "^8.0.0",
"date-fns": "^1.30.1",
Expand All @@ -32,10 +32,10 @@
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-flowtype": "^3.13.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.19.0",
"fs-extra": "^8.1.0",
"glob": "^7.1.6",
"husky": "3.1.0",
Expand All @@ -48,16 +48,16 @@
"jest-silent-reporter": "^0.1.2",
"joi": "^14.3.1",
"js-yaml": "^3.13.1",
"lerna": "^3.19.0",
"lerna": "^3.20.2",
"lint-staged": "^8.2.1",
"markdown-magic": "^0.2.1",
"npm-run-all": "4.1.5",
"plop": "^1.9.1",
"prettier": "1.19.1",
"rimraf": "^3.0.0",
"rimraf": "^3.0.2",
"svgo": "1.3.2",
"ts-jest": "^22",
"typescript": "^3.7.3",
"typescript": "^3.8.3",
"yargs": "^10.1.2"
},
"engines": {
Expand Down Expand Up @@ -130,6 +130,6 @@
"packages/*"
],
"resolutions": {
"write-file-atomic": "2.4.1"
"write-file-atomic": "2.4.3"
}
}
4 changes: 4 additions & 0 deletions packages/babel-plugin-remove-graphql-queries/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.7.26](https://github.com/gatsbyjs/gatsby/compare/babel-plugin-remove-graphql-queries@[email protected]) (2020-03-16)

**Note:** Version bump only for package babel-plugin-remove-graphql-queries

## [2.7.25](https://github.com/gatsbyjs/gatsby/compare/babel-plugin-remove-graphql-queries@[email protected]) (2020-03-13)

### Bug Fixes
Expand Down
8 changes: 4 additions & 4 deletions packages/babel-plugin-remove-graphql-queries/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-remove-graphql-queries",
"version": "2.7.25",
"version": "2.7.26",
"author": "Jason Quense <[email protected]>",
"repository": {
"type": "git",
Expand All @@ -9,9 +9,9 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-plugin-remove-graphql-queries#readme",
"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"babel-preset-gatsby-package": "^0.2.17",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"babel-preset-gatsby-package": "^0.2.18",
"cross-env": "^5.2.1"
},
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions packages/babel-preset-gatsby-package/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.18](https://github.com/gatsbyjs/gatsby/compare/[email protected]@0.2.18) (2020-03-16)

**Note:** Version bump only for package babel-preset-gatsby-package

## [0.2.17](https://github.com/gatsbyjs/gatsby/compare/[email protected]@0.2.17) (2020-03-06)

**Note:** Version bump only for package babel-preset-gatsby-package
Expand Down
18 changes: 9 additions & 9 deletions packages/babel-preset-gatsby-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-gatsby-package",
"version": "0.2.17",
"version": "0.2.18",
"author": "Philipp Spiess <[email protected]>",
"repository": {
"type": "git",
Expand All @@ -12,14 +12,14 @@
"@babel/core": "^7.0.0"
},
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.7.5",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.6",
"@babel/preset-flow": "^7.7.4",
"@babel/preset-react": "^7.7.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.7",
"@babel/preset-flow": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"babel-plugin-dynamic-import-node": "^2.3.0",
"core-js": "^2.6.11"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/babel-preset-gatsby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.36](https://github.com/gatsbyjs/gatsby/compare/[email protected]@0.2.36) (2020-03-16)

**Note:** Version bump only for package babel-preset-gatsby

## [0.2.35](https://github.com/gatsbyjs/gatsby/compare/[email protected]@0.2.35) (2020-03-11)

**Note:** Version bump only for package babel-preset-gatsby
Expand Down
26 changes: 13 additions & 13 deletions packages/babel-preset-gatsby/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-gatsby",
"version": "0.2.35",
"version": "0.2.36",
"author": "Philipp Spiess <[email protected]>",
"repository": {
"type": "git",
Expand All @@ -9,19 +9,19 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby#readme",
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.7.5",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/plugin-transform-spread": "^7.7.4",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"@babel/runtime": "^7.7.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/plugin-transform-spread": "^7.8.3",
"@babel/preset-env": "^7.8.7",
"@babel/preset-react": "^7.8.3",
"@babel/runtime": "^7.8.7",
"babel-plugin-dynamic-import-node": "^2.3.0",
"babel-plugin-macros": "^2.8.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"gatsby-core-utils": "^1.0.33"
"gatsby-core-utils": "^1.0.34"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand All @@ -34,8 +34,8 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__ --ignore **/utils/path-serializer.ts --extensions \".ts,.js\""
},
"devDependencies": {
"@babel/cli": "^7.7.5",
"babel-preset-gatsby-package": "^0.2.17",
"@babel/cli": "^7.8.4",
"babel-preset-gatsby-package": "^0.2.18",
"cross-env": "^5.2.1",
"slash": "^3.0.0"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/gatsby-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.10.11](https://github.com/gatsbyjs/gatsby/compare/[email protected]@2.10.11) (2020-03-16)

**Note:** Version bump only for package gatsby-cli

## [2.10.10](https://github.com/gatsbyjs/gatsby/compare/[email protected]@2.10.10) (2020-03-13)

### Bug Fixes
Expand Down
Loading

0 comments on commit 5b99c9b

Please sign in to comment.