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.5
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.6
Choose a head ref
  • 9 commits
  • 18 files changed
  • 9 contributors

Commits on Nov 2, 2021

  1. feat(gatsby-source-wordpress): Update supported-remote-plugin-version…

    …s.ts (#33801) (#33804)
    
    Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
    (cherry picked from commit 144daaa)
    
    Co-authored-by: Tyler Barnes <tyler@gatsbyjs.com>
    GatsbyJS Bot and TylerBarnes authored Nov 2, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c0d07e7 View commit details
  2. fix(gatsby-plugin-image): flickering when state changes (#33732) (#33807

    )
    
    (cherry picked from commit 0a04e38)
    
    Co-authored-by: Ward Peeters <ward@coding-tech.com>
    GatsbyJS Bot and wardpeet authored Nov 2, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    880022e View commit details
  3. fix(gatsby-plugin-image): GatsbyImage not displaying image in IE11 (#…

    …33416) (#33806)
    
    (cherry picked from commit d708d91)
    
    Co-authored-by: Rares Portan <43433598+raresportan@users.noreply.github.com>
    GatsbyJS Bot and raresportan authored Nov 2, 2021

    Verified

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

     - gatsby-plugin-image@1.14.2
     - gatsby-plugin-sharp@3.14.3
     - gatsby-source-shopify@5.6.2
     - gatsby-source-wordpress@5.14.2
     - gatsby-transformer-sqip@3.14.3
    vladar committed Nov 2, 2021
    Copy the full SHA
    476a591 View commit details

Commits on Nov 18, 2021

  1. feat(gatsby-source-drupal): Add node manifest support for previews (#…

    …33683) (#34017)
    
    * Drupal plugin: Add node manifest support.
    
    (cherry picked from commit 3dc7629)
    
    Co-authored-by: Polina Vorozheykina <vorozheykinap@gmail.com>
    GatsbyJS Bot and pvorozhe authored Nov 18, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f74cc8f View commit details
  2. fix(gatsby-source-drupal): searcParams missing from urls (#33861) (#3…

    …4018)
    
    - Fix issue where params such as api-key are not added to the url
    
    (cherry picked from commit c9a35ed)
    
    Co-authored-by: Joe Stramel <jstramel@users.noreply.github.com>
    GatsbyJS Bot and jstramel authored Nov 18, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    76deb39 View commit details
  3. fix(gatsby-source-drupal): Ensure all new nodes are created before cr…

    …eating relationships (#33864) (#34019)
    
    * fix(gatsby-source-drupal): Ensure all new nodes are created before creating relationships
    
    * fixes
    
    * Add support for webhook bodies as well
    
    (cherry picked from commit 9cf4c05)
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    GatsbyJS Bot and KyleAMathews authored Nov 18, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9694010 View commit details
  4. fix(gatsby): ensure that writing node manifests to disk does not brea…

    …k on Windows (#33853) (#34020)
    
    * fix: ensure that writing node manifests to disk does not break on Windows
    
    * refactor: use joinPath helper when creating node manifest file name
    
    * feat: replace all invalid Windows file path chars when creating node manifest files
    
    * test: use joinPath helper in node manifest tests
    
    * feat: only replace special windows chars in the manifest filename
    
    * feat: do not use negative look behind for Windows hard drive name
    
    * test: add tests for windows node manifest file name character replacing
    
    (cherry picked from commit f525ce0)
    
    Co-authored-by: Matt Ehlinger <ehlinger.matt@gmail.com>
    GatsbyJS Bot and veryspry authored Nov 18, 2021

    Verified

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

     - gatsby-admin@0.24.6
     - gatsby-source-drupal@4.14.3
     - gatsby@3.14.6
    vladar committed Nov 18, 2021
    Copy the full SHA
    1acb1bc View commit details
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.5",
"version": "0.24.6",
"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.5",
"gatsby": "^3.14.6",
"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-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.1",
"version": "1.14.2",
"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",
Original file line number Diff line number Diff line change
@@ -90,11 +90,12 @@ class GatsbyImageHydrator extends Component<
}

return import(`./lazy-hydrate`).then(({ lazyHydrate }) => {
const cacheKey = JSON.stringify(this.props.image.images)
this.lazyHydrator = lazyHydrate(
{
image: props.image.images,
isLoading: state.isLoading,
isLoaded: state.isLoaded,
isLoading: state.isLoading || hasImageLoaded(cacheKey),
isLoaded: state.isLoaded || hasImageLoaded(cacheKey),
toggleIsLoaded: () => {
props.onLoad?.()

3 changes: 3 additions & 0 deletions packages/gatsby-plugin-image/src/gatsby-ssr.tsx
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ export function onRenderBody({ setHeadComponents }: RenderBodyArgs): void {
position: relative;
overflow: hidden;
}
.gatsby-image-wrapper picture.object-fit-polyfill {
position: static !important;
}
.gatsby-image-wrapper img {
bottom: 0;
height: 100%;
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-sharp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-sharp",
"description": "Wrapper of the Sharp image manipulation library for Gatsby plugins",
"version": "3.14.2",
"version": "3.14.3",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -32,7 +32,7 @@
"@types/sharp": "^0.28.5",
"babel-preset-gatsby-package": "^1.14.0",
"cross-env": "^7.0.3",
"gatsby-plugin-image": "^1.14.1"
"gatsby-plugin-image": "^1.14.2"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sharp#readme",
"keywords": [
2 changes: 1 addition & 1 deletion packages/gatsby-source-drupal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-drupal",
"description": "Gatsby source plugin for building websites using the Drupal CMS as a data source",
"version": "4.14.2",
"version": "4.14.3",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
Original file line number Diff line number Diff line change
@@ -98,6 +98,69 @@
}
}
}
},
{
"jsonapi": {
"version": "1.0",
"meta": {
"links": {
"self": {
"href": "http://jsonapi.org/format/1.0/"
}
}
}
},
"data": {
"type": "node--article",
"id": "article-10",
"attributes": {
"id": 100,
"uuid": "article-10",
"title": "Article #10",
"body": "Aliquam non varius libero, sit amet consequat ex. Aenean porta turpis quis vulputate blandit. Suspendisse in porta erat. Sed sit amet scelerisque turpis, at rutrum mauris. Sed tempor eleifend lobortis. Proin maximus, massa sed dignissim sollicitudin, quam risus mattis justo, sit amet aliquam odio ligula quis urna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut mollis leo nisi, at interdum urna fermentum ut. Fusce id suscipit neque, eu fermentum lacus. Donec egestas laoreet felis ac luctus. Vestibulum molestie mattis ante, a vulputate nunc ullamcorper at. Ut hendrerit ipsum eget gravida ultricies."
},
"relationships": {
"field_tags": {
"data": [
{
"type": "taxonomy_term--tags",
"id": "tag-10"
}
]
}
}
}
},
{
"jsonapi": {
"version": "1.0",
"meta": {
"links": {
"self": {
"href": "http://jsonapi.org/format/1.0/"
}
}
}
},
"data": {
"type": "taxonomy_term--tags",
"id": "tag-10",
"attributes": {
"id": 110,
"uuid": "tag-10",
"langcode": "en",
"name": "Tag #10",
"description": null,
"weight": 0,
"changed": 1523031646,
"default_langcode": true,
"path": {
"alias": null,
"pid": null,
"langcode": "en"
}
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"action": "update",
"data": [
{
"type": "node--article",
"id": "article-10",
"attributes": {
"id": 100,
"uuid": "article-10",
"title": "Article #10",
"body": "Aliquam non varius libero, sit amet consequat ex. Aenean porta turpis quis vulputate blandit. Suspendisse in porta erat. Sed sit amet scelerisque turpis, at rutrum mauris. Sed tempor eleifend lobortis. Proin maximus, massa sed dignissim sollicitudin, quam risus mattis justo, sit amet aliquam odio ligula quis urna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut mollis leo nisi, at interdum urna fermentum ut. Fusce id suscipit neque, eu fermentum lacus. Donec egestas laoreet felis ac luctus. Vestibulum molestie mattis ante, a vulputate nunc ullamcorper at. Ut hendrerit ipsum eget gravida ultricies."
},
"relationships": {
"field_tags": {
"data": [
{
"type": "taxonomy_term--tags",
"id": "tag-10"
}
]
}
}
},
{
"type": "taxonomy_term--tags",
"id": "tag-10",
"attributes": {
"id": 110,
"uuid": "tag-10",
"langcode": "en",
"name": "Tag #10",
"description": null,
"weight": 0,
"changed": 1523031646,
"default_langcode": true,
"path": {
"alias": null,
"pid": null,
"langcode": "en"
}
}
}
]
}

24 changes: 24 additions & 0 deletions packages/gatsby-source-drupal/src/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -355,6 +355,26 @@ describe(`gatsby-source-drupal`, () => {
})
})
})
describe(`multiple entities in webhook body`, () => {
let resp
beforeAll(async () => {
const webhookBody = require(`./fixtures/webhook-body-multiple-nodes.json`)
await sourceNodes(
{
...args,
webhookBody,
},
{ baseUrl }
)
})

it(`Relationships`, async () => {
expect(
nodes[createNodeId(`und.article-10`)].relationships.field_tags___NODE
.length
).toBe(1)
})
})

describe(`Insert content`, () => {
it(`Node doesn't exist before webhook`, () => {
@@ -567,6 +587,10 @@ describe(`gatsby-source-drupal`, () => {
nodes[createNodeId(`und.article-2`)].relationships
.field_tertiary_image___NODE_image___NODE
).toBe(undefined)
expect(
nodes[createNodeId(`und.article-10`)].relationships.field_tags___NODE
.length
).toBe(1)
})

it(`Back references`, () => {
53 changes: 53 additions & 0 deletions packages/gatsby-source-drupal/src/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ const {
storeRefsLookups,
handleReferences,
handleWebhookUpdate,
createNodeIfItDoesNotExist,
handleDeletedNode,
} = require(`./utils`)

@@ -61,6 +62,21 @@ async function worker([url, options]) {
}
}

if (typeof options.searchParams === `object`) {
url = new URL(url)
const searchParams = new URLSearchParams(options.searchParams)
const searchKeys = Array.from(searchParams.keys())
searchKeys.forEach(searchKey => {
// Only add search params to url if it has not already been
// added.
if (!url.searchParams.has(searchKey)) {
url.searchParams.set(searchKey, searchParams.get(searchKey))
}
})
url = url.toString()
}
delete options.searchParams

const response = await got(url, {
agent,
cache: false,
@@ -219,6 +235,17 @@ ${JSON.stringify(webhookBody, null, 4)}`
nodesToUpdate = [data]
}

for (const nodeToUpdate of nodesToUpdate) {
await createNodeIfItDoesNotExist({
nodeToUpdate,
actions,
createNodeId,
createContentDigest,
getNode,
reporter,
})
}

for (const nodeToUpdate of nodesToUpdate) {
await handleWebhookUpdate(
{
@@ -330,6 +357,31 @@ ${JSON.stringify(webhookBody, null, 4)}`

// Process sync data from Drupal.
const nodesToSync = res.body.entities

// First create all nodes that we haven't seen before. That
// way we can create relationships correctly next as the nodes
// will exist in Gatsby.
for (const nodeSyncData of nodesToSync) {
if (nodeSyncData.action === `delete`) {
continue
}

let nodesToUpdate = nodeSyncData.data
if (!Array.isArray(nodeSyncData.data)) {
nodesToUpdate = [nodeSyncData.data]
}
for (const nodeToUpdate of nodesToUpdate) {
createNodeIfItDoesNotExist({
nodeToUpdate,
actions,
createNodeId,
createContentDigest,
getNode,
reporter,
})
}
}

for (const nodeSyncData of nodesToSync) {
if (nodeSyncData.action === `delete`) {
handleDeletedNode({
@@ -467,6 +519,7 @@ ${JSON.stringify(webhookBody, null, 4)}`
username: basicAuth.username,
password: basicAuth.password,
headers,
searchParams: params,
responseType: `json`,
parentSpan: fullFetchSpan,
},
Loading