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.2
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.3
Choose a head ref
  • 4 commits
  • 13 files changed
  • 5 contributors

Commits on Oct 14, 2021

  1. chore(gatsby): only load the necessary logger (#33463) (#33518)

    (cherry picked from commit 934035d)
    
    Co-authored-by: Ward Peeters <ward@coding-tech.com>
    GatsbyJS Bot and wardpeet authored Oct 14, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    33a5ec7 View commit details
  2. feat(gatsby): support named splats in functions (#33301) (#33516)

    Co-authored-by: Ward Peeters <ward@coding-tech.com>
    (cherry picked from commit 018c041)
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    GatsbyJS Bot and KyleAMathews authored Oct 14, 2021
    Copy the full SHA
    c9bb766 View commit details

Commits on Oct 15, 2021

  1. feat(gatsby-source-contentful): Add node manifest support for previews (

    #33297) (#33531)
    
    (cherry picked from commit 3a385a5)
    
    # Conflicts:
    #	packages/gatsby-source-contentful/src/normalize.js
    #	packages/gatsby-source-contentful/src/source-nodes.js
    
    Co-authored-by: Tyler Barnes <tyler@gatsbyjs.com>
    vladar and TylerBarnes authored Oct 15, 2021
    Copy the full SHA
    a220b7c View commit details
  2. chore(release): Publish

     - gatsby-admin@0.24.3
     - gatsby-cli@3.14.2
     - gatsby-source-contentful@5.14.1
     - gatsby@3.14.3
    vladar committed Oct 15, 2021
    Copy the full SHA
    a3a1cb9 View commit details
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`develop dynamic routes param routes 1`] = `
Object {
"super": "additional",
"userId": "23",
}
`;

exports[`develop dynamic routes unnamed wildcard routes 1`] = `
Object {
"*": "super",
"0": "super",
}
`;

exports[`develop functions can parse different ways of sending data file in multipart/form 1`] = `
Array [
Object {
@@ -90,35 +104,22 @@ Object {
}
`;

exports[`develop routing dynamic routes 1`] = `
Object {
"super": "additional",
"userId": "23",
}
`;

exports[`develop routing dynamic routes 2`] = `
Object {
"0": "super",
}
`;

exports[`develop routing routes with special characters 1`] = `"I-Am-Capitalized.js"`;
exports[`develop routes with special characters 1`] = `"I-Am-Capitalized.js"`;

exports[`develop routing routes with special characters 2`] = `"some whitespace.js"`;
exports[`develop routes with special characters 2`] = `"some whitespace.js"`;

exports[`develop routing routes with special characters 3`] = `"with-äöü-umlaut.js"`;
exports[`develop routes with special characters 3`] = `"with-äöü-umlaut.js"`;

exports[`develop routing routes with special characters 4`] = `"some-àè-french.js"`;
exports[`develop routes with special characters 4`] = `"some-àè-french.js"`;

exports[`develop routing routes with special characters 5`] = `"some-אודות.js"`;
exports[`develop routes with special characters 5`] = `"some-אודות.js"`;

exports[`develop routing secondary-level API 1`] = `"I am at a secondary-level"`;
exports[`develop secondary-level API 1`] = `"I am at a secondary-level"`;

exports[`develop routing secondary-level API 2`] = `"I am another sub-directory function"`;
exports[`develop secondary-level API 2`] = `"I am another sub-directory function"`;

exports[`develop routing secondary-level API with index.js 1`] = `"I am an index.js in a sub-directory!"`;
exports[`develop secondary-level API with index.js 1`] = `"I am an index.js in a sub-directory!"`;

exports[`develop routing top-level API 1`] = `"I am at the top-level"`;
exports[`develop top-level API 1`] = `"I am at the top-level"`;

exports[`develop typescript typescript functions work 1`] = `"I am typescript"`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`production dynamic routes param routes 1`] = `
Object {
"super": "additional",
"userId": "23",
}
`;

exports[`production dynamic routes unnamed wildcard routes 1`] = `
Object {
"*": "super",
"0": "super",
}
`;

exports[`production functions can parse different ways of sending data file in multipart/form 1`] = `
Array [
Object {
@@ -86,35 +100,22 @@ Object {
}
`;

exports[`production routing dynamic routes 1`] = `
Object {
"super": "additional",
"userId": "23",
}
`;

exports[`production routing dynamic routes 2`] = `
Object {
"0": "super",
}
`;

exports[`production routing routes with special characters 1`] = `"I-Am-Capitalized.js"`;
exports[`production routes with special characters 1`] = `"I-Am-Capitalized.js"`;

exports[`production routing routes with special characters 2`] = `"some whitespace.js"`;
exports[`production routes with special characters 2`] = `"some whitespace.js"`;

exports[`production routing routes with special characters 3`] = `"with-äöü-umlaut.js"`;
exports[`production routes with special characters 3`] = `"with-äöü-umlaut.js"`;

exports[`production routing routes with special characters 4`] = `"some-àè-french.js"`;
exports[`production routes with special characters 4`] = `"some-àè-french.js"`;

exports[`production routing routes with special characters 5`] = `"some-אודות.js"`;
exports[`production routes with special characters 5`] = `"some-אודות.js"`;

exports[`production routing secondary-level API 1`] = `"I am at a secondary-level"`;
exports[`production secondary-level API 1`] = `"I am at a secondary-level"`;

exports[`production routing secondary-level API 2`] = `"I am another sub-directory function"`;
exports[`production secondary-level API 2`] = `"I am another sub-directory function"`;

exports[`production routing secondary-level API with index.js 1`] = `"I am an index.js in a sub-directory!"`;
exports[`production secondary-level API with index.js 1`] = `"I am an index.js in a sub-directory!"`;

exports[`production routing top-level API 1`] = `"I am at the top-level"`;
exports[`production top-level API 1`] = `"I am at the top-level"`;

exports[`production typescript typescript functions work 1`] = `"I am typescript"`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function (req, res) {
res.json(req.params)
}
96 changes: 56 additions & 40 deletions integration-tests/functions/test-helpers.js
Original file line number Diff line number Diff line change
@@ -7,63 +7,79 @@ const FormData = require("form-data")

export function runTests(env, host) {
describe(env, () => {
describe(`routing`, () => {
test(`top-level API`, async () => {
const result = await fetch(`${host}/api/top-level`).then(res =>
res.text()
)
test(`top-level API`, async () => {
const result = await fetch(`${host}/api/top-level`).then(res =>
res.text()
)

expect(result).toMatchSnapshot()
})
test(`secondary-level API`, async () => {
const result = await fetch(
`${host}/api/a-directory/function`
).then(res => res.text())
expect(result).toMatchSnapshot()
})
test(`secondary-level API`, async () => {
const result = await fetch(`${host}/api/a-directory/function`).then(res =>
res.text()
)

expect(result).toMatchSnapshot()
})
test(`secondary-level API with index.js`, async () => {
const result = await fetch(`${host}/api/a-directory`).then(res =>
res.text()
)
expect(result).toMatchSnapshot()
})
test(`secondary-level API with index.js`, async () => {
const result = await fetch(`${host}/api/a-directory`).then(res =>
res.text()
)

expect(result).toMatchSnapshot()
})
test(`secondary-level API`, async () => {
const result = await fetch(`${host}/api/dir/function`).then(res =>
res.text()
)
expect(result).toMatchSnapshot()
})
test(`secondary-level API`, async () => {
const result = await fetch(`${host}/api/dir/function`).then(res =>
res.text()
)

expect(result).toMatchSnapshot()
})

test(`routes with special characters`, async () => {
const routes = [
`${host}/api/I-Am-Capitalized`,
`${host}/api/some whitespace`,
`${host}/api/with-äöü-umlaut`,
`${host}/api/some-àè-french`,
encodeURI(`${host}/api/some-אודות`),
]

for (const route of routes) {
const result = await fetch(route).then(res => res.text())

expect(result).toMatchSnapshot()
})
test(`routes with special characters`, async () => {
const routes = [
`${host}/api/I-Am-Capitalized`,
`${host}/api/some whitespace`,
`${host}/api/with-äöü-umlaut`,
`${host}/api/some-àè-french`,
encodeURI(`${host}/api/some-אודות`),
]
}
})

describe(`dynamic routes`, () => {
test(`param routes`, async () => {
const routes = [`${host}/api/users/23/additional`]

for (const route of routes) {
const result = await fetch(route).then(res => res.text())
const result = await fetch(route).then(res => res.json())

expect(result).toMatchSnapshot()
}
})

test(`dynamic routes`, async () => {
const routes = [
`${host}/api/users/23/additional`,
`${host}/api/dir/super`,
]

test(`unnamed wildcard routes`, async () => {
const routes = [`${host}/api/dir/super`]
for (const route of routes) {
const result = await fetch(route).then(res => res.json())

expect(result).toMatchSnapshot()
}
})
test(`named wildcard routes`, async () => {
const route = `${host}/api/named-wildcard/super`
const result = await fetch(route).then(res => res.json())

expect(result).toMatchInlineSnapshot(`
Object {
"foo": "super",
}
`)
})
})

describe(`environment variables`, () => {
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.2",
"version": "0.24.3",
"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.2",
"gatsby": "^3.14.3",
"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.1",
"version": "3.14.2",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bin": {
"gatsby": "cli.js"
16 changes: 8 additions & 8 deletions packages/gatsby-cli/src/reporter/start-logger.ts
Original file line number Diff line number Diff line change
@@ -3,10 +3,6 @@
*/
import semver from "semver"
import { isCI } from "gatsby-core-utils"
import { initializeIPCLogger } from "./loggers/ipc"
import { initializeJSONLogger } from "./loggers/json"
import { initializeYurnalistLogger } from "./loggers/yurnalist"
import { initializeINKLogger } from "./loggers/ink"

export const startLogger = (): void => {
if (!process.env.GATSBY_LOGGER) {
@@ -26,14 +22,18 @@ export const startLogger = (): void => {
// This is just workaround to not crash process when reporter is used in worker context.
// process.env.FORCE_COLOR = `0`

initializeIPCLogger()
// TODO move to dynamic imports
require(`./loggers/ipc`).initializeIPCLogger()
}

if (process.env.GATSBY_LOGGER.includes(`json`)) {
initializeJSONLogger()
// TODO move to dynamic imports
require(`./loggers/json`).initializeJSONLogger()
} else if (process.env.GATSBY_LOGGER.includes(`yurnalist`)) {
initializeYurnalistLogger()
// TODO move to dynamic imports
require(`./loggers/yurnalist`).initializeYurnalistLogger()
} else {
initializeINKLogger()
// TODO move to dynamic imports
require(`./loggers/ink`).initializeINKLogger()
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-source-contentful/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-contentful",
"description": "Gatsby source plugin for building websites using the Contentful CMS as a data source",
"version": "5.14.0",
"version": "5.14.1",
"author": "Marcus Ericsson <mericsson@gmail.com> (mericsson.com)",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
10 changes: 9 additions & 1 deletion packages/gatsby-source-contentful/src/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -177,7 +177,13 @@ exports.sourceNodes = async (
},
pluginOptions
) => {
const { createNode, deleteNode, touchNode, createTypes } = actions
const {
createNode,
deleteNode,
touchNode,
createTypes,
unstable_createNodeManifest,
} = actions

let currentSyncData
let contentTypeItems
@@ -672,6 +678,8 @@ exports.sourceNodes = async (
space,
useNameForId: pluginConfig.get(`useNameForId`),
pluginConfig,
syncToken,
unstable_createNodeManifest,
})
)
}
Loading