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

Commits on Sep 30, 2021

  1. fix(gatsby): unblock event loop when running queries (#33338) (#33342)

    (cherry picked from commit 91fde1c)
    
    Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
    GatsbyJS Bot and vladar authored Sep 30, 2021
    Copy the full SHA
    6840b5f View commit details
  2. chore(release): Publish

     - gatsby-admin@0.24.1
     - gatsby@3.14.1
    vladar committed Sep 30, 2021
    Copy the full SHA
    e10b2b9 View commit details
Showing with 10 additions and 8 deletions.
  1. +2 −2 packages/gatsby-admin/package.json
  2. +1 −1 packages/gatsby/package.json
  3. +4 −2 packages/gatsby/src/query/index.ts
  4. +3 −3 packages/gatsby/src/utils/page-data.ts
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.0",
"version": "0.24.1",
"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.0",
"gatsby": "^3.14.1",
"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/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
"version": "3.14.0",
"version": "3.14.1",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bin": {
"gatsby": "./cli.js"
6 changes: 4 additions & 2 deletions packages/gatsby/src/query/index.ts
Original file line number Diff line number Diff line change
@@ -96,15 +96,17 @@ function createQueue<QueryIDType>({
function worker(queryId: QueryIDType, cb): void {
const job = createJobFn(state, queryId)
if (!job) {
cb(null, undefined)
setImmediate(() => cb(null, undefined))
return
}
queryRunner(graphqlRunner, job, activity?.span)
.then(result => {
if (activity.tick) {
activity.tick()
}
cb(null, { job, result })
// Note: we need setImmediate to ensure garbage collection has a chance
// to get started during query running
setImmediate(() => cb(null, { job, result }))
})
.catch(error => {
cb(error)
6 changes: 3 additions & 3 deletions packages/gatsby/src/utils/page-data.ts
Original file line number Diff line number Diff line change
@@ -198,7 +198,7 @@ export async function flush(parentSpan?: Span): Promise<void> {

if (hasFlag(query.dirty, FLAG_DIRTY_NEW_PAGE)) {
// query results are not written yet
process.nextTick(() => cb(null, true))
setImmediate(() => cb(null, true))
return
}
}
@@ -239,9 +239,9 @@ export async function flush(parentSpan?: Span): Promise<void> {
},
})

// `process.nextTick` below is a workaround against stack overflow
// `setImmediate` below is a workaround against stack overflow
// occurring when there are many non-SSG pages
process.nextTick(() => cb(null, true))
setImmediate(() => cb(null, true))
return
}, 25)