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.62
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.63
Choose a head ref
  • 7 commits
  • 54 files changed
  • 6 contributors

Commits on Sep 17, 2020

  1. chore(docs): remove remaining spectrum references (#26389)

    Co-authored-by: Lennart <lekoarts@gmail.com>
    taylorcjohnson and LekoArts authored Sep 17, 2020
    Copy the full SHA
    105d74f View commit details
  2. fix(starters): Improve null checking & update to best practices (#26918)

    Co-authored-by: Matt Kane <matt@gatsbyjs.com>
    LekoArts and ascorbic authored Sep 17, 2020
    Copy the full SHA
    6243ca4 View commit details
  3. chore(gatsby): Migrate types/node-interface.js to TypeScript (#26733)

    * Change file extension from JS to TS
    
    * Add types on node-interface methods
    
    * Removes module exports
    
    * Update resolvers response types
    alisson-suzigan authored Sep 17, 2020
    Copy the full SHA
    de99e43 View commit details
  4. Copy the full SHA
    d599a3d View commit details
  5. Copy the full SHA
    74453bc View commit details

Commits on Sep 18, 2020

  1. Copy the full SHA
    d7d2dda View commit details
  2. chore(release): Publish

     - gatsby-admin@0.1.152
     - gatsby@2.24.63
    wardpeet committed Sep 18, 2020
    Copy the full SHA
    f36d7e2 View commit details
Showing with 839 additions and 125 deletions.
  1. +71 −0 benchmarks/gabe-csv-text/.gitignore
  2. +21 −0 benchmarks/gabe-csv-text/LICENSE
  3. +28 −0 benchmarks/gabe-csv-text/README.md
  4. 0 benchmarks/gabe-csv-text/gatsby-browser.js
  5. +17 −0 benchmarks/gabe-csv-text/gatsby-config.js
  6. +59 −0 benchmarks/gabe-csv-text/gatsby-node.js
  7. +56 −0 benchmarks/gabe-csv-text/gen.js
  8. +38 −0 benchmarks/gabe-csv-text/package.json
  9. +30 −0 benchmarks/gabe-csv-text/src/components/bio.js
  10. +72 −0 benchmarks/gabe-csv-text/src/components/layout.js
  11. +30 −0 benchmarks/gabe-csv-text/src/pages/404.js
  12. +70 −0 benchmarks/gabe-csv-text/src/pages/index.js
  13. +104 −0 benchmarks/gabe-csv-text/src/templates/blog-post.js
  14. BIN benchmarks/gabe-csv-text/static/favicon.ico
  15. +2 −0 benchmarks/gabe-csv-text/static/robots.txt
  16. +1 −1 docs/blog/100days/accessibility/index.md
  17. +1 −1 docs/blog/100days/apps/index.md
  18. +1 −1 docs/blog/100days/cms/index.md
  19. +1 −1 docs/blog/100days/comments/index.md
  20. +1 −1 docs/blog/100days/create-themes/index.md
  21. +1 −1 docs/blog/100days/free-hosting/index.md
  22. +1 −1 docs/blog/100days/gatsby-image/index.md
  23. +1 −1 docs/blog/100days/index.md
  24. +1 −1 docs/blog/100days/mdx/index.md
  25. +1 −1 docs/blog/100days/performance/index.md
  26. +1 −1 docs/blog/100days/pwa/index.md
  27. +1 −1 docs/blog/100days/react-component/index.md
  28. +1 −1 docs/blog/100days/seo/index.md
  29. +1 −1 docs/blog/100days/serverless/index.md
  30. +1 −1 docs/blog/100days/start-blog/index.md
  31. +1 −1 docs/blog/100days/use-themes/index.md
  32. +1 −1 docs/contributing/gatsby-style-guide.md
  33. +4 −0 packages/gatsby-admin/CHANGELOG.md
  34. +2 −2 packages/gatsby-admin/package.json
  35. +6 −0 packages/gatsby/CHANGELOG.md
  36. +1 −1 packages/gatsby/README.md
  37. +1 −1 packages/gatsby/package.json
  38. +37 −19 packages/gatsby/src/schema/types/{node-interface.js → node-interface.ts}
  39. +11 −4 packages/gatsby/src/state-machines/query-running/actions.ts
  40. +7 −1 packages/gatsby/src/state-machines/query-running/index.ts
  41. +1 −1 starters/README.md
  42. +76 −26 starters/blog/gatsby-node.js
  43. +30 −21 starters/blog/src/components/bio.js
  44. +1 −1 starters/blog/src/components/layout.js
  45. +3 −2 starters/blog/src/components/seo.js
  46. +1 −1 starters/blog/src/pages/404.js
  47. +27 −19 starters/blog/src/pages/index.js
  48. +1 −1 starters/blog/src/pages/using-typescript.tsx
  49. +1 −1 starters/blog/src/templates/blog-post.js
  50. +4 −0 starters/default/src/components/image.js
  51. +5 −3 starters/default/src/components/layout.js
  52. +3 −2 starters/default/src/components/seo.js
  53. +1 −1 starters/default/src/pages/404.js
  54. +1 −1 starters/default/src/pages/using-typescript.tsx
71 changes: 71 additions & 0 deletions benchmarks/gabe-csv-text/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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

gendata.csv
21 changes: 21 additions & 0 deletions benchmarks/gabe-csv-text/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-csv-text/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Markdown Benchmark; CSV+text version

This is a baseline benchmark for tracking CSV plaintext performance in the Gabe project.

This will produce the same site as `gabe-markdown` without using any markdown. It also generates one giant csv file containing all the data, rather than an individual file per page.

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 that's a fixed cost we're not interested in.

## 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 a new `gendata.csv` file containing `N` rows, each row being one page with pseudo-random content
- Runs `gatsby clean`
- Runs `gatsby build`

The default `yarn bench` will build 512 pages with 1gb memory.
Empty file.
17 changes: 17 additions & 0 deletions benchmarks/gabe-csv-text/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
siteMetadata: {
title: `Gatsby CSV Text Benchmark for Gabe`,
description: "A blog like no other blog",
author: "Bob the Blogger",
},
plugins: [
`gatsby-transformer-csv`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `blurp`,
path: __dirname + '/gendata.csv',
},
},
],
}
59 changes: 59 additions & 0 deletions benchmarks/gabe-csv-text/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const path = require(`path`)
const { createFilePath } = require(`gatsby-source-filesystem`)

exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions
const blogPost = path.resolve(`./src/templates/blog-post.js`)
const result = await graphql(
`
{
allGendataCsv (sort: { fields: [date], order: DESC }) {
edges {
node {
id
slug
title
}
}
}
}
`
)

if (result.errors) {
throw result.errors
}

// Create blog posts pages.
const posts = result.data.allGendataCsv.edges

posts.forEach((post, index) => {
const previous = index === posts.length - 1 ? null : posts[index + 1].node
const next = index === 0 ? null : posts[index - 1].node

createPage({
path: post.node.slug,
component: blogPost,
context: {
slug: post.node.slug,
id: post.node.id,
previous,
next,
},
})
})
}

// Use this to keep in sync with markdown benchmark. TODO: drop this and see the difference.
exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions

if (node.internal.type === `DataCsv`) {
createNodeField({
name: `slug2`,
node,
value: './' + node.slug,
})
}
}

56 changes: 56 additions & 0 deletions benchmarks/gabe-csv-text/gen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const fs = require("fs")
const path = require("path")
const faker = require(`faker`)

console.log("Start of gen")

const N = parseInt(process.env.N, 10) || 100
const FILE = path.resolve("gendata.csv")

console.log("Now generating " + N + " articles into", FILE)
fs.writeFileSync(FILE, "articleNumber,title,description,slug,date,tags,body\n")

function createArticle(n) {
const title = faker.lorem.sentence()
const slug = faker.helpers.slugify(title).toLowerCase()
const desc = faker.lorem.sentence()
const date = faker.date.recent(1000).toISOString().slice(0, 10)
const tags = faker.random
.words(3)
.split(` `)
.map(w => `"${w}"`)
.join(`, `)
fs.appendFileSync(
FILE,
[
// 'a','b','c','d','e','f', 'g'
String(n),
title,
desc,
slug,
date,
tags,
`
<h1>${title}</h1>
<blockquote>${desc}</blockquote>
<p>${faker.lorem.paragraphs(1)}</p>
<p>${faker.lorem.paragraphs(1)}</p>
`,
]
.map(s =>
s
.trim()
// Need to escape newlines and commas
.replace(/,/g, "\\,")
.replace(/\n/g, "") // html don't care about newlines
)
.join(",") + "\n"
)
}

for (let i = 0; i < N; ++i) {
createArticle(i)
}

console.log("Finished generating " + N + " articles into", FILE)
console.log("End of gen")
38 changes: 38 additions & 0 deletions benchmarks/gabe-csv-text/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "gabe-csv-text",
"private": true,
"description": "Benchmark site for testing baseline csv+plaintext perf",
"author": "Peter van der Zee <pvdz@github>",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"bench": "rm -rf generated_articles; gatsby clean; N=${N:-512} node gen.js; CI=1 node --max_old_space_size=${M:-2}000 node_modules/.bin/gatsby build",
"build": "gatsby build",
"clean": "gatsby clean",
"develop": "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-csv": "^2",
"react": "^16.12.0",
"react-dom": "^16.12.0"
}
}
30 changes: 30 additions & 0 deletions benchmarks/gabe-csv-text/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
Loading