Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gatsbyjs/gatsby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: gatsby@2.24.73
Choose a base ref
...
head repository: gatsbyjs/gatsby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: gatsby@2.24.74
Choose a head ref
  • 13 commits
  • 43 files changed
  • 12 contributors

Commits on Oct 9, 2020

  1. chore(gatsby): Migrate query-watcher to ts (#27324)

    * chore(gatsby): Migrate query-watcher to ts
    
    * fix exports and some types
    
    * modify import from index
    
    * optional chaining instead of check if it is undefined
    Michele Della Mea authored Oct 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    69e5097 View commit details
  2. feat(gatsby-plugin-utils): add testPluginOptionsSchema to verify plug…

    …in schema options (#27334)
    Marvin Frachet authored Oct 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6f842fb View commit details
  3. feat(benchmarks): Add markdown route API (#27360)

    * add unified routes benchmark
    
    * update title
    LekoArts authored Oct 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7b37bb7 View commit details
  4. docs: add example to printTypeDefinitions method (#27211)

    * Add example to printTypeDefinitions method
    
    * Update packages/gatsby/src/redux/actions/restricted.ts
    
    Co-authored-by: Megan Sullivan <meganesulli@gmail.com>
    
    * Requested changes
    
    * Add comment to second example
    
    Co-authored-by: Megan Sullivan <meganesulli@gmail.com>
    stijnvdkolk and meganesu authored Oct 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dc8c30a View commit details
  5. fix: lint (#27371)

    meganesu authored Oct 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6b37713 View commit details

Commits on Oct 12, 2020

  1. chore(docs): Spelling: Continous -> Continuous (#27372)

    Co-authored-by: Tim Smith <tim.smith.hdg@gmail.com>
    timscodebase and webrune-tim authored Oct 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8c79fbe View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3518d10 View commit details
  3. fix(gatsby): Make pluginOptionsSchema optional (#27397)

    * Make pluginOptionsSchema optional
    
    @context: #27242
    
    * Exclude undefined pluginOptionsSchema
    
    * Exclude undefined pluginOptionsSchema from plugin validation
    openscript authored Oct 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a67fb02 View commit details
  4. docs(gatsby-admin): add user information to readme (#27358)

    * chore(gatsby-admin): add user information to readme
    
    * Update README.md
    
    * Cleanup based on @LekoArts suggestions
    mxstbr authored Oct 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b1b56e4 View commit details
  5. chore(gatsby-plugin-sitemap): Add options schema (#27367)

    * chore(gatsby-plugin-sitemap): Add options schema
    
    * Wrap export with env condition
    ascorbic authored Oct 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4ad9eb8 View commit details
  6. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    961f3d5 View commit details
  7. fix(gatsby): wait for extracted query enqueuing before running queries (

    #27408)
    
    * add failing e2e test
    
    * fix(gatsby): wait for extracted query enqueuing before running it
    vladar authored Oct 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f50093e View commit details
  8. chore(release): Publish

     - gatsby-admin@0.1.163
     - gatsby-plugin-google-analytics@2.3.18
     - gatsby-plugin-sharp@2.6.41
     - gatsby-plugin-sitemap@2.4.16
     - gatsby-plugin-utils@0.2.28
     - gatsby-transformer-sqip@2.3.42
     - gatsby@2.24.74
    vladar committed Oct 12, 2020
    Copy the full SHA
    63532f7 View commit details
Showing with 1,173 additions and 203 deletions.
  1. +72 −0 benchmarks/gabe-fs-markdown-route-api/.gitignore
  2. +21 −0 benchmarks/gabe-fs-markdown-route-api/LICENSE
  3. +28 −0 benchmarks/gabe-fs-markdown-route-api/README.md
  4. +17 −0 benchmarks/gabe-fs-markdown-route-api/gatsby-config.js
  5. +46 −0 benchmarks/gabe-fs-markdown-route-api/gen.js
  6. +39 −0 benchmarks/gabe-fs-markdown-route-api/package.json
  7. +30 −0 benchmarks/gabe-fs-markdown-route-api/src/components/bio.js
  8. +72 −0 benchmarks/gabe-fs-markdown-route-api/src/components/layout.js
  9. +30 −0 benchmarks/gabe-fs-markdown-route-api/src/pages/404.js
  10. +70 −0 benchmarks/gabe-fs-markdown-route-api/src/pages/index.js
  11. +81 −0 benchmarks/gabe-fs-markdown-route-api/src/pages/{MarkdownRemark.frontmatter__slug}.js
  12. BIN benchmarks/gabe-fs-markdown-route-api/static/favicon.ico
  13. +2 −0 benchmarks/gabe-fs-markdown-route-api/static/robots.txt
  14. +1 −1 docs/docs/deploying-to-netlify.md
  15. +19 −0 e2e-tests/development-runtime/cypress/integration/hot-reloading/page-queries.js
  16. +23 −0 e2e-tests/development-runtime/src/pages/page-query.js
  17. +4 −0 packages/gatsby-admin/CHANGELOG.md
  18. +47 −7 packages/gatsby-admin/README.md
  19. +2 −2 packages/gatsby-admin/package.json
  20. +6 −0 packages/gatsby-plugin-google-analytics/CHANGELOG.md
  21. +1 −1 packages/gatsby-plugin-google-analytics/package.json
  22. +4 −5 packages/gatsby-plugin-google-analytics/src/gatsby-node.js
  23. +4 −0 packages/gatsby-plugin-sharp/CHANGELOG.md
  24. +1 −1 packages/gatsby-plugin-sharp/package.json
  25. +17 −15 packages/gatsby-plugin-sharp/src/gatsby-node.js
  26. +4 −0 packages/gatsby-plugin-sitemap/CHANGELOG.md
  27. +2 −1 packages/gatsby-plugin-sitemap/package.json
  28. +47 −0 packages/gatsby-plugin-sitemap/src/gatsby-node.js
  29. +10 −0 packages/gatsby-plugin-utils/CHANGELOG.md
  30. +2 −1 packages/gatsby-plugin-utils/package.json
  31. +198 −0 packages/gatsby-plugin-utils/src/__tests__/test-plugin-options-schema.ts
  32. +1 −0 packages/gatsby-plugin-utils/src/index.ts
  33. +38 −0 packages/gatsby-plugin-utils/src/test-plugin-options-schema.ts
  34. +4 −0 packages/gatsby-transformer-sqip/CHANGELOG.md
  35. +2 −2 packages/gatsby-transformer-sqip/package.json
  36. +9 −0 packages/gatsby/CHANGELOG.md
  37. +1 −1 packages/gatsby/index.d.ts
  38. +2 −2 packages/gatsby/package.json
  39. +0 −11 packages/gatsby/src/bootstrap/load-plugins/__tests__/load-plugins.ts
  40. +6 −5 packages/gatsby/src/bootstrap/load-plugins/validate.ts
  41. +176 −147 packages/gatsby/src/query/{query-watcher.js → query-watcher.ts}
  42. +13 −1 packages/gatsby/src/redux/actions/restricted.ts
  43. +21 −0 packages/gatsby/src/state-machines/query-running/index.ts
72 changes: 72 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
.cache/
public

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity

generated_articles
yarn.lock
21 changes: 21 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Gatsbyjs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 28 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Baseline Gatsby Benchmark: fs + markdown + File System Route API

This is a baseline benchmark site in the Gabe project.

This site in particular tracks Markdown performance for individual files per page using the File System Route API.

The site can generate an arbitrary amount of super simple pages. Each page has a small header, a quote, and two small paragraphs of random text. No images, because we want to benchmark Markdown and the page creation via the route API.

## Install

Run `yarn` or `npm install`

## Usage

You can start a benchmark run like this:

```shell
N=1000 M=2 yarn bench
```

- `N=1000`: instructs the run to build a site of 1000 pages
- `M=2`: instructs nodejs to use up to 2gb of memory for its long term storage
- Deletes generates files from previous run
- Generates `N` pages with pseudo-random content
- Runs `gatsby clean`
- Runs `gatsby build`

The default `yarn bench` will build 512 pages with 1gb memory.
17 changes: 17 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
siteMetadata: {
title: `Gatsby FS Markdown & Route API Benchmark for Gabe`,
description: "A blog like no other blog",
author: "Bob the Blogger",
},
plugins: [
`gatsby-transformer-remark`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `blog`,
path: `${__dirname}/generated_articles`,
},
},
],
}
46 changes: 46 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/gen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const fs = require("fs")
const path = require("path")
const faker = require(`faker`)

const N = parseInt(process.env.N, 10) || 100

let n = 0

function createArticle(n, sentence, slug) {
const desc = faker.lorem.sentence();

return `---
articleNumber: ${n}
title: "${sentence.replace(/"/g, '\\"')}"
description: "${desc.replace(/"/g, '\\"')}"
slug: '${slug}'
date: ${faker.date.recent(1000).toISOString().slice(0, 10)}
---
# ${sentence}
> ${desc}
${faker.lorem.paragraphs(2)}
`
}

console.log("Start of gen")

if (fs.existsSync("./generated_articles")) {
TODO // count existing folders. If they are less than given number, just amend to them. Otherwise abort and require a rimraf
} else {
fs.mkdirSync("./generated_articles", { recursive: true })
}

console.log("Now generating " + N + " articles")
for (let i = 0; i < N; ++i) {
const sentence = faker.lorem.sentence()
const slug = faker.helpers.slugify(sentence).toLowerCase()
fs.writeFileSync(
path.join("./generated_articles", slug + ".md"),
createArticle(i, sentence, slug)
)
}
console.log("Finished generating " + N + " articles")
console.log("End of gen")
39 changes: 39 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "gabe-fs-markdown-route-api",
"private": true,
"description": "Benchmark site for testing baseline markdown perf with individual files per page using the File System Route API",
"author": "Peter van der Zee <pvdz@github>",
"contributors": ["LekoArts <lekoarts@gmail.com>"],
"version": "0.1.0",
"license": "MIT",
"scripts": {
"bench": "rm -rf generated_articles; gatsby clean; N=${N:-512} node gen.js; CI=1 GATSBY_EXPERIMENTAL_ROUTING_APIS=1 node --max_old_space_size=${M:-2}000 node_modules/.bin/gatsby build",
"build": "GATSBY_EXPERIMENTAL_ROUTING_APIS=1 gatsby build",
"clean": "gatsby clean",
"develop": "GATSBY_EXPERIMENTAL_ROUTING_APIS=1 gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\""
},
"devDependencies": {
"prettier": "2.0.4"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby/tree/master/benchmarks/"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
"keywords": [
"gatsby",
"benchmark",
"markdown"
],
"dependencies": {
"faker": "^4.1.0",
"gatsby": "^2",
"gatsby-source-filesystem": "^2",
"gatsby-transformer-remark": "^2",
"react": "^16.12.0",
"react-dom": "^16.12.0"
}
}
30 changes: 30 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/src/components/bio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Bio component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/

import React from "react"

const Bio = () => {
return (
<div
style={{
display: `flex`,
marginBottom: '5px',
}}
>
<p>
Written by <strong>Bob</strong> who lives and works in Fan
Srancisco building useful things.
{` `}
<a href={`https://twitter.com/bob`}>
You should follow him on Twitter
</a>
</p>
</div>
)
}

export default Bio
72 changes: 72 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/src/components/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React from "react"
import { Link } from "gatsby"

class Layout extends React.Component {
render() {
const { location, title, children } = this.props
const rootPath = `${__PATH_PREFIX__}/`
let header

if (location.pathname === rootPath) {
header = (
<h1
style={{
marginBottom: '5px',
marginTop: 0,
}}
>
<Link
style={{
boxShadow: `none`,
textDecoration: `none`,
color: `inherit`,
}}
to={`/`}
>
{title}
</Link>
</h1>
)
} else {
header = (
<h3
style={{
fontFamily: `Montserrat, sans-serif`,
marginTop: 0,
}}
>
<Link
style={{
boxShadow: `none`,
textDecoration: `none`,
color: `inherit`,
}}
to={`/`}
>
{title}
</Link>
</h3>
)
}
return (
<div
style={{
marginLeft: `auto`,
marginRight: `auto`,
maxWidth: '75%',
padding: `5px`,
}}
>
<header>{header}</header>
<main>{children}</main>
<footer>
© {new Date().getFullYear()}, Built with
{` `}
<a href="https://www.gatsbyjs.org">Gatsby</a>
</footer>
</div>
)
}
}

export default Layout
30 changes: 30 additions & 0 deletions benchmarks/gabe-fs-markdown-route-api/src/pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react"
import { graphql } from "gatsby"

import Layout from "../components/layout"

class NotFoundPage extends React.Component {
render() {
const { data } = this.props
const siteTitle = data.site.siteMetadata.title

return (
<Layout location={this.props.location} title={siteTitle}>
<h1>Not Found</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</Layout>
)
}
}

export default NotFoundPage

export const pageQuery = graphql`
query {
site {
siteMetadata {
title
}
}
}
`
Loading