diff --git a/.forestry/front_matter/templates/blog.yml b/.forestry/front_matter/templates/blog.yml
new file mode 100644
index 0000000000000..461b9fef8f944
--- /dev/null
+++ b/.forestry/front_matter/templates/blog.yml
@@ -0,0 +1,37 @@
+---
+label: blog
+hide_body: false
+is_partial: false
+fields:
+- name: title
+ label: Title
+ type: text
+ hidden: false
+ default: ''
+- name: date
+ label: Date
+ type: datetime
+ hidden: false
+ default: ''
+- name: author
+ label: Author
+ type: text
+ hidden: false
+ default: ''
+- name: tags
+ label: Tags
+ type: tag_list
+ hidden: false
+ default: ''
+- name: image
+ label: Image
+ type: file
+ hidden: false
+ default: ''
+- name: showImageInArticle
+ label: 'Show Image? '
+ type: boolean
+ hidden: false
+ default: ''
+pages:
+- docs/blog/gatsby-days-talks-are-here.md
diff --git a/.forestry/front_matter/templates/docs.yml b/.forestry/front_matter/templates/docs.yml
new file mode 100644
index 0000000000000..20664ea9efa56
--- /dev/null
+++ b/.forestry/front_matter/templates/docs.yml
@@ -0,0 +1,8 @@
+---
+label: Docs
+hide_body: false
+is_partial: false
+fields:
+- type: text
+ name: title
+ label: Title
diff --git a/.forestry/settings.yml b/.forestry/settings.yml
new file mode 100644
index 0000000000000..6ec37b5f44439
--- /dev/null
+++ b/.forestry/settings.yml
@@ -0,0 +1,41 @@
+---
+new_page_extension: md
+auto_deploy: false
+admin_path:
+webhook_url:
+sections:
+- type: heading
+ label: Content
+- type: directory
+ path: docs/blog
+ label: Blog Posts
+ create: all
+ match: "**/*.md"
+ templates:
+ - blog
+- type: directory
+ path: docs/docs
+ label: Docs
+ create: all
+ match: "**/*.md"
+ templates:
+ - making-a-site-with-user-authentication
+- type: document
+ path: docs/blog/author.yaml
+ label: Authors
+- type: document
+ path: docs/sites.yml
+ label: Featured Sites
+- type: document
+ path: docs/starters.yml
+ label: Starters
+upload_dir: www/src/uploads
+public_path: "/src/uploads"
+front_matter_path: ''
+use_front_matter_path: false
+file_template: ":filename:"
+build:
+ preview_command: npm run forestry:preview
+ preview_env:
+ - BUILD_DIR=www/
+ output_directory: www/public
diff --git a/.prettierignore b/.prettierignore
index 76588cef92e25..792bb9dc5dcef 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -29,3 +29,6 @@ infrastructure
# coverage
coverage
+
+# forestry files
+.forestry/**/*
diff --git a/docs/blog/2018-10-25-unstructured-data/data_sources.png b/docs/blog/2018-10-25-using-gatsby-without-graphql/data_sources.png
similarity index 100%
rename from docs/blog/2018-10-25-unstructured-data/data_sources.png
rename to docs/blog/2018-10-25-using-gatsby-without-graphql/data_sources.png
diff --git a/docs/blog/2018-10-25-unstructured-data/index.md b/docs/blog/2018-10-25-using-gatsby-without-graphql/index.md
similarity index 96%
rename from docs/blog/2018-10-25-unstructured-data/index.md
rename to docs/blog/2018-10-25-using-gatsby-without-graphql/index.md
index c3b05a42b1d49..8c63d2b3d360a 100644
--- a/docs/blog/2018-10-25-unstructured-data/index.md
+++ b/docs/blog/2018-10-25-using-gatsby-without-graphql/index.md
@@ -1,5 +1,5 @@
---
-title: Using unstructured data in Gatsby
+title: Using Gatsby without GraphQL
date: 2018-10-25
author: Amberley Romo
tags: ["sourcing", "data"]
@@ -16,7 +16,7 @@ Gatsby’s rich data plugin ecosystem lets you build sites with the data you wan
-Most examples in the Gatsby docs and on the web at large focus on leveraging source plugins to manage your data in Gatsby sites. And rightly so! Gatsby's data layer is powerful and extremely effective; it solves the "integration problem" of decoupled CMSs -- it's the glue between presentation layer and wherever your data is sourced from.
+Most examples in the Gatsby docs and on the web at large focus on leveraging source plugins to manage your data in Gatsby sites. And rightly so! Gatsby's GraphQL data layer is powerful and extremely effective; it solves the "integration problem" of decoupled CMSs -- it's the glue between presentation layer and wherever your data is sourced from.
@@ -25,11 +25,11 @@ Most examples in the Gatsby docs and on the web at large focus on leveraging sou
-> _[Source plugins](/docs/create-source-plugin/)_ “source” data from remote or local locations into Gatsby nodes. _[Gatsby nodes](/docs/node-interface/)_ are the center of Gatsby’s data handling layer.
+> _[Source plugins](/docs/create-source-plugin/)_ “source” data from remote or local locations into Gatsby nodes, which are then queryable within your Gatsby site using GraphQL. _[Gatsby nodes](/docs/node-interface/)_ are the center of Gatsby’s data handling layer.
We're calling this the **"content mesh"** — the infrastructure layer for a decoupled website. ([Sam Bhagwat](https://twitter.com/calcsam) introduced and explored this concept in his recent five-part series, [The Journey to a Content Mesh](https://www.gatsbyjs.org/blog/2018-10-04-journey-to-the-content-mesh)).
-**However, you don't _need_ to use source plugins (or create Gatsby nodes) to pull data into a Gatsby site!** In this post we'll explore how to use an "unstructured data" approach in Gatsby sites, and some of the pros and cons of doing so.
+**However, you don't _need_ to use source plugins (or create Gatsby nodes) to pull data into a Gatsby site!** In this post we'll explore how to use Gatsby without GraphQL (using "unstructured data"), and some of the pros and cons of doing so.
> _Note_: For our purposes here, "unstructured data" means data "handled outside of Gatsby's data layer" i.e. using the data directly, and not transforming the data into Gatsby nodes.
diff --git a/docs/blog/2018-10-25-unstructured-data/integration_layer.png b/docs/blog/2018-10-25-using-gatsby-without-graphql/integration_layer.png
similarity index 100%
rename from docs/blog/2018-10-25-unstructured-data/integration_layer.png
rename to docs/blog/2018-10-25-using-gatsby-without-graphql/integration_layer.png
diff --git a/docs/blog/2019-01-09-gatsby-days-talks-are-here.md b/docs/blog/2019-01-09-gatsby-days-talks-are-here.md
new file mode 100644
index 0000000000000..e31418d0395fa
--- /dev/null
+++ b/docs/blog/2019-01-09-gatsby-days-talks-are-here.md
@@ -0,0 +1,32 @@
+---
+title: Gatsby Days Talks are Here!
+date: 2019-01-09T08:00:00+00:00
+author: Linda Watkins
+tags:
+ - Gatsby Days
+ - Presentations
+ - Talks
+ - Videos
+image: "./images/Gatsby-Days copy.png"
+showImageInArticle: true
+---
+
+The wait is over! Gatsby Days talks are posted below. Gatsby Days are one-day, in-person conferences on the modern website technology stack and the future of the web.
+
+Get caught up on all the latest presentations from Gatsby Days in Mountain View, California such as Kyle Mathews' presentation on the future of the web, Chris Biscardi on Gatsby Themes, product announcements, how to sell Gatsby to your clients, and more. Check out the recordings below and if you'd like to see a Gatsby Days come to your city, [**cast your vote here**](https://www.gatsbyjs.com/gatsby-days-signup/).
+
+### Gatsby Days Talks
+
+[How We Got Here and The Future of Website Development](https://www.gatsbyjs.com/gatsby-days-keynote-kyle/) by **Kyle Mathews**, CEO and Co-founder, Gatsby
+
+[Introducing Gatsby Themes](https://www.gatsbyjs.com/gatsby-days-themes-chris/) with **Chris Biscardi**, Developer, Gatsby
+
+[Announcing Gatsby Preview: The Future is in the Cloud ](https://www.gatsbyjs.com/gatsby-days-preview-andrew/) with **Andrew Rhyne**, Cloud Services Engineer, Gatsby
+
+[The Power of Positioning: Selling Gatsby to Your Clients](https://www.gatsbyjs.com/gatsby-days-positioning-linda/) by **Linda Watkins**, Director of Marketing, Gatsby
+
+[The Journey to the Content Mesh](https://www.gatsbyjs.com/gatsby-days-content-mesh-sam/) with **Sam Bhagwat**, Co-Founder and Head of Enterprise, Gatsby
+
+[How Gatsby Does High-Impact, Low-Effort UX Research (and You Can Too!)](https://www.gatsbyjs.com/gatsby-days-UXresearch-shannon/) by **Shannon Soper**, UX Specialist and Head of Learning, Gatsby
+
+[Move Fast, Don't Break Things: Trends in Modern Web Development with Mediacurrent](https://www.gatsbyjs.com/gatsby-days-mediacurrent-ben/) by **Ben Robertson**, Front-End Developer, Mediacurrent
diff --git a/docs/blog/images/Gatsby-Days copy.png b/docs/blog/images/Gatsby-Days copy.png
new file mode 100644
index 0000000000000..79b31e6e6c348
Binary files /dev/null and b/docs/blog/images/Gatsby-Days copy.png differ
diff --git a/docs/docs/custom-html.md b/docs/docs/custom-html.md
index fd49f64135e65..bbe52ea0f2ef1 100644
--- a/docs/docs/custom-html.md
+++ b/docs/docs/custom-html.md
@@ -15,18 +15,24 @@ cp .cache/default-html.js src/html.js
And then make modifications as needed.
+If you need to insert custom html into the `
` or `` of each page on your site, you can use `html.js`.
+
### Required props
Note: the various props that are rendered into pages _are_ required e.g.
`headComponents`, `preBodyComponents`, `body`, and `postBodyComponents`.
-### React Helmet
+### Inserting html into the
-Also, anything you render in the `html.js` component will _not_ be made "live" in
+Anything you render in the `html.js` component will _not_ be made "live" in
the client like other components. If you want to dynamically update your
`` we recommend using
[React Helmet](/packages/gatsby-plugin-react-helmet/)
+### Inserting html into the
+
+If you want to insert custom html into the footer, html.js is the preferred way of doing this. If you're writing a plugin, consider using the `setPostBodyComponents` prop in the [Gatsby SSR API](/docs/ssr-apis/).
+
### Target container
If you see this error: `Uncaught Error: _registerComponent(...): Target container is not a DOM element.` it means your `html.js` is missing the required
diff --git a/docs/docs/gatsby-lifecycle-apis.md b/docs/docs/gatsby-lifecycle-apis.md
index d81aa1b0f4f64..28406b0b0bfdb 100644
--- a/docs/docs/gatsby-lifecycle-apis.md
+++ b/docs/docs/gatsby-lifecycle-apis.md
@@ -46,7 +46,7 @@ The sequence of the **main** bootstrap Node API lifecycles are:
- (schema update happens here)
- **extract queries from components** where the [queryCompiler](https://github.com/gatsbyjs/gatsby/blob/6de0e4408e14e599d4ec73948eb4153dc3cde849/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js#L189) replaces page GraphQL queries and `StaticQueries`
- The [queries are run](https://github.com/gatsbyjs/gatsby/blob/6de0e4408e14e599d4ec73948eb4153dc3cde849/packages/gatsby/src/internal-plugins/query-runner/page-query-runner.js#L120), and the [pages are written out](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/internal-plugins/query-runner/pages-writer.js)
-- [onPostBoostrap](https://www.gatsbyjs.org/docs/node-apis/#onPostBootstrap) is called (but it is not often used)
+- [onPostBootstrap](https://www.gatsbyjs.org/docs/node-apis/#onPostBootstrap) is called (but it is not often used)
## Build sequence
diff --git a/docs/docs/node-creation.md b/docs/docs/node-creation.md
index 6ea9d046f51fe..ffe9679904bbc 100644
--- a/docs/docs/node-creation.md
+++ b/docs/docs/node-creation.md
@@ -8,7 +8,7 @@ A node is stored in redux under the `nodes` namespace, whose state is a map of t
## Sourcing Nodes
-The creation of nodes occurs primarily in the [sourceNodes](/docs/node-apis/#sourceNodes) bootstrap phase. Nodes created during this phase are top level nodes. I.e, they have no parent. This is represented by source plugins setting the node's `parent` field to `___SOURCE___`. Nodes created via transform plugins (who implement [onCreateNode](/docs/node-apis/#onCreateNode)) will have source nodes as their parents, or other transformed nodes. For a rough overview of what happens when source nodes run, see the [traceID illustration](/docs/how-plugins-apis-are-run/#using-traceid-to-await-downstream-api-calls).
+The creation of nodes occurs primarily in the [sourceNodes](/docs/node-apis/#sourceNodes) bootstrap phase. Nodes created during this phase are top level nodes. I.e, they have no parent. This is represented by source plugins setting the node's `parent` field to `null`. Nodes created via transform plugins (who implement [onCreateNode](/docs/node-apis/#onCreateNode)) will have source nodes as their parents, or other transformed nodes. For a rough overview of what happens when source nodes run, see the [traceID illustration](/docs/how-plugins-apis-are-run/#using-traceid-to-await-downstream-api-calls).
## Parent/Child/Refs
diff --git a/docs/docs/submit-to-plugin-library.md b/docs/docs/submit-to-plugin-library.md
index ba66e7cec3a25..009c3cb7b630a 100644
--- a/docs/docs/submit-to-plugin-library.md
+++ b/docs/docs/submit-to-plugin-library.md
@@ -2,13 +2,21 @@
title: Submit to Plugin Library
---
-#### Publishing a plugin to the library
+## Publishing a plugin to the library
-In order to add your plugin to the [Plugin Library](/plugins/), you need to publish a package to npm (learn how [here](https://docs.npmjs.com/getting-started/publishing-npm-packages)) with the [required files](#what-files-does-gatsby-look-for-in-a-plugin) and **include a `keywords` field** to `package.json` containing `gatsby` and `gatsby-plugin`.
+In order to add your plugin to the [Plugin Library](/plugins/), you need to:
+
+1. publish a package to npm (learn how [here](https://docs.npmjs.com/getting-started/publishing-npm-packages)),
+2. include the [required files](/docs/plugin-authoring/#what-files-does-gatsby-look-for-in-a-plugin) in your plugin code,
+3. and **include a `keywords` field** in your plugin's `package.json`, containing `gatsby` and `gatsby-plugin`.
After doing so, Algolia will take up to 12 hours to add it to the library search index (the exact time necessary is still unknown), and wait for the daily rebuild of https://gatsbyjs.org to automatically include your plugin page to the website. Then, all you have to do is share your wonderful plugin with the community!
-**NOTE:** You can include other _relevant_ keywords to your `package.json` file to help interested users in finding it. As an example, a Markdown MathJax transformer would include:
+## Notes
+
+### Keywords
+
+You can include other _relevant_ keywords to your `package.json` file to help interested users in finding it. As an example, a Markdown MathJax transformer would include:
```json:title=package.json
"keywords": [
@@ -19,3 +27,7 @@ After doing so, Algolia will take up to 12 hours to add it to the library search
"markdown",
]
```
+
+### Images
+
+If you include images in your plugin repo's README, please make sure you are referencing the image using an absolute URL in order for the image to show on your plugin page.
diff --git a/docs/sites.yml b/docs/sites.yml
index 5050732071650..c48d13922c190 100644
--- a/docs/sites.yml
+++ b/docs/sites.yml
@@ -2245,12 +2245,13 @@
main_url: https://www.peterkroyer.at/en/
url: https://www.peterkroyer.at/en/
description: >
- Freelance web designer / web developer based in Vienna, Austria.
+ Freelance web designer / web developer based in Vienna, Austria (Wien, Österreich).
categories:
- Agency
- Web Development
- Design
- Portfolio
+ - Freelance
built_by: Peter Kroyer
built_by_url: https://www.peterkroyer.at/
featured: false
@@ -3921,3 +3922,14 @@
built_by: Exposify
built_by_url: "https://www.exposify.de/"
featured: false
+- title: Steak Point
+ main_url: https://www.steakpoint.at/
+ url: https://www.steakpoint.at/
+ description: >
+ Steak Restaurant in Vienna, Austria (Wien, Österreich).
+ categories:
+ - Restaurant
+ - Food
+ built_by: Peter Kroyer
+ built_by_url: https://www.peterkroyer.at/
+ featured: false
diff --git a/docs/starters.yml b/docs/starters.yml
index 93b4cd43ca12b..fd2d853406bed 100644
--- a/docs/starters.yml
+++ b/docs/starters.yml
@@ -1571,3 +1571,20 @@
- Styled with Tachyons.
- Rich structured data on blog posts for SEO.
- Pagination and category pages.
+- url: https://gatsby-starter-styled.netlify.com/
+ repo: https://github.com/gregoralbrecht/gatsby-starter-styled
+ description: Yet another simple starter with Styled-System, Typography.js, SEO and Google Analytics.
+ tags:
+ - Styling:CSS-in-JS
+ - PWA
+ - SEO
+ features:
+ - Styled-Components
+ - Styled-System
+ - Rebass Grid
+ - Typography.js to easily set up font styles
+ - Google Analytics
+ - Prettier, ESLint & Stylelint
+ - SEO (meta tags and schema.org via JSON-LD)
+ - Offline support
+ - Web App Manifest
diff --git a/e2e-tests/development-runtime/content/2018-12-14-hello-world.md b/e2e-tests/development-runtime/content/2018-12-14-hello-world.md
index 7598fd3256790..bdedb261138b7 100644
--- a/e2e-tests/development-runtime/content/2018-12-14-hello-world.md
+++ b/e2e-tests/development-runtime/content/2018-12-14-hello-world.md
@@ -6,3 +6,5 @@ date: 2018-12-14
This is a truly meaningful blog post
%SUB_TITLE%
+
+%SUBCACHE_VALUE%
diff --git a/e2e-tests/development-runtime/cypress/integration/functionality/sub-plugin-caching.js b/e2e-tests/development-runtime/cypress/integration/functionality/sub-plugin-caching.js
new file mode 100644
index 0000000000000..f45df00a8a5f3
--- /dev/null
+++ b/e2e-tests/development-runtime/cypress/integration/functionality/sub-plugin-caching.js
@@ -0,0 +1,16 @@
+/*
+ * This e2e test validates that the cache structure
+ * is unique per plugin (even sub-plugins)
+ * and can interact between Gatsby lifecycles and a plugin
+ */
+describe(`sub-plugin caching`, () => {
+ beforeEach(() => {
+ cy.visit(`/2018-12-14-hello-world/`).waitForAPI(`onRouteUpdate`)
+ })
+
+ it(`has access to custom sub-plugin cache`, () => {
+ cy.getTestElement(`gatsby-remark-subcache-value`)
+ .invoke(`text`)
+ .should(`eq`, `Hello World`)
+ })
+})
diff --git a/e2e-tests/development-runtime/gatsby-config.js b/e2e-tests/development-runtime/gatsby-config.js
index e229721485cea..07d6209963039 100644
--- a/e2e-tests/development-runtime/gatsby-config.js
+++ b/e2e-tests/development-runtime/gatsby-config.js
@@ -24,7 +24,7 @@ module.exports = {
{
resolve: `gatsby-transformer-remark`,
options: {
- plugins: [],
+ plugins: [`gatsby-remark-subcache`],
},
},
`gatsby-plugin-sharp`,
diff --git a/e2e-tests/development-runtime/package.json b/e2e-tests/development-runtime/package.json
index f3dc3285df795..c2a65599ab1f8 100644
--- a/e2e-tests/development-runtime/package.json
+++ b/e2e-tests/development-runtime/package.json
@@ -4,7 +4,7 @@
"version": "1.0.0",
"author": "Dustin Schau ",
"dependencies": {
- "gatsby": "^2.0.71",
+ "gatsby": "^2.0.88",
"gatsby-image": "^2.0.20",
"gatsby-plugin-manifest": "^2.0.9",
"gatsby-plugin-offline": "^2.0.20",
@@ -29,7 +29,7 @@
"serve": "gatsby serve",
"start": "npm run develop",
"format": "prettier --write \"src/**/*.js\"",
- "test": "npm run start-server-and-test || npm run reset",
+ "test": "npm run start-server-and-test || (npm run reset && exit 1)",
"posttest": "npm run reset",
"reset": "node scripts/reset.js",
"update": "node scripts/update.js",
diff --git a/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/constants.js b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/constants.js
new file mode 100644
index 0000000000000..426ce562fdafa
--- /dev/null
+++ b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/constants.js
@@ -0,0 +1 @@
+exports.id = `gatsby-remark-subcache-value`
diff --git a/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/gatsby-node.js b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/gatsby-node.js
new file mode 100644
index 0000000000000..0c7d3f4524705
--- /dev/null
+++ b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/gatsby-node.js
@@ -0,0 +1,5 @@
+const { id } = require(`./constants`)
+
+exports.onPreBootstrap = async ({ cache }) => {
+ await cache.set(id, `Hello World`)
+}
diff --git a/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/index.js b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/index.js
new file mode 100644
index 0000000000000..57a1f51e598e9
--- /dev/null
+++ b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/index.js
@@ -0,0 +1,11 @@
+const visit = require(`unist-util-visit`)
+const { id } = require(`./constants`)
+
+module.exports = function remarkPlugin({ cache, markdownAST }) {
+ visit(markdownAST, `html`, async node => {
+ if (node.value.match(id)) {
+ const value = await cache.get(id)
+ node.value = node.value.replace(/%SUBCACHE_VALUE%/, value)
+ }
+ })
+}
diff --git a/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/package.json b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/package.json
new file mode 100644
index 0000000000000..58b61fbeea21a
--- /dev/null
+++ b/e2e-tests/development-runtime/plugins/gatsby-remark-subcache/package.json
@@ -0,0 +1,3 @@
+{
+ "name": "gatsby-remark-subcache"
+}
diff --git a/e2e-tests/production-runtime/cypress/integration/global-styles.js b/e2e-tests/production-runtime/cypress/integration/global-styles.js
new file mode 100644
index 0000000000000..01e8cf0147b06
--- /dev/null
+++ b/e2e-tests/production-runtime/cypress/integration/global-styles.js
@@ -0,0 +1,19 @@
+const zIndex = `9001`
+
+describe(`Global style from gatsby-browser.js`, () => {
+ beforeEach(() => {
+ cy.visit(`/global-style`).waitForAPI(`onRouteUpdate`)
+ })
+
+ it(`should apply any styles in root gatsby-browser.js`, () => {
+ cy.getTestElement(`global-style`).should(`have.css`, `zIndex`, zIndex)
+ })
+
+ it(`should apply any styles in plugin(s) gatsby-browser.js`, () => {
+ cy.getTestElement(`global-plugin-style`).should(
+ `have.css`,
+ `zIndex`,
+ zIndex
+ )
+ })
+})
diff --git a/e2e-tests/production-runtime/gatsby-browser.js b/e2e-tests/production-runtime/gatsby-browser.js
index 49618a228a63b..754585f14bc5b 100644
--- a/e2e-tests/production-runtime/gatsby-browser.js
+++ b/e2e-tests/production-runtime/gatsby-browser.js
@@ -1,3 +1,5 @@
+require(`./src/index.css`)
+
if (typeof window !== `undefined`) {
window.___PageComponentLifecycleCallsLog = []
}
diff --git a/e2e-tests/production-runtime/gatsby-config.js b/e2e-tests/production-runtime/gatsby-config.js
index 28003b68ca2d9..628889e7eb4fe 100644
--- a/e2e-tests/production-runtime/gatsby-config.js
+++ b/e2e-tests/production-runtime/gatsby-config.js
@@ -4,6 +4,7 @@ module.exports = {
},
plugins: [
`gatsby-plugin-react-helmet`,
+ `gatsby-plugin-global-style`,
{
resolve: `gatsby-plugin-manifest`,
options: {
diff --git a/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/gatsby-browser.js b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/gatsby-browser.js
new file mode 100644
index 0000000000000..d2ad33db97241
--- /dev/null
+++ b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/gatsby-browser.js
@@ -0,0 +1 @@
+import './index.css'
diff --git a/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.css b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.css
new file mode 100644
index 0000000000000..97451b4e5cbf3
--- /dev/null
+++ b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.css
@@ -0,0 +1,4 @@
+[data-testid='global-plugin-style'] {
+ position: relative;
+ z-index: 9001; /* it's over 9000 */
+}
diff --git a/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.js b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.js
new file mode 100644
index 0000000000000..172f1ae6a468c
--- /dev/null
+++ b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.js
@@ -0,0 +1 @@
+// noop
diff --git a/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/package.json b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/package.json
new file mode 100644
index 0000000000000..89369ec73dec1
--- /dev/null
+++ b/e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/package.json
@@ -0,0 +1,3 @@
+{
+ "name": "gatsby-plugin-global-style"
+}
diff --git a/e2e-tests/production-runtime/src/index.css b/e2e-tests/production-runtime/src/index.css
new file mode 100644
index 0000000000000..3dd94c1862014
--- /dev/null
+++ b/e2e-tests/production-runtime/src/index.css
@@ -0,0 +1,4 @@
+[data-testid='global-style'] {
+ position: relative;
+ z-index: 9001; /* it's over 9000 */
+}
diff --git a/e2e-tests/production-runtime/src/pages/global-style.js b/e2e-tests/production-runtime/src/pages/global-style.js
new file mode 100644
index 0000000000000..0b83a1bba6bf4
--- /dev/null
+++ b/e2e-tests/production-runtime/src/pages/global-style.js
@@ -0,0 +1,16 @@
+import React from 'react'
+
+import Layout from '../components/layout'
+
+const GlobalStyle = () => (
+
+
+ This text should have a large z-index (via `gatsby-plugin-global-style`)
+
+
+ This text should have a large z-index (via root-level `gatsby-browser.js`)
+
+
+)
+
+export default GlobalStyle
diff --git a/e2e-tests/production-runtime/src/pages/index.js b/e2e-tests/production-runtime/src/pages/index.js
index 6986ba9ec71ce..806c854bc41de 100644
--- a/e2e-tests/production-runtime/src/pages/index.js
+++ b/e2e-tests/production-runtime/src/pages/index.js
@@ -34,6 +34,11 @@ const IndexPage = ({ pageContext }) => (
Client only paths
+
+
+ gatsby-browser.js (global styles)
+
+
)
diff --git a/examples/using-unstructured-data/.gitignore b/examples/using-gatsby-without-graphql/.gitignore
similarity index 100%
rename from examples/using-unstructured-data/.gitignore
rename to examples/using-gatsby-without-graphql/.gitignore
diff --git a/examples/using-unstructured-data/LICENSE b/examples/using-gatsby-without-graphql/LICENSE
similarity index 100%
rename from examples/using-unstructured-data/LICENSE
rename to examples/using-gatsby-without-graphql/LICENSE
diff --git a/examples/using-unstructured-data/README.md b/examples/using-gatsby-without-graphql/README.md
similarity index 58%
rename from examples/using-unstructured-data/README.md
rename to examples/using-gatsby-without-graphql/README.md
index e8a9104fc1db1..f631b4a4ec8aa 100755
--- a/examples/using-unstructured-data/README.md
+++ b/examples/using-gatsby-without-graphql/README.md
@@ -1,6 +1,6 @@
-# Using unstructured data in Gatsby
+# Using Gatsby without GraphQL
-Many examples in the Gatsby docs focus on using source plugins. But you don’t need to use source plugins (or create Gatsby nodes) to pull data into a Gatsby site! This example uses "unstructured data", or data "handled outside of the Gatsby data layer". It uses the data directly, and does not transform the data into Gatsby nodes.
+Many examples in the Gatsby docs focus on using source plugins to pull data into Gatsby's GraphQL data layer. But you don’t need to use source plugins (or create Gatsby nodes) to pull data into a Gatsby site! This example uses "unstructured data", or data "handled outside of the Gatsby data layer". It uses the data directly, and does not transform the data into Gatsby nodes.
This example loads data from the [PokéAPI](https://www.pokeapi.co/)’s REST endpoints, then creates pages (and nested pages) using [Gatsby’s `createPages` API](https://www.gatsbyjs.org/docs/node-apis/#createPages).
@@ -8,4 +8,4 @@ You might also be interested in this [blog post on unstructured data](/blog/2018
## What would this look like using Gatsby's GraphQL integration layer?
-This example site is also intended as a direct comparison to the [using-local-plugins](../using-local-plugins) example, which take the exact same example, but shows how to use Gatsby's GraphQL layer, instead of using "unstructured data".
+This example site is also intended as a direct comparison to the [using-local-plugins](../using-local-plugins) example, which take the exact same example, but shows how to use Gatsby's GraphQL layer, instead of using "unstructured data" (without GraphQL).
diff --git a/examples/using-unstructured-data/gatsby-node.js b/examples/using-gatsby-without-graphql/gatsby-node.js
similarity index 100%
rename from examples/using-unstructured-data/gatsby-node.js
rename to examples/using-gatsby-without-graphql/gatsby-node.js
diff --git a/examples/using-unstructured-data/package.json b/examples/using-gatsby-without-graphql/package.json
similarity index 100%
rename from examples/using-unstructured-data/package.json
rename to examples/using-gatsby-without-graphql/package.json
diff --git a/examples/using-unstructured-data/src/templates/ability.js b/examples/using-gatsby-without-graphql/src/templates/ability.js
similarity index 100%
rename from examples/using-unstructured-data/src/templates/ability.js
rename to examples/using-gatsby-without-graphql/src/templates/ability.js
diff --git a/examples/using-unstructured-data/src/templates/all-pokemon.js b/examples/using-gatsby-without-graphql/src/templates/all-pokemon.js
similarity index 100%
rename from examples/using-unstructured-data/src/templates/all-pokemon.js
rename to examples/using-gatsby-without-graphql/src/templates/all-pokemon.js
diff --git a/examples/using-unstructured-data/src/templates/pokemon.js b/examples/using-gatsby-without-graphql/src/templates/pokemon.js
similarity index 100%
rename from examples/using-unstructured-data/src/templates/pokemon.js
rename to examples/using-gatsby-without-graphql/src/templates/pokemon.js
diff --git a/packages/gatsby-plugin-google-analytics/CHANGELOG.md b/packages/gatsby-plugin-google-analytics/CHANGELOG.md
index dea65e41ee3f0..a29a5dd6cf3f9 100644
--- a/packages/gatsby-plugin-google-analytics/CHANGELOG.md
+++ b/packages/gatsby-plugin-google-analytics/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.0.9](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics/compare/gatsby-plugin-google-analytics@2.0.8...gatsby-plugin-google-analytics@2.0.9) (2019-01-08)
+
+### Features
+
+- **gatsby-plugin-google-analytics:** add support for google optimize experiment and variation id ([#10903](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics/issues/10903)) ([45ec012](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics/commit/45ec012))
+
## [2.0.8](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics/compare/gatsby-plugin-google-analytics@2.0.7...gatsby-plugin-google-analytics@2.0.8) (2018-11-29)
diff --git a/packages/gatsby-plugin-google-analytics/README.md b/packages/gatsby-plugin-google-analytics/README.md
index cc2130e35c736..718aa6640734f 100644
--- a/packages/gatsby-plugin-google-analytics/README.md
+++ b/packages/gatsby-plugin-google-analytics/README.md
@@ -26,6 +26,10 @@ module.exports = {
exclude: ["/preview/**", "/do-not-track/me/too/"],
// Enables Google Optimize using your container Id
optimizeId: "YOUR_GOOGLE_OPTIMIZE_TRACKING_ID",
+ // Enables Google Optimize Experiment ID
+ experimentId: "YOUR_GOOGLE_EXPERIMENT_ID",
+ // Set Variation ID. 0 for original 1,2,3....
+ variationId: "YOUR_GOOGLE_OPTIMIZE_VARIATION_ID"
// Any additional create only fields (optional)
sampleRate: 5,
siteSpeedSampleRate: 10,
@@ -92,6 +96,14 @@ If you need to exclude any path from the tracking system, you can add it (one or
If you need to use Google Optimize for A/B testing, you can add this optional Optimize container id to allow Google Optimize to load the correct test parameters for your site.
+## The "experimentId" option
+
+If you need to setup SERVER_SIDE Google Optimize experiment, you can add the experiment ID. The experiment ID is shown on the right-hand panel on the experiment details page. [Server-side Experiments](https://developers.google.com/optimize/devguides/experiments)
+
+## The "variationId" option
+
+Besides the experiment ID you also need the variation ID for SERVER_SIDE experiments in Google Optimize. Set 0 for original version.
+
## Create Only Fields
This plugin supports all optional Create Only Fields documented in [Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#create):
diff --git a/packages/gatsby-plugin-google-analytics/package.json b/packages/gatsby-plugin-google-analytics/package.json
index 06e65ec5eef4e..d19e8452dbb4b 100644
--- a/packages/gatsby-plugin-google-analytics/package.json
+++ b/packages/gatsby-plugin-google-analytics/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-plugin-google-analytics",
"description": "Gatsby plugin to add google analytics onto a site",
- "version": "2.0.8",
+ "version": "2.0.9",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js b/packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js
index 7ac17088f73a4..9edd7a816200a 100644
--- a/packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js
+++ b/packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js
@@ -87,6 +87,16 @@ exports.onRenderBody = (
typeof pluginOptions.optimizeId !== `undefined`
? `ga('require', '${pluginOptions.optimizeId}');`
: ``
+ }
+ ${
+ typeof pluginOptions.experimentId !== `undefined`
+ ? `ga('set', 'expId', '${pluginOptions.experimentId}');`
+ : ``
+ }
+ ${
+ typeof pluginOptions.variationId !== `undefined`
+ ? `ga('set', 'expVar', '${pluginOptions.variationId}');`
+ : ``
}}
`,
}}
diff --git a/packages/gatsby-source-contentful/README.md b/packages/gatsby-source-contentful/README.md
index c526b82108e39..5ba1a59a9834b 100644
--- a/packages/gatsby-source-contentful/README.md
+++ b/packages/gatsby-source-contentful/README.md
@@ -171,6 +171,28 @@ Querying a **single** `CaseStudy` node with the ShortText properties `title` and
}
```
+#### Duplicated entries
+
+When Contentful pulls the data, all localizations will be pulled. Therefore, if you have a localization active, it will duplicate the entries. Narrow the search by filtering the query with `node_locale` filter:
+
+```graphql
+{
+ allContentfulCaseStudy(filter: { node_locale: { eq: "en-US" } }) {
+ edges {
+ node {
+ id
+ slug
+ title
+ subtitle
+ body {
+ body
+ }
+ }
+ }
+ }
+}
+```
+
### Query for Assets in ContentType nodes
More typically your `Asset` nodes will be mixed inside of your `ContentType` nodes, so you'll query them together. All the same formatting rules for `Asset` and `ContentType` nodes apply.
diff --git a/packages/gatsby-source-drupal/CHANGELOG.md b/packages/gatsby-source-drupal/CHANGELOG.md
index 28a35bcb5e291..99a45558c4424 100644
--- a/packages/gatsby-source-drupal/CHANGELOG.md
+++ b/packages/gatsby-source-drupal/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [3.0.15](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-drupal/compare/gatsby-source-drupal@3.0.14...gatsby-source-drupal@3.0.15) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-source-drupal
+
## [3.0.14](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-drupal/compare/gatsby-source-drupal@3.0.13...gatsby-source-drupal@3.0.14) (2018-12-11)
diff --git a/packages/gatsby-source-drupal/package.json b/packages/gatsby-source-drupal/package.json
index bd011616bcca3..7781d23225ffd 100644
--- a/packages/gatsby-source-drupal/package.json
+++ b/packages/gatsby-source-drupal/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-drupal",
"description": "Gatsby source plugin for building websites using the Drupal CMS as a data source",
- "version": "3.0.14",
+ "version": "3.0.15",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -10,7 +10,7 @@
"@babel/runtime": "^7.0.0",
"axios": "^0.18.0",
"bluebird": "^3.5.0",
- "gatsby-source-filesystem": "^2.0.12",
+ "gatsby-source-filesystem": "^2.0.13",
"lodash": "^4.17.10"
},
"devDependencies": {
diff --git a/packages/gatsby-source-filesystem/CHANGELOG.md b/packages/gatsby-source-filesystem/CHANGELOG.md
index 4bd2a03238844..0f661db670004 100644
--- a/packages/gatsby-source-filesystem/CHANGELOG.md
+++ b/packages/gatsby-source-filesystem/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.0.13](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/compare/gatsby-source-filesystem@2.0.12...gatsby-source-filesystem@2.0.13) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-source-filesystem
+
## [2.0.12](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem/compare/gatsby-source-filesystem@2.0.11...gatsby-source-filesystem@2.0.12) (2018-12-11)
diff --git a/packages/gatsby-source-filesystem/package.json b/packages/gatsby-source-filesystem/package.json
index 222bc72d0a6c0..89b6adc3840d6 100644
--- a/packages/gatsby-source-filesystem/package.json
+++ b/packages/gatsby-source-filesystem/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-filesystem",
"description": "Gatsby plugin which parses files within a directory for further parsing by other plugins",
- "version": "2.0.12",
+ "version": "2.0.13",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-source-filesystem/src/create-file-node.js b/packages/gatsby-source-filesystem/src/create-file-node.js
index 535620c56200a..3db6fcadd8483 100644
--- a/packages/gatsby-source-filesystem/src/create-file-node.js
+++ b/packages/gatsby-source-filesystem/src/create-file-node.js
@@ -57,7 +57,7 @@ exports.createFileNode = async (
// useful information.
id: createNodeId(pathToFile),
children: [],
- parent: `___SOURCE___`,
+ parent: null,
internal,
sourceInstanceName: pluginOptions.name || `__PROGRAMMATIC__`,
absolutePath: slashedFile.absolutePath,
diff --git a/packages/gatsby-source-shopify/CHANGELOG.md b/packages/gatsby-source-shopify/CHANGELOG.md
index 8f9b111f89790..2afee70b7e36d 100644
--- a/packages/gatsby-source-shopify/CHANGELOG.md
+++ b/packages/gatsby-source-shopify/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.0.4](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-shopify/compare/gatsby-source-shopify@2.0.3...gatsby-source-shopify@2.0.4) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-source-shopify
+
## 2.0.3 (2018-12-21)
diff --git a/packages/gatsby-source-shopify/package.json b/packages/gatsby-source-shopify/package.json
index dc5d1e2eba44c..b9bf0810ea5bb 100644
--- a/packages/gatsby-source-shopify/package.json
+++ b/packages/gatsby-source-shopify/package.json
@@ -1,6 +1,6 @@
{
"name": "gatsby-source-shopify",
- "version": "2.0.3",
+ "version": "2.0.4",
"description": "Gatsby source plugin for building websites using Shopfiy as a data source.",
"scripts": {
"build": "babel src --out-dir .",
@@ -32,7 +32,7 @@
"babel-preset-gatsby-package": "^0.1.3",
"chalk": "^2.4.1",
"gatsby-node-helpers": "^0.3.0",
- "gatsby-source-filesystem": "^2.0.5",
+ "gatsby-source-filesystem": "^2.0.13",
"graphql-request": "^1.6.0",
"lodash": "^4.17.4",
"p-iteration": "^1.1.7",
diff --git a/packages/gatsby-source-wordpress/CHANGELOG.md b/packages/gatsby-source-wordpress/CHANGELOG.md
index e16b6160808f7..ada3691e225b8 100644
--- a/packages/gatsby-source-wordpress/CHANGELOG.md
+++ b/packages/gatsby-source-wordpress/CHANGELOG.md
@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [3.0.22](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress/compare/gatsby-source-wordpress@3.0.21...gatsby-source-wordpress@3.0.22) (2019-01-08)
+
+### Bug Fixes
+
+- **gatsby-source-wordpress:** add a check for namespaces in response from wp ([#10891](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress/issues/10891)) ([d96016c](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress/commit/d96016c))
+- **gatsby-source-wordpress:** use correct glob pattern paths for routes ([#10887](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress/issues/10887)) ([c793419](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress/commit/c793419))
+
## [3.0.21](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress/compare/gatsby-source-wordpress@3.0.20...gatsby-source-wordpress@3.0.21) (2018-12-18)
diff --git a/packages/gatsby-source-wordpress/README.md b/packages/gatsby-source-wordpress/README.md
index c68624118b970..1e270f0bd4fda 100644
--- a/packages/gatsby-source-wordpress/README.md
+++ b/packages/gatsby-source-wordpress/README.md
@@ -117,16 +117,16 @@ module.exports = {
// all routes that begin with `yoast` from fetch.
// Whitelisted routes using glob patterns
includedRoutes: [
- "/*/*/categories",
- "/*/*/posts",
- "/*/*/pages",
- "/*/*/media",
- "/*/*/tags",
- "/*/*/taxonomies",
- "/*/*/users",
+ "**/*/*/categories",
+ "**/*/*/posts",
+ "**/*/*/pages",
+ "**/*/*/media",
+ "**/*/*/tags",
+ "**/*/*/taxonomies",
+ "**/*/*/users",
],
// Blacklisted routes using glob patterns
- excludedRoutes: ["/*/*/posts/1456"],
+ excludedRoutes: ["**/*/*/posts/1456"],
// use a custom normalizer which is applied after the built-in ones.
normalizer: function({ entities }) {
return entities
@@ -197,13 +197,13 @@ If an endpoint is whitelisted and not blacklisted, it will be fetched. Otherwise
```javascript
includedRoutes: [
- "/*/*/posts",
- "/*/*/pages",
- "/*/*/media",
- "/*/*/categories",
- "/*/*/tags",
- "/*/*/taxonomies",
- "/*/*/users",
+ "**/*/*/posts",
+ "**/*/*/pages",
+ "**/*/*/media",
+ "**/*/*/categories",
+ "**/*/*/tags",
+ "**/*/*/taxonomies",
+ "**/*/*/users",
],
```
diff --git a/packages/gatsby-source-wordpress/package.json b/packages/gatsby-source-wordpress/package.json
index 05c67ea39205e..6a77cbf9445da 100644
--- a/packages/gatsby-source-wordpress/package.json
+++ b/packages/gatsby-source-wordpress/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-source-wordpress",
"description": "Gatsby source plugin for building websites using the Wordpress CMS as a data source.",
- "version": "3.0.21",
+ "version": "3.0.22",
"author": "Sebastien Fichot ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -14,7 +14,7 @@
"bluebird": "^3.5.0",
"deep-map": "^1.5.0",
"deep-map-keys": "^1.2.0",
- "gatsby-source-filesystem": "^2.0.12",
+ "gatsby-source-filesystem": "^2.0.13",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.10",
"minimatch": "^3.0.4",
diff --git a/packages/gatsby-source-wordpress/src/fetch.js b/packages/gatsby-source-wordpress/src/fetch.js
index c36612e745e69..b77af79cadd29 100644
--- a/packages/gatsby-source-wordpress/src/fetch.js
+++ b/packages/gatsby-source-wordpress/src/fetch.js
@@ -445,9 +445,9 @@ function getValidRoutes({
if (_useACF) {
let defaultAcfNamespace = `acf/v3`
// Grab ACF Version from namespaces
- const acfNamespace = allRoutes.data.namespaces.find(namespace =>
- namespace.includes(`acf`)
- )
+ const acfNamespace = allRoutes.data.namespaces
+ ? allRoutes.data.namespaces.find(namespace => namespace.includes(`acf`))
+ : null
const acfRestNamespace = acfNamespace ? acfNamespace : defaultAcfNamespace
_includedRoutes.push(`/${acfRestNamespace}/**`)
diff --git a/packages/gatsby-transformer-csv/CHANGELOG.md b/packages/gatsby-transformer-csv/CHANGELOG.md
index b60981020a9f1..1c54119b0cabe 100644
--- a/packages/gatsby-transformer-csv/CHANGELOG.md
+++ b/packages/gatsby-transformer-csv/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.0.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-csv/compare/gatsby-transformer-csv@2.0.5...gatsby-transformer-csv@2.0.6) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-csv
+
## [2.0.5](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-csv/compare/gatsby-transformer-csv@2.0.4...gatsby-transformer-csv@2.0.5) (2018-11-29)
diff --git a/packages/gatsby-transformer-csv/package.json b/packages/gatsby-transformer-csv/package.json
index eee0dd9498fb0..dd9d88cd7d323 100644
--- a/packages/gatsby-transformer-csv/package.json
+++ b/packages/gatsby-transformer-csv/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-csv",
"description": "Gatsby transformer plugin for CSV files",
- "version": "2.0.5",
+ "version": "2.0.6",
"author": "Sonal Saldanha ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap
index 876a82914a97d..b42b670c9e4be 100644
--- a/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-csv/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -58,7 +58,7 @@ false,\\"nope\\"",
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -87,7 +87,7 @@ false,\\"nope\\"",
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -165,7 +165,7 @@ false,nope",
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -194,7 +194,7 @@ false,nope",
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -223,7 +223,7 @@ false,nope",
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js
index 5cf7bd33dbfac..0dadd5ac6b9f3 100644
--- a/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js
@@ -6,7 +6,7 @@ const { onCreateNode } = require(`../gatsby-node`)
describe(`Process nodes correctly`, () => {
const node = {
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
extension: `csv`,
internal: {
diff --git a/packages/gatsby-transformer-excel/CHANGELOG.md b/packages/gatsby-transformer-excel/CHANGELOG.md
index 15854b6ede1a8..2fc67407cbcc3 100644
--- a/packages/gatsby-transformer-excel/CHANGELOG.md
+++ b/packages/gatsby-transformer-excel/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.1.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-excel/compare/gatsby-transformer-excel@2.1.5...gatsby-transformer-excel@2.1.6) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-excel
+
## [2.1.5](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-excel/compare/gatsby-transformer-excel@2.1.4...gatsby-transformer-excel@2.1.5) (2018-12-29)
diff --git a/packages/gatsby-transformer-excel/package.json b/packages/gatsby-transformer-excel/package.json
index 0820d6203088c..2bff870dad679 100644
--- a/packages/gatsby-transformer-excel/package.json
+++ b/packages/gatsby-transformer-excel/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-excel",
"description": "Gatsby transformer plugin for Excel spreadsheets",
- "version": "2.1.5",
+ "version": "2.1.6",
"author": "SheetJS ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap
index 6a7d83c0e7e02..5c31be92a58dd 100644
--- a/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-excel/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -70,7 +70,7 @@ FALSE,nope
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -100,7 +100,7 @@ FALSE,nope
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -128,7 +128,7 @@ FALSE,nope
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -205,7 +205,7 @@ FALSE,nada
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -235,7 +235,7 @@ FALSE,nada
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -263,7 +263,7 @@ FALSE,nada
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -340,7 +340,7 @@ FALSE,nada
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -370,7 +370,7 @@ FALSE,nada
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -398,7 +398,7 @@ FALSE,nada
"mediaType": "text/csv",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js
index ba878f2429394..00ccf2b0e50ce 100644
--- a/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-excel/src/__tests__/gatsby-node.js
@@ -6,7 +6,7 @@ const { onCreateNode } = require(`../gatsby-node`)
describe(`Process nodes correctly`, () => {
const node = {
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
extension: `csv`,
internal: {
diff --git a/packages/gatsby-transformer-hjson/CHANGELOG.md b/packages/gatsby-transformer-hjson/CHANGELOG.md
index 19e2a92d84277..50fa23e832aff 100644
--- a/packages/gatsby-transformer-hjson/CHANGELOG.md
+++ b/packages/gatsby-transformer-hjson/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.1.4](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-hjson/compare/gatsby-transformer-hjson@2.1.3...gatsby-transformer-hjson@2.1.4) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-hjson
+
## [2.1.3](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-hjson/compare/gatsby-transformer-hjson@2.1.2...gatsby-transformer-hjson@2.1.3) (2018-11-29)
diff --git a/packages/gatsby-transformer-hjson/package.json b/packages/gatsby-transformer-hjson/package.json
index b0e45bd545237..e1030e80b78d5 100644
--- a/packages/gatsby-transformer-hjson/package.json
+++ b/packages/gatsby-transformer-hjson/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-hjson",
"description": "Gatsby transformer plugin for HJSON files",
- "version": "2.1.3",
+ "version": "2.1.4",
"author": "Remi Barraquand ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap
index 874e9cdd8605e..3b3f9c0945aeb 100644
--- a/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-hjson/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -48,7 +48,7 @@ Array [
"name": "test",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -121,7 +121,7 @@ Array [
"name": "test",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -158,7 +158,7 @@ Array [
"name": "test",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js
index f631ab236f4fd..eccbcb21b434f 100644
--- a/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-hjson/src/__tests__/gatsby-node.js
@@ -7,7 +7,7 @@ describe(`Process HJSON nodes correctly`, () => {
const node = {
name: `nodeName`,
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
contentDigest: `whatever`,
diff --git a/packages/gatsby-transformer-json/CHANGELOG.md b/packages/gatsby-transformer-json/CHANGELOG.md
index 5c84c8fd668ca..5f11254e4c096 100644
--- a/packages/gatsby-transformer-json/CHANGELOG.md
+++ b/packages/gatsby-transformer-json/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.1.7](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-json/compare/gatsby-transformer-json@2.1.6...gatsby-transformer-json@2.1.7) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-json
+
## [2.1.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-json/compare/gatsby-transformer-json@2.1.5...gatsby-transformer-json@2.1.6) (2018-11-29)
diff --git a/packages/gatsby-transformer-json/package.json b/packages/gatsby-transformer-json/package.json
index 33844b1771e47..7b7bf795dd0d6 100644
--- a/packages/gatsby-transformer-json/package.json
+++ b/packages/gatsby-transformer-json/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-json",
"description": "Gatsby transformer plugin for JSON files",
- "version": "2.1.6",
+ "version": "2.1.7",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap
index aac7bfaf3455d..f948c87169a13 100644
--- a/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-json/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -44,7 +44,7 @@ Array [
"type": "File",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -93,7 +93,7 @@ Array [
"mediaType": "application/json",
"type": "NotFile",
},
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -157,7 +157,7 @@ Array [
"type": "File",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -185,7 +185,7 @@ Array [
"type": "File",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -247,7 +247,7 @@ Array [
"mediaType": "application/json",
"type": "NotFile",
},
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -273,7 +273,7 @@ Array [
"mediaType": "application/json",
"type": "NotFile",
},
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js
index 65cd22546f02e..196f2f22eca22 100644
--- a/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-json/src/__tests__/gatsby-node.js
@@ -33,7 +33,7 @@ const bootstrapTest = async (node, pluginOptions = {}) => {
describe(`Process JSON nodes correctly`, () => {
const baseNode = {
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
contentDigest: `whatever`,
diff --git a/packages/gatsby-transformer-remark/CHANGELOG.md b/packages/gatsby-transformer-remark/CHANGELOG.md
index 54520c741c82a..2b9485fb303dd 100644
--- a/packages/gatsby-transformer-remark/CHANGELOG.md
+++ b/packages/gatsby-transformer-remark/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+# [2.2.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/compare/gatsby-transformer-remark@2.1.20...gatsby-transformer-remark@2.2.0) (2019-01-08)
+
+### Bug Fixes
+
+- **gatsby-transformer-remark:** correctly pass cache to sub plugins ([#10892](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/issues/10892)) ([8ea9a52](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/commit/8ea9a52))
+
+
+
+## [2.1.20](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/compare/gatsby-transformer-remark@2.1.19...gatsby-transformer-remark@2.1.20) (2019-01-08)
+
+### Bug Fixes
+
+- **gatsby-transformer-remark:** remove unused \_PARENT field from frontmatter ([#10919](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/issues/10919)) ([e831b42](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/commit/e831b42))
+
## [2.1.19](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark/compare/gatsby-transformer-remark@2.1.18...gatsby-transformer-remark@2.1.19) (2019-01-01)
diff --git a/packages/gatsby-transformer-remark/package.json b/packages/gatsby-transformer-remark/package.json
index 0af0144d0d081..d9a1b4177b48c 100644
--- a/packages/gatsby-transformer-remark/package.json
+++ b/packages/gatsby-transformer-remark/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-remark",
"description": "Gatsby transformer plugin for Markdown using the Remark library and ecosystem",
- "version": "2.1.19",
+ "version": "2.2.0",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -42,13 +42,12 @@
],
"license": "MIT",
"peerDependencies": {
- "gatsby": "^2.0.33"
+ "gatsby": "^2.0.88"
},
"repository": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark",
"scripts": {
"build": "babel src --out-dir . --ignore **/__tests__",
"prepare": "cross-env NODE_ENV=production npm run build",
"watch": "babel -w src --out-dir . --ignore **/__tests__"
- },
- "gitHead": "5bd5aebe066b9875354a81a4b9ed98722731c465"
+ }
}
diff --git a/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap
index 663f38f8d4a04..a7fe672e7411b 100644
--- a/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-remark/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -7,7 +7,6 @@ Array [
"children": Array [],
"excerpt": "",
"frontmatter": Object {
- "_PARENT": "whatever",
"date": "2017-09-18T23:19:51.246Z",
"title": "my little pony",
},
@@ -15,7 +14,7 @@ Array [
"internal": Object {
"content": "Where oh where is my little pony?
",
- "contentDigest": "e33e9489dc1352bfac2577e99155c1b3",
+ "contentDigest": "26a9a60af333645b5ca69261c7d9aa53",
"type": "MarkdownRemark",
},
"parent": "whatever",
@@ -34,7 +33,6 @@ Array [
"children": Array [],
"excerpt": "",
"frontmatter": Object {
- "_PARENT": "whatever",
"date": "2017-09-18T23:19:51.246Z",
"title": "my little pony",
},
@@ -42,7 +40,7 @@ Array [
"internal": Object {
"content": "Where oh where is my little pony?
",
- "contentDigest": "e33e9489dc1352bfac2577e99155c1b3",
+ "contentDigest": "26a9a60af333645b5ca69261c7d9aa53",
"type": "MarkdownRemark",
},
"parent": "whatever",
@@ -79,7 +77,6 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid
",
"frontmatter": Object {
- "_PARENT": "whatever",
"date": "2017-09-18T23:19:51.246Z",
"title": "my little pony",
},
@@ -97,7 +94,7 @@ Sed eu gravida mauris. Suspendisse potenti. Praesent sit amet egestas mi, sed he
Sed bibendum sem iaculis, pellentesque leo sed, imperdiet ante. Sed consequat mattis dui nec pretium. Donec vel consectetur est. Nam sagittis, libero vitae pretium pharetra, velit est dignissim erat, at cursus quam massa vitae ligula. Suspendisse potenti. In hac habitasse platea dictumst. Donec sit amet finibus justo. Mauris ante dolor, pulvinar vitae feugiat eu, rhoncus nec diam. In ut accumsan diam, faucibus fringilla odio. Nunc id ultricies turpis. Quisque justo quam, tristique sit amet interdum quis, facilisis at mi. Fusce porttitor vel sem ut condimentum. Praesent at libero congue, vulputate elit ut, rhoncus erat.
",
- "contentDigest": "e9f6c76d1bc3cb15f402ed2c24b815bd",
+ "contentDigest": "024ff0e6141e2121fe04090114c7535a",
"type": "MarkdownRemark",
},
"parent": "whatever",
@@ -130,7 +127,6 @@ In quis lectus sed eros efficitur luctus. Morbi tempor, nisl eget feugiat tincid
",
"frontmatter": Object {
- "_PARENT": "whatever",
"date": "2017-09-18T23:19:51.246Z",
"title": "my little pony",
},
@@ -148,7 +144,7 @@ Sed eu gravida mauris. Suspendisse potenti. Praesent sit amet egestas mi, sed he
Sed bibendum sem iaculis, pellentesque leo sed, imperdiet ante. Sed consequat mattis dui nec pretium. Donec vel consectetur est. Nam sagittis, libero vitae pretium pharetra, velit est dignissim erat, at cursus quam massa vitae ligula. Suspendisse potenti. In hac habitasse platea dictumst. Donec sit amet finibus justo. Mauris ante dolor, pulvinar vitae feugiat eu, rhoncus nec diam. In ut accumsan diam, faucibus fringilla odio. Nunc id ultricies turpis. Quisque justo quam, tristique sit amet interdum quis, facilisis at mi. Fusce porttitor vel sem ut condimentum. Praesent at libero congue, vulputate elit ut, rhoncus erat.
",
- "contentDigest": "e9f6c76d1bc3cb15f402ed2c24b815bd",
+ "contentDigest": "024ff0e6141e2121fe04090114c7535a",
"type": "MarkdownRemark",
},
"parent": "whatever",
diff --git a/packages/gatsby-transformer-remark/src/extend-node-type.js b/packages/gatsby-transformer-remark/src/extend-node-type.js
index a7ce94a0e83ee..198789d008596 100644
--- a/packages/gatsby-transformer-remark/src/extend-node-type.js
+++ b/packages/gatsby-transformer-remark/src/extend-node-type.js
@@ -62,6 +62,14 @@ const withPathPrefix = (url, pathPrefix) =>
// field's resolver is safe to run in another thread
const workerPlugin = `gatsby-transformer-remark`
+// TODO: remove this check with next major release
+const safeGetCache = ({ getCache, cache }) => id => {
+ if (!getCache) {
+ return cache
+ }
+ return getCache(id)
+}
+
/**
* Map that keeps track of generation of AST to not generate it multiple
* times in parallel.
@@ -71,7 +79,16 @@ const workerPlugin = `gatsby-transformer-remark`
const ASTPromiseMap = new Map()
module.exports = (
- { type, pathPrefix, getNode, getNodesByType, cache, reporter },
+ {
+ type,
+ pathPrefix,
+ getNode,
+ getNodesByType,
+ cache,
+ getCache: possibleGetCache,
+ reporter,
+ ...rest
+ },
pluginOptions
) => {
if (type.name !== `MarkdownRemark`) {
@@ -80,6 +97,8 @@ module.exports = (
pluginsCacheStr = pluginOptions.plugins.map(p => p.name).join(``)
pathPrefixCacheStr = pathPrefix || ``
+ const getCache = safeGetCache({ cache, getCache: possibleGetCache })
+
return new Promise((resolve, reject) => {
// Setup Remark.
const {
@@ -154,7 +173,9 @@ module.exports = (
files: fileNodes,
getNode,
reporter,
- cache,
+ cache: getCache(plugin.name),
+ getCache,
+ ...rest,
},
plugin.pluginOptions
)
@@ -223,7 +244,9 @@ module.exports = (
files: fileNodes,
pathPrefix,
reporter,
- cache,
+ cache: getCache(plugin.name),
+ getCache,
+ ...rest,
},
plugin.pluginOptions
)
diff --git a/packages/gatsby-transformer-remark/src/on-node-create.js b/packages/gatsby-transformer-remark/src/on-node-create.js
index 76b2931ca82ad..5b492e29f3c85 100644
--- a/packages/gatsby-transformer-remark/src/on-node-create.js
+++ b/packages/gatsby-transformer-remark/src/on-node-create.js
@@ -3,7 +3,7 @@ const crypto = require(`crypto`)
const _ = require(`lodash`)
module.exports = async function onCreateNode(
- { node, getNode, loadNodeContent, actions, createNodeId, reporter },
+ { node, loadNodeContent, actions, createNodeId, reporter },
pluginOptions
) {
const { createNode, createParentChildLink } = actions
@@ -45,7 +45,6 @@ module.exports = async function onCreateNode(
markdownNode.frontmatter = {
title: ``, // always include a title
...data.data,
- _PARENT: node.id,
}
markdownNode.excerpt = data.excerpt
diff --git a/packages/gatsby-transformer-toml/CHANGELOG.md b/packages/gatsby-transformer-toml/CHANGELOG.md
index aa4bd328c7d98..5a6ffcb3c8140 100644
--- a/packages/gatsby-transformer-toml/CHANGELOG.md
+++ b/packages/gatsby-transformer-toml/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.1.4](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-toml/compare/gatsby-transformer-toml@2.1.3...gatsby-transformer-toml@2.1.4) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-toml
+
## [2.1.3](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-toml/compare/gatsby-transformer-toml@2.1.2...gatsby-transformer-toml@2.1.3) (2018-11-29)
diff --git a/packages/gatsby-transformer-toml/package.json b/packages/gatsby-transformer-toml/package.json
index fdd739247ea87..ac0cdfef4a525 100644
--- a/packages/gatsby-transformer-toml/package.json
+++ b/packages/gatsby-transformer-toml/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-toml",
"description": "Gatsby transformer plugin for toml",
- "version": "2.1.3",
+ "version": "2.1.4",
"author": "Ruben Harutyunyan ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap
index 2521d1e0dcac2..b6e6833b5375b 100644
--- a/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-toml/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -97,7 +97,7 @@ Array [
"contentDigest": "whatever",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js
index e827bfed37104..973f3c6eda227 100644
--- a/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-toml/src/__tests__/gatsby-node.js
@@ -3,7 +3,7 @@ const { onCreateNode } = require(`../gatsby-node`)
describe(`Process TOML nodes correctly`, () => {
const node = {
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
extension: `toml`,
internal: {
diff --git a/packages/gatsby-transformer-xml/CHANGELOG.md b/packages/gatsby-transformer-xml/CHANGELOG.md
index 10c804ad936e5..36bcd7a1f75a3 100644
--- a/packages/gatsby-transformer-xml/CHANGELOG.md
+++ b/packages/gatsby-transformer-xml/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.0.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-xml/compare/gatsby-transformer-xml@2.0.5...gatsby-transformer-xml@2.0.6) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-xml
+
## [2.0.5](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-xml/compare/gatsby-transformer-xml@2.0.4...gatsby-transformer-xml@2.0.5) (2018-11-29)
diff --git a/packages/gatsby-transformer-xml/package.json b/packages/gatsby-transformer-xml/package.json
index b792431acdee5..4be0cf872e3ee 100644
--- a/packages/gatsby-transformer-xml/package.json
+++ b/packages/gatsby-transformer-xml/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-xml",
"description": "Gatsby plugin for parsing XML files. It supports also attributes",
- "version": "2.0.5",
+ "version": "2.0.6",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap
index c010cf273ace4..9c4cc7d0b7803 100644
--- a/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-xml/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -206,7 +206,7 @@ Array [
"name": "test",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -299,7 +299,7 @@ Array [
"name": "test",
},
"name": "nodeName",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js
index a289fa99c1a72..a72947048c67d 100644
--- a/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-xml/src/__tests__/gatsby-node.js
@@ -5,7 +5,7 @@ describe(`Process XML nodes correctly`, () => {
const node = {
name: `nodeName`,
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
contentDigest: `whatever`,
diff --git a/packages/gatsby-transformer-yaml/CHANGELOG.md b/packages/gatsby-transformer-yaml/CHANGELOG.md
index 9c79c40755c32..3c1ed90e47bb5 100644
--- a/packages/gatsby-transformer-yaml/CHANGELOG.md
+++ b/packages/gatsby-transformer-yaml/CHANGELOG.md
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.1.7](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-yaml/compare/gatsby-transformer-yaml@2.1.6...gatsby-transformer-yaml@2.1.7) (2019-01-08)
+
+**Note:** Version bump only for package gatsby-transformer-yaml
+
## [2.1.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-yaml/compare/gatsby-transformer-yaml@2.1.5...gatsby-transformer-yaml@2.1.6) (2018-11-29)
diff --git a/packages/gatsby-transformer-yaml/package.json b/packages/gatsby-transformer-yaml/package.json
index dc927c84d216c..bd666b8ad8857 100644
--- a/packages/gatsby-transformer-yaml/package.json
+++ b/packages/gatsby-transformer-yaml/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby-transformer-yaml",
"description": "Gatsby transformer plugin for yaml",
- "version": "2.1.6",
+ "version": "2.1.7",
"author": "Kyle Mathews ",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
diff --git a/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap
index 7d0aaca4536ed..1947753170918 100644
--- a/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap
+++ b/packages/gatsby-transformer-yaml/src/__tests__/__snapshots__/gatsby-node.js.snap
@@ -45,7 +45,7 @@ funny: yup
"mediaType": "text/yaml",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -111,7 +111,7 @@ Array [
"mediaType": "text/yaml",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
@@ -141,7 +141,7 @@ Array [
"mediaType": "text/yaml",
},
"name": "test",
- "parent": "SOURCE",
+ "parent": null,
},
},
],
diff --git a/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js b/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js
index a520ff27f3734..e9684ab61fda6 100644
--- a/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js
+++ b/packages/gatsby-transformer-yaml/src/__tests__/gatsby-node.js
@@ -6,7 +6,7 @@ const { onCreateNode } = require(`../gatsby-node`)
describe(`Process YAML nodes correctly`, () => {
const node = {
id: `whatever`,
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
contentDigest: `whatever`,
diff --git a/packages/gatsby/CHANGELOG.md b/packages/gatsby/CHANGELOG.md
index 69ebe49acff2a..4edc8740d26a0 100644
--- a/packages/gatsby/CHANGELOG.md
+++ b/packages/gatsby/CHANGELOG.md
@@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+
+## [2.0.89](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.0.88...gatsby@2.0.89) (2019-01-08)
+
+### Bug Fixes
+
+- **gatsby:** test plugin name to handle symlinks, rather than path ([#10835](https://github.com/gatsbyjs/gatsby/issues/10835)) ([f914607](https://github.com/gatsbyjs/gatsby/commit/f914607))
+
+
+
+## [2.0.88](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.0.87...gatsby@2.0.88) (2019-01-08)
+
+### Features
+
+- **gatsby:** provide a mechanism for plugins to use a named cache instance ([#10146](https://github.com/gatsbyjs/gatsby/issues/10146)) ([b9a8c00](https://github.com/gatsbyjs/gatsby/commit/b9a8c00))
+
+
+
+## [2.0.87](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.0.86...gatsby@2.0.87) (2019-01-08)
+
+### Bug Fixes
+
+- allow plugins to use gatsby-browser.js to load global styles, etc. ([#10845](https://github.com/gatsbyjs/gatsby/issues/10845)) ([33a3e61](https://github.com/gatsbyjs/gatsby/commit/33a3e61))
+
+
+
+## [2.0.86](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.0.85...gatsby@2.0.86) (2019-01-08)
+
+### Bug Fixes
+
+- fix SSL naming error caused by @ scoped package name in develop ([#10863](https://github.com/gatsbyjs/gatsby/issues/10863)) ([b5209b9](https://github.com/gatsbyjs/gatsby/commit/b5209b9))
+
## [2.0.85](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.0.84...gatsby@2.0.85) (2019-01-04)
diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json
index 29f23e1e495cd..afe92e8ec4353 100644
--- a/packages/gatsby/package.json
+++ b/packages/gatsby/package.json
@@ -1,7 +1,7 @@
{
"name": "gatsby",
"description": "Blazing fast modern site generator for React",
- "version": "2.0.85",
+ "version": "2.0.89",
"author": "Kyle Mathews ",
"bin": {
"gatsby": "./dist/bin/gatsby.js"
diff --git a/packages/gatsby/src/bootstrap/index.js b/packages/gatsby/src/bootstrap/index.js
index c6a95c6bca70d..6bbd034659475 100644
--- a/packages/gatsby/src/bootstrap/index.js
+++ b/packages/gatsby/src/bootstrap/index.js
@@ -284,10 +284,10 @@ module.exports = async (args: BootstrapArgs) => {
const envAPIs = plugin[`${env}APIs`]
- // Always include the site's gatsby-browser.js if it exists as it's
+ // Always include gatsby-browser.js files if they exists as they're
// a handy place to include global styles and other global imports.
try {
- if (env === `browser` && plugin.name === `default-site-plugin`) {
+ if (env === `browser`) {
return slash(
require.resolve(path.join(plugin.resolve, `gatsby-${env}`))
)
diff --git a/packages/gatsby/src/internal-plugins/internal-data-bridge/gatsby-node.js b/packages/gatsby/src/internal-plugins/internal-data-bridge/gatsby-node.js
index e7369142def92..7f134cebffd7c 100644
--- a/packages/gatsby/src/internal-plugins/internal-data-bridge/gatsby-node.js
+++ b/packages/gatsby/src/internal-plugins/internal-data-bridge/gatsby-node.js
@@ -53,7 +53,7 @@ exports.sourceNodes = ({ createContentDigest, actions, store }) => {
createNode({
...page,
id: createPageId(page.path),
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
type: `SitePage`,
@@ -68,7 +68,7 @@ exports.sourceNodes = ({ createContentDigest, actions, store }) => {
packageJson: transformPackageJson(
require(`${plugin.resolve}/package.json`)
),
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
contentDigest: createContentDigest(plugin),
@@ -98,7 +98,7 @@ exports.sourceNodes = ({ createContentDigest, actions, store }) => {
createNode({
...node,
id: `Site`,
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
contentDigest: createContentDigest(node),
@@ -138,7 +138,7 @@ exports.onCreatePage = ({ createContentDigest, page, actions }) => {
createNode({
...pageWithoutUpdated,
id: createPageId(page.path),
- parent: `SOURCE`,
+ parent: null,
children: [],
internal: {
type: `SitePage`,
diff --git a/packages/gatsby/src/internal-plugins/query-runner/__tests__/query-compiler.js b/packages/gatsby/src/internal-plugins/query-runner/__tests__/query-compiler.js
index 6da385f8dde73..8c141076dd37a 100644
--- a/packages/gatsby/src/internal-plugins/query-runner/__tests__/query-compiler.js
+++ b/packages/gatsby/src/internal-plugins/query-runner/__tests__/query-compiler.js
@@ -68,7 +68,12 @@ describe(`resolveThemes`, () => {
it(`returns empty array if zero themes detected`, () => {
;[
[],
- [{ resolve: path.join(base, `gatsby-plugin-whatever`) }],
+ [
+ {
+ name: `gatsby-plugin-whatever`,
+ resolve: path.join(base, `gatsby-plugin-whatever`),
+ },
+ ],
undefined,
].forEach(testRun => {
expect(resolveThemes(testRun)).toEqual([])
@@ -80,6 +85,7 @@ describe(`resolveThemes`, () => {
expect(
resolveThemes([
{
+ name: theme,
resolve: path.join(base, `gatsby-theme-example`),
},
])
@@ -92,6 +98,7 @@ describe(`resolveThemes`, () => {
expect(
resolveThemes([
{
+ name: theme,
resolve: path.join(base, theme),
},
])
diff --git a/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js b/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js
index 002a888a50419..345f550be5289 100644
--- a/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js
+++ b/packages/gatsby/src/internal-plugins/query-runner/query-compiler.js
@@ -66,7 +66,7 @@ const overlayErrorID = `graphql-compiler`
const resolveThemes = (plugins = []) =>
plugins.reduce((merged, plugin) => {
- if (plugin.resolve.includes(`gatsby-theme-`)) {
+ if (plugin.name.includes(`gatsby-theme-`)) {
merged.push(plugin.resolve)
}
return merged
diff --git a/packages/gatsby/src/utils/__tests__/get-cache.js b/packages/gatsby/src/utils/__tests__/get-cache.js
new file mode 100644
index 0000000000000..f1e9ce832bdb2
--- /dev/null
+++ b/packages/gatsby/src/utils/__tests__/get-cache.js
@@ -0,0 +1,21 @@
+const getCache = require(`../get-cache`)
+
+const CACHE_KEY = `__test__`
+
+test(`it returns a new cache instance`, () => {
+ const cache = getCache(CACHE_KEY)
+
+ expect(cache.get).toEqual(expect.any(Function))
+ expect(cache.set).toEqual(expect.any(Function))
+})
+
+test(`it retrieves already created cache instance`, async () => {
+ const key = `some-value`
+ const value = [`a`, `b`, `c`]
+ const cache = getCache(CACHE_KEY)
+ await cache.set(key, value)
+
+ const other = getCache(CACHE_KEY)
+
+ expect(await other.get(key)).toEqual(value)
+})
diff --git a/packages/gatsby/src/utils/api-runner-node.js b/packages/gatsby/src/utils/api-runner-node.js
index bfc2fa7574e4e..31d820ff91e89 100644
--- a/packages/gatsby/src/utils/api-runner-node.js
+++ b/packages/gatsby/src/utils/api-runner-node.js
@@ -4,13 +4,11 @@ const _ = require(`lodash`)
const tracer = require(`opentracing`).globalTracer()
const reporter = require(`gatsby-cli/lib/reporter`)
-const Cache = require(`./cache`)
+const getCache = require(`./get-cache`)
const apiList = require(`./api-node-docs`)
const createNodeId = require(`./create-node-id`)
const createContentDigest = require(`./create-content-digest`)
-let caches = new Map()
-
// Bind action creators per plugin so we can auto-add
// metadata to actions they create.
const boundPluginActionCreators = {}
@@ -94,11 +92,7 @@ const runAPI = (plugin, api, args) => {
const tracing = initAPICallTracing(pluginSpan)
- let cache = caches.get(plugin.name)
- if (!cache) {
- cache = new Cache({ name: plugin.name }).init()
- caches.set(plugin.name, cache)
- }
+ const cache = getCache(plugin.name)
const apiCallArgs = [
{
@@ -109,6 +103,7 @@ const runAPI = (plugin, api, args) => {
loadNodeContent,
store,
emitter,
+ getCache,
getNodes,
getNode,
getNodesByType,
diff --git a/packages/gatsby/src/utils/get-cache.js b/packages/gatsby/src/utils/get-cache.js
new file mode 100644
index 0000000000000..af5db0dbf9c39
--- /dev/null
+++ b/packages/gatsby/src/utils/get-cache.js
@@ -0,0 +1,12 @@
+const Cache = require(`./cache`)
+
+let caches = new Map()
+
+module.exports = function getCache(name) {
+ let cache = caches.get(name)
+ if (!cache) {
+ cache = new Cache({ name }).init()
+ caches.set(name, cache)
+ }
+ return cache
+}
diff --git a/starters/blog/src/pages/404.js b/starters/blog/src/pages/404.js
index c3a842dc26c58..41143770709f7 100644
--- a/starters/blog/src/pages/404.js
+++ b/starters/blog/src/pages/404.js
@@ -1,4 +1,5 @@
import React from 'react'
+import { graphql } from 'gatsby'
import Layout from '../components/Layout'
import SEO from '../components/seo'
diff --git a/www/gatsby-node.js b/www/gatsby-node.js
index af59832c62ff1..02cbc8a4bf165 100644
--- a/www/gatsby-node.js
+++ b/www/gatsby-node.js
@@ -48,7 +48,13 @@ exports.createPages = ({ graphql, actions }) => {
const { createPage, createRedirect } = actions
createRedirect({
- fromPath: `/docs/using-unstructured-data`,
+ fromPath: `/blog/2018-10-25-unstructured-data/`,
+ toPath: `/blog/2018-10-25-using-gatsby-without-graphql/`,
+ isPermanent: true,
+ })
+
+ createRedirect({
+ fromPath: `/docs/using-unstructured-data/`,
toPath: `/docs/using-gatsby-without-graphql/`,
isPermanent: true,
})
@@ -272,7 +278,9 @@ exports.createPages = ({ graphql, actions }) => {
const postsPerPage = 8
const numPages = Math.ceil(releasedBlogPosts.length / postsPerPage)
- Array.from({ length: numPages }).forEach((_, i) => {
+ Array.from({
+ length: numPages,
+ }).forEach((_, i) => {
createPage({
path: i === 0 ? `/blog` : `/blog/page/${i + 1}`,
component: slash(blogListTemplate),
@@ -462,7 +470,7 @@ exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
slug = `/${parsedFilePath.dir}/`
}
- // Set released status for blog posts.
+ // Set released status and `published at` for blog posts.
if (_.includes(parsedFilePath.dir, `blog`)) {
let released = false
const date = _.get(node, `frontmatter.date`)
@@ -470,6 +478,17 @@ exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
released = moment().isSameOrAfter(moment.utc(date))
}
createNodeField({ node, name: `released`, value: released })
+
+ const canonicalLink = _.get(node, `frontmatter.canonicalLink`)
+ const publishedAt = _.get(node, `frontmatter.publishedAt`)
+
+ createNodeField({
+ node,
+ name: `publishedAt`,
+ value: canonicalLink
+ ? publishedAt || url.parse(canonicalLink).hostname
+ : null,
+ })
}
}
// Add slugs for package READMEs.
diff --git a/www/package.json b/www/package.json
index ace5cd6c2dc53..684aa22787e83 100644
--- a/www/package.json
+++ b/www/package.json
@@ -39,6 +39,7 @@
"gatsby-remark-copy-linked-files": "^2.0.5",
"gatsby-remark-graphviz": "^1.0.0",
"gatsby-remark-images": "^2.0.1",
+ "gatsby-remark-normalize-paths": "^1.0.0",
"gatsby-remark-prismjs": "^3.0.2",
"gatsby-remark-responsive-iframe": "^2.0.5",
"gatsby-remark-smartypants": "^2.0.5",
@@ -96,7 +97,8 @@
"serve": "gatsby serve",
"test": "echo \"Error: no test specified\" && exit 1",
"scrapeStarters": "cd src/data/StarterShowcase && node scraper.js",
- "stylelint": "stylelint './src/**/*.js'"
+ "stylelint": "stylelint './src/**/*.js'",
+ "forestry:preview": "gatsby develop -p 8080 -H 0.0.0.0"
},
"devDependencies": {
"front-matter": "^2.3.0",
diff --git a/www/src/templates/template-blog-post.js b/www/src/templates/template-blog-post.js
index 70612df84c390..55f583f1098a8 100644
--- a/www/src/templates/template-blog-post.js
+++ b/www/src/templates/template-blog-post.js
@@ -213,7 +213,7 @@ class BlogPostTemplate extends React.Component {
(originally published at
{` `}
- {post.frontmatter.publishedAt}
+ {this.props.data.markdownRemark.fields.publishedAt}
)
@@ -344,6 +344,7 @@ export const pageQuery = graphql`
timeToRead
fields {
slug
+ publishedAt
}
frontmatter {
title
@@ -351,7 +352,6 @@ export const pageQuery = graphql`
date(formatString: "MMMM Do YYYY")
rawDate: date
canonicalLink
- publishedAt
tags
image {
childImageSharp {