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@3.14.1
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@3.14.2
Choose a head ref
  • 7 commits
  • 38 files changed
  • 6 contributors

Commits on Oct 5, 2021

  1. chore: Fix tests for WordPress, Contentful & update CircleCI (#33256) (

    …#33439)
    
    (cherry picked from commit 1d8ebb2)
    
    Co-authored-by: Lennart <lekoarts@gmail.com>
    vladar and LekoArts authored Oct 5, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    1759c1c View commit details
  2. feat(gatsby): Don't crash the build process when in preview mode (#33184

    ) (#33433)
    
    * feat(gatsby): Don't crash the build process when in preview mode
    
    This causes problems to a number of Gatsby Cloud customers. When doing preview builds, there's often nodes that are missing information as the user is still filling out the content form. We do want to crash production builds
    in this case as we don't want 1/2 formed pages but for preview, we should error but not crash.
    
    Fixes this Gatsby Cloud feature request https://gatsby.canny.io/gatsby-cloud/p/errors-shouldnt-necessarily-break-preview
    
    The error page is very spartan but perhaps good enough for now.
    
    * Add more to error & customize it for Preview
    
    * make this conditional
    
    * cloud sets booleans as strings...
    
    * Better error html message
    
    * Revert chunkSize change + make pretty structured errors
    
    * Add the error name/stack to the generated error html page
    
    * restore breaking prod builds
    
    * just need stack
    
    * Improve error
    
    * fix lint error
    
    * Fix typescript errors
    
    * remove console.logs
    
    * Add page data & component id to preview error page
    
    * Update packages/gatsby/src/utils/worker/child/render-html.ts
    
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    
    * fixes for reviews
    
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    (cherry picked from commit c2d42ec)
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    3 people authored Oct 5, 2021
    Copy the full SHA
    1604efb View commit details
  3. fix(gatsby): postcss-svgo - remove plugin removeAttrs (#33266) (#33434)

    Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
    (cherry picked from commit a1f35ca)
    
    Co-authored-by: Samuel Vaillant <samuel.vllnt@gmail.com>
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    3 people authored Oct 5, 2021
    Copy the full SHA
    07f1990 View commit details
  4. feat(gatsby-source-drupal): port hot-fixes for Drupal/Gatsby customer…

    … to package (#33419) (#33435)
    
    (cherry picked from commit 1777f08)
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    3 people authored Oct 5, 2021
    Copy the full SHA
    d0a152f View commit details
  5. fix(gatsby-source-drupal): Add tests for meta.count support & fix bug…

    … with i18n (#33423) (#33440)
    
    * feat(gatsby-source-drupal): port hot-fixes for Drupal/Gatsby customer to package
    
    * Add tests for meta.count URL creation
    
    The main guerentee that this is working is that only the first articles json file has a
    next href so the only way all articles are fetched is if we create the URLs upfront.
    
    * Add tests for meta.count for i18n (and fix bug for it)
    
    * Make paths windows-happy
    
    Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
    (cherry picked from commit 22805bd)
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    GatsbyJS Bot and KyleAMathews authored Oct 5, 2021
    Copy the full SHA
    aae86b5 View commit details
  6. feat(gatsby-plugin-image): support multiple sources using gatsby-plug…

    …in-image (#32544) (#33436)
    
    Co-authored-by: Ward Peeters <ward@coding-tech.com>
    (cherry picked from commit 3bf4f10)
    
    Co-authored-by: Angelo Ashmore <angeloashmore@users.noreply.github.com>
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    3 people authored Oct 5, 2021
    Copy the full SHA
    11231fc View commit details
  7. chore(release): Publish

     - gatsby-admin@0.24.2
     - gatsby-cli@3.14.1
     - gatsby-plugin-image@1.14.1
     - gatsby-plugin-sharp@3.14.1
     - gatsby-source-drupal@4.14.1
     - gatsby-source-shopify@5.6.1
     - gatsby-source-wordpress@5.14.1
     - gatsby-transformer-sqip@3.14.1
     - gatsby@3.14.2
    vladar committed Oct 5, 2021
    Copy the full SHA
    ea4fb54 View commit details
Showing with 862 additions and 246 deletions.
  1. +9 −8 .circleci/config.yml
  2. +0 −7 integration-tests/gatsby-source-wordpress/gatsby-config.js
  3. +0 −11 integration-tests/gatsby-source-wordpress/test-fns/data-resolution.js
  4. +2 −2 packages/gatsby-admin/package.json
  5. +1 −1 packages/gatsby-cli/package.json
  6. +5 −0 packages/gatsby-cli/src/structured-errors/error-map.ts
  7. +1 −1 packages/gatsby-plugin-image/package.json
  8. +14 −0 packages/gatsby-plugin-image/src/gatsby-node.ts
  9. +78 −42 packages/gatsby-plugin-image/src/resolver-utils.ts
  10. +2 −2 packages/gatsby-plugin-sharp/package.json
  11. +4 −6 packages/gatsby-source-contentful/src/__tests__/extend-node-type.js
  12. +1 −1 packages/gatsby-source-drupal/package.json
  13. +19 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/1593545806.json
  14. +40 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/article-meta.count-i18n.json
  15. +39 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/article-meta.count.json
  16. +32 −0 ...-drupal/src/__tests__/fixtures/articlemeta.count-i18n___page%5Blimit%5D=3&page%5Boffset%5D=3.json
  17. +52 −0 ...ource-drupal/src/__tests__/fixtures/articlemeta.count___page%5Blimit%5D=1&page%5Boffset%5D=2.json
  18. +52 −0 ...ource-drupal/src/__tests__/fixtures/articlemeta.count___page%5Blimit%5D=3&page%5Boffset%5D=3.json
  19. +60 −0 ...ource-drupal/src/__tests__/fixtures/articlemeta.count___page%5Blimit%5D=3&page%5Boffset%5D=6.json
  20. +41 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/i18n-test-article-meta.count-i18n.json
  21. +32 −0 ..._/fixtures/i18n-test-i18n-test-articlemeta.count-i18n___page%5Blimit%5D=3&page%5Boffset%5D=3.json
  22. +30 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/image-gallary.json
  23. +14 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/jsonapi-meta.count-i18n.json
  24. +11 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/jsonapi-meta.count.json
  25. +1 −0 packages/gatsby-source-drupal/src/__tests__/fixtures/jsonapi.json
  26. +65 −16 packages/gatsby-source-drupal/src/__tests__/index.js
  27. +124 −112 packages/gatsby-source-drupal/src/gatsby-node.js
  28. +11 −4 packages/gatsby-source-drupal/src/utils.js
  29. +2 −2 packages/gatsby-source-shopify/package.json
  30. +3 −14 packages/gatsby-source-shopify/src/gatsby-node.ts
  31. +2 −3 packages/gatsby-source-shopify/src/resolve-gatsby-image-data.ts
  32. +1 −1 packages/gatsby-source-wordpress/package.json
  33. +3 −3 packages/gatsby-source-wordpress/src/steps/process-and-validate-plugin-options.ts
  34. +2 −2 packages/gatsby-transformer-sqip/package.json
  35. +2 −2 packages/gatsby/package.json
  36. +62 −2 packages/gatsby/src/commands/build-html.ts
  37. +0 −1 packages/gatsby/src/utils/webpack-utils.ts
  38. +45 −3 packages/gatsby/src/utils/worker/child/render-html.ts
17 changes: 9 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -83,10 +83,10 @@ aliases:
yarn why lmdb-store
- run:
name: Run tests
command: yarn jest --ci --runInBand $(yarn jest --listTests | sed 's/\/root\/project//g' | circleci tests split --split-by=timings)
command: yarn jest --ci --runInBand $(yarn -s jest --listTests | sed 's/\/home\/circleci\/project\///g' | circleci tests split)
environment:
NODE_OPTIONS: --max-old-space-size=2048
GENERATE_JEST_REPORT: true
GENERATE_JEST_REPORT: "true"
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
JEST_JUNIT_OUTPUT_NAME: results.xml
- store_test_results:
@@ -145,7 +145,7 @@ commands:
condition: << parameters.condition >>
steps:
- slack/status:
channel: eng-react-integration-status
channel: eng-react-integration-status

e2e-test:
parameters:
@@ -249,7 +249,8 @@ jobs:
<<: *test_template

integration_tests_gatsby_source_wordpress:
machine: true
machine:
image: "ubuntu-2004:202107-02"
steps:
- run:
command: |
@@ -477,7 +478,7 @@ jobs:
steps:
- checkout
# jq is helpful for parsing json & python required for node-gyp to build lmdb
- run: apt-get update && apt-get install jq python -y
- run: sudo apt-get update && sudo apt-get install jq python -y
- <<: *restore_cache
- <<: *install_node_modules
- run: yarn markdown
@@ -489,7 +490,7 @@ jobs:
executor: node
steps:
- checkout
- run: apt-get update && apt-get install jq python -y
- run: sudo apt-get update && sudo apt-get install jq python -y
- <<: *restore_cache
- <<: *install_node_modules
- run: git config --global user.name "GatsbyJS Bot"
@@ -556,7 +557,7 @@ jobs:
command: yarn jest --ci --runInBand ((yarn jest --listTests) | Foreach-Object {$_ -replace '.*\\packages', 'packages'} | Foreach-Object {$_ -replace '\\', '/'} | circleci tests split --split-by=timings)
environment:
NODE_OPTIONS: --max-old-space-size=2048
GENERATE_JEST_REPORT: true
GENERATE_JEST_REPORT: "true"
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
JEST_JUNIT_OUTPUT_NAME: results.xml
- store_test_results:
@@ -571,7 +572,7 @@ jobs:
steps:
- checkout
# python 2 is not built in and node-gyp needs it to build lmdb
- run: apt-get update && apt-get install python -y
- run: sudo apt-get update && sudo apt-get install python -y
- run:
name: "Update React to prerelease"
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
7 changes: 0 additions & 7 deletions integration-tests/gatsby-source-wordpress/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -65,13 +65,6 @@ const wpPluginOptions = !process.env.DEFAULT_PLUGIN_OPTIONS
50
: // and we don't actually need more than 1000 in production
1000,

beforeChangeNode: ({ remoteNode }) => {
console.log(`Hi from an inline fn!`)
remoteNode.beforeChangeNodeTest = `TEST-${remoteNode.id}`

return remoteNode
},
},
// excluding this because it causes Gatsby to throw errors
BlockEditorContentNode: { exclude: true },
Original file line number Diff line number Diff line change
@@ -231,24 +231,13 @@ describe(`data resolution`, () => {
beforeChangeNodeTest
}
}
# inline fn in gatsby-config.js
# support for this will be removed in future versions
allWpPost {
nodes {
id
beforeChangeNodeTest
}
}
}
`,
})

result.data.allWpPage.nodes.forEach(node => {
expect(node.beforeChangeNodeTest).toBe(`TEST-${node.id}`)
})
result.data.allWpPost.nodes.forEach(node => {
expect(node.beforeChangeNodeTest).toBe(`TEST-${node.id}`)
})
})

it(`resolves root fields`, async () => {
4 changes: 2 additions & 2 deletions packages/gatsby-admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-admin",
"version": "0.24.1",
"version": "0.24.2",
"main": "index.js",
"author": "Max Stoiber",
"license": "MIT",
@@ -29,7 +29,7 @@
"@typescript-eslint/parser": "^4.29.3",
"csstype": "^2.6.17",
"formik": "^2.2.9",
"gatsby": "^3.14.1",
"gatsby": "^3.14.2",
"gatsby-interface": "^0.0.244",
"gatsby-plugin-typescript": "^3.14.0",
"gatsby-plugin-webfonts": "^1.1.4",
2 changes: 1 addition & 1 deletion packages/gatsby-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-cli",
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands",
"version": "3.14.0",
"version": "3.14.1",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bin": {
"gatsby": "cli.js"
5 changes: 5 additions & 0 deletions packages/gatsby-cli/src/structured-errors/error-map.ts
Original file line number Diff line number Diff line change
@@ -47,6 +47,11 @@ const errors = {
level: Level.ERROR,
docsUrl: `https://gatsby.dev/debug-html`,
},
"95314": {
text: (context): string => context.errorMessage,
level: Level.ERROR,
docsUrl: `https://gatsby.dev/debug-html`,
},
"98123": {
text: (context): string =>
`${context.stageLabel} failed\n\n${
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-image/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-plugin-image",
"version": "1.14.0",
"version": "1.14.1",
"scripts": {
"build": "npm-run-all -s clean -p build:*",
"build:gatsby-node": "tsc --jsx react --downlevelIteration true --skipLibCheck true --esModuleInterop true --outDir dist/ src/gatsby-node.ts src/babel-plugin-parse-static-images.ts src/resolver-utils.ts src/types.d.ts -d --declarationDir dist/src",
14 changes: 14 additions & 0 deletions packages/gatsby-plugin-image/src/gatsby-node.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { GatsbyNode } from "gatsby"
import { getCacheDir } from "./node-apis/node-utils"
import {
ImageFormatType,
ImageLayoutType,
ImagePlaceholderType,
} from "./resolver-utils"

export * from "./node-apis/preprocess-source"

export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"] =
({ actions, schema }) => {
actions.createTypes([
schema.buildEnumType(ImageFormatType),
schema.buildEnumType(ImageLayoutType),
schema.buildEnumType(ImagePlaceholderType),
])
}

export const onCreateBabelConfig: GatsbyNode["onCreateBabelConfig"] = ({
actions,
store,
Loading