,
+ ])
+ },
+ },
+ }
+}
+
+describe(`develop-static-entry`, () => {
+ test(`onPreRenderHTML can be used to replace headComponents`, done => {
+ global.plugins = [fakeStylesPlugin, reverseHeadersPlugin]
+
+ DevelopStaticEntry(`/about/`, (_, html) => {
+ expect(html).toMatchSnapshot()
+ done()
+ })
+ })
+
+ test(`onPreRenderHTML can be used to replace postBodyComponents`, done => {
+ global.plugins = [
+ fakeComponentsPluginFactory(`Post`),
+ reverseBodyComponentsPluginFactory(`Post`),
+ ]
+
+ DevelopStaticEntry(`/about/`, (_, html) => {
+ expect(html).toMatchSnapshot()
+ done()
+ })
+ })
+
+ test(`onPreRenderHTML can be used to replace preBodyComponents`, done => {
+ global.plugins = [
+ fakeComponentsPluginFactory(`Pre`),
+ reverseBodyComponentsPluginFactory(`Pre`),
+ ]
+
+ DevelopStaticEntry(`/about/`, (_, html) => {
+ expect(html).toMatchSnapshot()
+ done()
+ })
+ })
+})
+
+describe(`static-entry`, () => {
+ beforeEach(() => {
+ global.__PATH_PREFIX__ = ``
+ })
+
+ test(`onPreRenderHTML can be used to replace headComponents`, done => {
+ global.plugins = [fakeStylesPlugin, reverseHeadersPlugin]
+
+ StaticEntry(`/about/`, (_, html) => {
+ expect(html).toMatchSnapshot()
+ done()
+ })
+ })
+
+ test(`onPreRenderHTML can be used to replace postBodyComponents`, done => {
+ global.plugins = [
+ fakeComponentsPluginFactory(`Post`),
+ reverseBodyComponentsPluginFactory(`Post`),
+ ]
+
+ StaticEntry(`/about/`, (_, html) => {
+ expect(html).toMatchSnapshot()
+ done()
+ })
+ })
+
+ test(`onPreRenderHTML can be used to replace preBodyComponents`, done => {
+ global.plugins = [
+ fakeComponentsPluginFactory(`Pre`),
+ reverseBodyComponentsPluginFactory(`Pre`),
+ ]
+
+ StaticEntry(`/about/`, (_, html) => {
+ expect(html).toMatchSnapshot()
+ done()
+ })
+ })
+})
diff --git a/.cache/__tests__/strip-prefix.js b/.cache/__tests__/strip-prefix.js
new file mode 100644
index 0000000..78fc19b
--- /dev/null
+++ b/.cache/__tests__/strip-prefix.js
@@ -0,0 +1,23 @@
+const stripPrefix = require(`../strip-prefix`).default
+
+describe(`strip-prefix`, () => {
+ it(`strips a prefix`, () => {
+ expect(stripPrefix(`/foo/bar/`, `/foo`)).toBe(`/bar/`)
+ })
+
+ it(`strips first instance only`, () => {
+ expect(stripPrefix(`/foo/foo/bar/`, `/foo`)).toBe(`/foo/bar/`)
+ })
+
+ it(`ignores prefix appearing elsewhere in the string`, () => {
+ expect(stripPrefix(`/foo/bar/`, `bar`)).toBe(`/foo/bar/`)
+ })
+
+ it(`ignores a non-existent prefix`, () => {
+ expect(stripPrefix(`/bar`, `/foo`)).toBe(`/bar`)
+ })
+
+ it(`returns input str if no prefix is provided`, () => {
+ expect(stripPrefix(`/bar`)).toBe(`/bar`)
+ })
+})
diff --git a/.cache/api-runner-browser-plugins.js b/.cache/api-runner-browser-plugins.js
new file mode 100644
index 0000000..d7faf17
--- /dev/null
+++ b/.cache/api-runner-browser-plugins.js
@@ -0,0 +1 @@
+module.exports = []
diff --git a/.cache/api-runner-browser.js b/.cache/api-runner-browser.js
new file mode 100644
index 0000000..b86a91c
--- /dev/null
+++ b/.cache/api-runner-browser.js
@@ -0,0 +1,44 @@
+const plugins = require(`./api-runner-browser-plugins`)
+const {
+ getResourcesForPathname,
+ getResourcesForPathnameSync,
+ getResourceURLsForPathname,
+} = require(`./loader`).publicLoader
+
+exports.apiRunner = (api, args = {}, defaultReturn, argTransform) => {
+ let results = plugins.map(plugin => {
+ if (!plugin.plugin[api]) {
+ return undefined
+ }
+
+ args.getResourcesForPathnameSync = getResourcesForPathnameSync
+ args.getResourcesForPathname = getResourcesForPathname
+ args.getResourceURLsForPathname = getResourceURLsForPathname
+
+ const result = plugin.plugin[api](args, plugin.options)
+ if (result && argTransform) {
+ args = argTransform({ args, result, plugin })
+ }
+ return result
+ })
+
+ // Filter out undefined results.
+ results = results.filter(result => typeof result !== `undefined`)
+
+ if (results.length > 0) {
+ return results
+ } else if (defaultReturn) {
+ return [defaultReturn]
+ } else {
+ return []
+ }
+}
+
+exports.apiRunnerAsync = (api, args, defaultReturn) =>
+ plugins.reduce(
+ (previous, next) =>
+ next.plugin[api]
+ ? previous.then(() => next.plugin[api](args, next.options))
+ : previous,
+ Promise.resolve()
+ )
diff --git a/.cache/api-runner-ssr.js b/.cache/api-runner-ssr.js
new file mode 100644
index 0000000..a8fa9b3
--- /dev/null
+++ b/.cache/api-runner-ssr.js
@@ -0,0 +1,43 @@
+var plugins = []
+// During bootstrap, we write requires at top of this file which looks like:
+// var plugins = [
+// {
+// plugin: require("/path/to/plugin1/gatsby-ssr.js"),
+// options: { ... },
+// },
+// {
+// plugin: require("/path/to/plugin2/gatsby-ssr.js"),
+// options: { ... },
+// },
+// ]
+
+const apis = require(`./api-ssr-docs`)
+
+// Run the specified API in any plugins that have implemented it
+module.exports = (api, args, defaultReturn, argTransform) => {
+ if (!apis[api]) {
+ console.log(`This API doesn't exist`, api)
+ }
+
+ // Run each plugin in series.
+ // eslint-disable-next-line no-undef
+ let results = plugins.map(plugin => {
+ if (!plugin.plugin[api]) {
+ return undefined
+ }
+ const result = plugin.plugin[api](args, plugin.options)
+ if (result && argTransform) {
+ args = argTransform({ args, result })
+ }
+ return result
+ })
+
+ // Filter out undefined results.
+ results = results.filter(result => typeof result !== `undefined`)
+
+ if (results.length > 0) {
+ return results
+ } else {
+ return [defaultReturn]
+ }
+}
diff --git a/.cache/api-ssr-docs.js b/.cache/api-ssr-docs.js
new file mode 100644
index 0000000..389c05c
--- /dev/null
+++ b/.cache/api-ssr-docs.js
@@ -0,0 +1,181 @@
+/**
+ * Replace the default server renderer. This is useful for integration with
+ * Redux, css-in-js libraries, etc. that need custom setups for server
+ * rendering.
+ * @param {Object} $0
+ * @param {function} $0.replaceBodyHTMLString Call this with the HTML string
+ * you render. **WARNING** if multiple plugins implement this API it's the
+ * last plugin that "wins". TODO implement an automated warning against this.
+ * @param {function} $0.setHeadComponents Takes an array of components as its
+ * first argument which are added to the `headComponents` array which is passed
+ * to the `html.js` component.
+ * @param {function} $0.setHtmlAttributes Takes an object of props which will
+ * spread into the `` component.
+ * @param {function} $0.setBodyAttributes Takes an object of props which will
+ * spread into the `` component.
+ * @param {function} $0.setPreBodyComponents Takes an array of components as its
+ * first argument which are added to the `preBodyComponents` array which is passed
+ * to the `html.js` component.
+ * @param {function} $0.setPostBodyComponents Takes an array of components as its
+ * first argument which are added to the `postBodyComponents` array which is passed
+ * to the `html.js` component.
+ * @param {function} $0.setBodyProps Takes an object of data which
+ * is merged with other body props and passed to `html.js` as `bodyProps`.
+ * @param {Object} pluginOptions
+ * @example
+ * // From gatsby-plugin-glamor
+ * const { renderToString } = require("react-dom/server")
+ * const inline = require("glamor-inline")
+ *
+ * exports.replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => {
+ * const bodyHTML = renderToString(bodyComponent)
+ * const inlinedHTML = inline(bodyHTML)
+ *
+ * replaceBodyHTMLString(inlinedHTML)
+ * }
+ */
+exports.replaceRenderer = true
+
+/**
+ * Called after every page Gatsby server renders while building HTML so you can
+ * set head and body components to be rendered in your `html.js`.
+ *
+ * Gatsby does a two-pass render for HTML. It loops through your pages first
+ * rendering only the body and then takes the result body HTML string and
+ * passes it as the `body` prop to your `html.js` to complete the render.
+ *
+ * It's often handy to be able to send custom components to your `html.js`.
+ * For example, it's a very common pattern for React.js libraries that
+ * support server rendering to pull out data generated during the render to
+ * add to your HTML.
+ *
+ * Using this API over [`replaceRenderer`](#replaceRenderer) is preferable as
+ * multiple plugins can implement this API where only one plugin can take
+ * over server rendering. However, if your plugin requires taking over server
+ * rendering then that's the one to
+ * use
+ * @param {Object} $0
+ * @param {string} $0.pathname The pathname of the page currently being rendered.
+ * @param {function} $0.setHeadComponents Takes an array of components as its
+ * first argument which are added to the `headComponents` array which is passed
+ * to the `html.js` component.
+ * @param {function} $0.setHtmlAttributes Takes an object of props which will
+ * spread into the `` component.
+ * @param {function} $0.setBodyAttributes Takes an object of props which will
+ * spread into the `` component.
+ * @param {function} $0.setPreBodyComponents Takes an array of components as its
+ * first argument which are added to the `preBodyComponents` array which is passed
+ * to the `html.js` component.
+ * @param {function} $0.setPostBodyComponents Takes an array of components as its
+ * first argument which are added to the `postBodyComponents` array which is passed
+ * to the `html.js` component.
+ * @param {function} $0.setBodyProps Takes an object of data which
+ * is merged with other body props and passed to `html.js` as `bodyProps`.
+ * @param {Object} pluginOptions
+ * @example
+ * const Helmet = require("react-helmet")
+ *
+ * exports.onRenderBody = (
+ * { setHeadComponents, setHtmlAttributes, setBodyAttributes },
+ * pluginOptions
+ * ) => {
+ * const helmet = Helmet.renderStatic()
+ * setHtmlAttributes(helmet.htmlAttributes.toComponent())
+ * setBodyAttributes(helmet.bodyAttributes.toComponent())
+ * setHeadComponents([
+ * helmet.title.toComponent(),
+ * helmet.link.toComponent(),
+ * helmet.meta.toComponent(),
+ * helmet.noscript.toComponent(),
+ * helmet.script.toComponent(),
+ * helmet.style.toComponent(),
+ * ])
+ * }
+ */
+exports.onRenderBody = true
+
+/**
+ * Called after every page Gatsby server renders while building HTML so you can
+ * replace head components to be rendered in your `html.js`. This is useful if
+ * you need to reorder scripts or styles added by other plugins.
+ * @param {Object} $0
+ * @param {Array} $0.getHeadComponents Returns the current `headComponents` array.
+ * @param {function} $0.replaceHeadComponents Takes an array of components as its
+ * first argument which replace the `headComponents` array which is passed
+ * to the `html.js` component. **WARNING** if multiple plugins implement this
+ * API it's the last plugin that "wins".
+ * @param {Array} $0.getPreBodyComponents Returns the current `preBodyComponents` array.
+ * @param {function} $0.replacePreBodyComponents Takes an array of components as its
+ * first argument which replace the `preBodyComponents` array which is passed
+ * to the `html.js` component. **WARNING** if multiple plugins implement this
+ * API it's the last plugin that "wins".
+ * @param {Array} $0.getPostBodyComponents Returns the current `postBodyComponents` array.
+ * @param {function} $0.replacePostBodyComponents Takes an array of components as its
+ * first argument which replace the `postBodyComponents` array which is passed
+ * to the `html.js` component. **WARNING** if multiple plugins implement this
+ * API it's the last plugin that "wins".
+ * @param {Object} pluginOptions
+ * @example
+ * // Move Typography.js styles to the top of the head section so they're loaded first.
+ * exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => {
+ * const headComponents = getHeadComponents()
+ * headComponents.sort((x, y) => {
+ * if (x.key === 'TypographyStyle') {
+ * return -1
+ * } else if (y.key === 'TypographyStyle') {
+ * return 1
+ * }
+ * return 0
+ * })
+ * replaceHeadComponents(headComponents)
+ * }
+ */
+exports.onPreRenderHTML = true
+
+/**
+ * Allow a plugin to wrap the page element.
+ *
+ * This is useful for setting wrapper component around pages that won't get
+ * unmounted on page change. For setting Provider components use [wrapRootElement](#wrapRootElement).
+ *
+ * _Note:_ [There is equivalent hook in Browser API](/docs/browser-apis/#wrapPageElement)
+ * @param {object} $0
+ * @param {object} $0.element The "Page" React Element built by Gatsby.
+ * @param {object} $0.props Props object used by page.
+ * @example
+ * import React from "react"
+ * import Layout from "./src/components/Layout"
+ *
+ * export const wrapPageElement = ({ element, props }) => {
+ * // props provide same data to Layout as Page element will get
+ * // including location, data, etc - you don't need to pass it
+ * return {element}
+ * }
+ */
+exports.wrapPageElement = true
+
+/**
+ * Allow a plugin to wrap the root element.
+ *
+ * This is useful to setup any Providers component that will wrap your application.
+ * For setting persistent UI elements around pages use [wrapPageElement](#wrapPageElement).
+ *
+ * _Note:_ [There is equivalent hook in Browser API](/docs/browser-apis/#wrapRootElement)
+ * @param {object} $0
+ * @param {object} $0.element The "Root" React Element built by Gatsby.
+ * @example
+ * import React from "react"
+ * import { Provider } from "react-redux"
+ *
+ * import createStore from "./src/state/createStore"
+ * const store = createStore()
+ *
+ * export const wrapRootElement = ({ element }) => {
+ * return (
+ *
+ * {element}
+ *
+ * )
+ * }
+ */
+exports.wrapRootElement = true
diff --git a/.cache/app.js b/.cache/app.js
new file mode 100644
index 0000000..74d4a0a
--- /dev/null
+++ b/.cache/app.js
@@ -0,0 +1,69 @@
+import React from "react"
+import ReactDOM from "react-dom"
+import domReady from "domready"
+import { hot } from "react-hot-loader"
+
+import socketIo from "./socketIo"
+import emitter from "./emitter"
+import { apiRunner, apiRunnerAsync } from "./api-runner-browser"
+import loader from "./loader"
+import syncRequires from "./sync-requires"
+import pages from "./pages.json"
+
+window.___emitter = emitter
+
+// Let the site/plugins run code very early.
+apiRunnerAsync(`onClientEntry`).then(() => {
+ // Hook up the client to socket.io on server
+ const socket = socketIo()
+ if (socket) {
+ socket.on(`reload`, () => {
+ window.location.reload()
+ })
+ }
+
+ /**
+ * Service Workers are persistent by nature. They stick around,
+ * serving a cached version of the site if they aren't removed.
+ * This is especially frustrating when you need to test the
+ * production build on your local machine.
+ *
+ * Let's unregister the service workers in development, and tidy up a few errors.
+ */
+ if (supportsServiceWorkers(location, navigator)) {
+ navigator.serviceWorker.getRegistrations().then(registrations => {
+ for (let registration of registrations) {
+ registration.unregister()
+ }
+ })
+ }
+
+ const rootElement = document.getElementById(`___gatsby`)
+
+ const renderer = apiRunner(
+ `replaceHydrateFunction`,
+ undefined,
+ ReactDOM.render
+ )[0]
+
+ loader.addPagesArray(pages)
+ loader.addDevRequires(syncRequires)
+
+ loader.getResourcesForPathname(window.location.pathname).then(() => {
+ let Root = hot(module)(preferDefault(require(`./root`)))
+ domReady(() => {
+ renderer(, rootElement, () => {
+ apiRunner(`onInitialClientRender`)
+ })
+ })
+ })
+})
+
+const preferDefault = m => (m && m.default) || m
+
+function supportsServiceWorkers(location, navigator) {
+ if (location.hostname === `localhost` || location.protocol === `https:`) {
+ return `serviceWorker` in navigator
+ }
+ return false
+}
diff --git a/.cache/async-requires.js b/.cache/async-requires.js
new file mode 100644
index 0000000..370b716
--- /dev/null
+++ b/.cache/async-requires.js
@@ -0,0 +1,9 @@
+// prefer default export if available
+const preferDefault = m => m && m.default || m
+
+exports.components = {
+ "component---src-pages-index-js": () => import("/Users/noisemachines/dev/partialsband.com/src/pages/index.js" /* webpackChunkName: "component---src-pages-index-js" */)
+}
+
+exports.data = () => import("/Users/noisemachines/dev/partialsband.com/.cache/data.json")
+
diff --git a/.cache/babelState.json b/.cache/babelState.json
new file mode 100644
index 0000000..ed395af
--- /dev/null
+++ b/.cache/babelState.json
@@ -0,0 +1,34 @@
+{
+ "develop": {
+ "plugins": [],
+ "presets": [],
+ "options": {
+ "cacheDirectory": true,
+ "sourceType": "unambiguous"
+ }
+ },
+ "develop-html": {
+ "plugins": [],
+ "presets": [],
+ "options": {
+ "cacheDirectory": true,
+ "sourceType": "unambiguous"
+ }
+ },
+ "build-html": {
+ "plugins": [],
+ "presets": [],
+ "options": {
+ "cacheDirectory": true,
+ "sourceType": "unambiguous"
+ }
+ },
+ "build-javascript": {
+ "plugins": [],
+ "presets": [],
+ "options": {
+ "cacheDirectory": true,
+ "sourceType": "unambiguous"
+ }
+ }
+}
\ No newline at end of file
diff --git a/.cache/create-react-context.js b/.cache/create-react-context.js
new file mode 100644
index 0000000..fc7dcee
--- /dev/null
+++ b/.cache/create-react-context.js
@@ -0,0 +1,3 @@
+import React from "react"
+
+export default React.createContext
diff --git a/.cache/data.json b/.cache/data.json
new file mode 100644
index 0000000..c62a03e
--- /dev/null
+++ b/.cache/data.json
@@ -0,0 +1 @@
+{"pages":[{"componentChunkName":"component---src-pages-index-js","jsonName":"index","path":"/"}],"dataPaths":{"dev-404-page-5f9":"920/path---dev-404-page-5-f-9-fab-NZuapzHg3X9TaN1iIixfv1W23E","index":"173/path---index-6a9-NZuapzHg3X9TaN1iIixfv1W23E","model-f03":"117/path---model-f-03-947-NZuapzHg3X9TaN1iIixfv1W23E"}}
\ No newline at end of file
diff --git a/.cache/default-html.js b/.cache/default-html.js
new file mode 100644
index 0000000..fdbc4be
--- /dev/null
+++ b/.cache/default-html.js
@@ -0,0 +1,38 @@
+import React from "react"
+import PropTypes from "prop-types"
+
+export default class HTML extends React.Component {
+ render() {
+ return (
+
+
+
+
+
+ {this.props.headComponents}
+
+
+ {this.props.preBodyComponents}
+
+ {this.props.postBodyComponents}
+
+
+ )
+ }
+}
+
+HTML.propTypes = {
+ htmlAttributes: PropTypes.object,
+ headComponents: PropTypes.array,
+ bodyAttributes: PropTypes.object,
+ preBodyComponents: PropTypes.array,
+ body: PropTypes.string,
+ postBodyComponents: PropTypes.array,
+}
diff --git a/.cache/dev-404-page.js b/.cache/dev-404-page.js
new file mode 100644
index 0000000..827811f
--- /dev/null
+++ b/.cache/dev-404-page.js
@@ -0,0 +1,59 @@
+import React from "react"
+import PropTypes from "prop-types"
+import { Link } from "gatsby"
+
+class Dev404Page extends React.Component {
+ static propTypes = {
+ pages: PropTypes.arrayOf(PropTypes.object),
+ location: PropTypes.object,
+ }
+ render() {
+ const { pathname } = this.props.location
+ const pages = this.props.pages.filter(
+ p => !/^\/dev-404-page\/$/.test(p.path)
+ )
+ let newFilePath
+ if (pathname === `/`) {
+ newFilePath = `src/pages/index.js`
+ } else if (pathname.slice(-1) === `/`) {
+ newFilePath = `src/pages${pathname.slice(0, -1)}.js`
+ } else {
+ newFilePath = `src/pages${pathname}.js`
+ }
+ return (
+
+
Gatsby.js development 404 page
+
+ {`There's not a page yet at `}
+ {pathname}
+
+
+ Create a React.js component in your site directory at
+ {` `}
+ {newFilePath}
+ {` `}
+ and this page will automatically refresh to show the new page
+ component you created.
+
+ {pages.length > 0 && (
+
+
+ If you were trying to reach another page, perhaps you can find it
+ below.
+
+
Pages ({pages.length})
+
+ {pages.map(page => (
+
+ {page.path}
+
+ ))}
+
+
+ )}
+
+ )
+ }
+}
+
+export default Dev404Page
diff --git a/.cache/develop-static-entry.js b/.cache/develop-static-entry.js
new file mode 100644
index 0000000..4d3a44d
--- /dev/null
+++ b/.cache/develop-static-entry.js
@@ -0,0 +1,113 @@
+import React from "react"
+import { renderToStaticMarkup } from "react-dom/server"
+import { merge } from "lodash"
+import apiRunner from "./api-runner-ssr"
+// import testRequireError from "./test-require-error"
+// For some extremely mysterious reason, webpack adds the above module *after*
+// this module so that when this code runs, testRequireError is undefined.
+// So in the meantime, we'll just inline it.
+const testRequireError = (moduleName, err) => {
+ const regex = new RegExp(`Error: Cannot find module\\s.${moduleName}`)
+ const firstLine = err.toString().split(`\n`)[0]
+ return regex.test(firstLine)
+}
+
+let Html
+try {
+ Html = require(`../src/html`)
+} catch (err) {
+ if (testRequireError(`../src/html`, err)) {
+ Html = require(`./default-html`)
+ } else {
+ console.log(`There was an error requiring "src/html.js"\n\n`, err, `\n\n`)
+ process.exit()
+ }
+}
+
+Html = Html && Html.__esModule ? Html.default : Html
+
+export default (pagePath, callback) => {
+ let headComponents = []
+ let htmlAttributes = {}
+ let bodyAttributes = {}
+ let preBodyComponents = []
+ let postBodyComponents = []
+ let bodyProps = {}
+ let htmlStr
+
+ const setHeadComponents = components => {
+ headComponents = headComponents.concat(components)
+ }
+
+ const setHtmlAttributes = attributes => {
+ htmlAttributes = merge(htmlAttributes, attributes)
+ }
+
+ const setBodyAttributes = attributes => {
+ bodyAttributes = merge(bodyAttributes, attributes)
+ }
+
+ const setPreBodyComponents = components => {
+ preBodyComponents = preBodyComponents.concat(components)
+ }
+
+ const setPostBodyComponents = components => {
+ postBodyComponents = postBodyComponents.concat(components)
+ }
+
+ const setBodyProps = props => {
+ bodyProps = merge({}, bodyProps, props)
+ }
+
+ const getHeadComponents = () => headComponents
+
+ const replaceHeadComponents = components => {
+ headComponents = components
+ }
+
+ const getPreBodyComponents = () => preBodyComponents
+
+ const replacePreBodyComponents = components => {
+ preBodyComponents = components
+ }
+
+ const getPostBodyComponents = () => postBodyComponents
+
+ const replacePostBodyComponents = components => {
+ postBodyComponents = components
+ }
+
+ apiRunner(`onRenderBody`, {
+ setHeadComponents,
+ setHtmlAttributes,
+ setBodyAttributes,
+ setPreBodyComponents,
+ setPostBodyComponents,
+ setBodyProps,
+ })
+
+ apiRunner(`onPreRenderHTML`, {
+ getHeadComponents,
+ replaceHeadComponents,
+ getPreBodyComponents,
+ replacePreBodyComponents,
+ getPostBodyComponents,
+ replacePostBodyComponents,
+ })
+
+ const htmlElement = React.createElement(Html, {
+ ...bodyProps,
+ body: ``,
+ headComponents: headComponents.concat([
+ ,
+ ]),
+ preBodyComponents,
+ postBodyComponents: postBodyComponents.concat([
+ ,
+ ]),
+ })
+ htmlStr = renderToStaticMarkup(htmlElement)
+ htmlStr = `${htmlStr}`
+
+ callback(null, htmlStr)
+}
diff --git a/.cache/emitter.js b/.cache/emitter.js
new file mode 100644
index 0000000..db1700e
--- /dev/null
+++ b/.cache/emitter.js
@@ -0,0 +1,4 @@
+import mitt from "mitt"
+
+const emitter = mitt()
+export default emitter
diff --git a/.cache/ensure-resources.js b/.cache/ensure-resources.js
new file mode 100644
index 0000000..cbc8c63
--- /dev/null
+++ b/.cache/ensure-resources.js
@@ -0,0 +1,122 @@
+import React from "react"
+import PropTypes from "prop-types"
+import loader from "./loader"
+import shallowCompare from "shallow-compare"
+
+// Pass pathname in as prop.
+// component will try fetching resources. If they exist,
+// will just render, else will render null.
+// It will also wait for pageResources
+// before propagating location change to children.
+class EnsureResources extends React.Component {
+ constructor(props) {
+ super()
+ let location = props.location
+
+ this.state = {
+ location: { ...location },
+ pageResources: loader.getResourcesForPathnameSync(location.pathname),
+ }
+ }
+
+ static getDerivedStateFromProps({ pageResources, location }, prevState) {
+ if (prevState.location !== location) {
+ const pageResources = loader.getResourcesForPathnameSync(
+ location.pathname
+ )
+
+ if (pageResources) {
+ return {
+ pageResources,
+ location: { ...location },
+ }
+ }
+ }
+
+ return null
+ }
+
+ componentDidUpdate(prevProps) {
+ if (prevProps === this.props) return
+
+ const { pathname } = this.props.location
+
+ if (!loader.getResourcesForPathnameSync(pathname))
+ // Page resources won't be set in cases where the browser back button
+ // or forward button is pushed as we can't wait as normal for resources
+ // to load before changing the page.
+ loader.getResourcesForPathname(pathname).then(pageResources => {
+ // The page may have changed since we started this, in which case doesn't update
+
+ if (this.props.location.pathname !== location.pathname) {
+ return
+ }
+
+ this.setState({
+ location: { ...location },
+ pageResources,
+ })
+ })
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ // 404
+ if (!nextState.pageResources) {
+ return true
+ }
+ // Check if the component or json have changed.
+ if (!this.state.pageResources && nextState.pageResources) {
+ return true
+ }
+ if (
+ this.state.pageResources.component !== nextState.pageResources.component
+ ) {
+ return true
+ }
+
+ if (this.state.pageResources.json !== nextState.pageResources.json) {
+ return true
+ }
+
+ // Check if location has changed on a page using internal routing
+ // via matchPath configuration.
+ if (
+ this.state.location.key !== nextState.location.key &&
+ nextState.pageResources.page &&
+ (nextState.pageResources.page.matchPath ||
+ nextState.pageResources.page.path)
+ ) {
+ return true
+ }
+
+ return shallowCompare(this, nextProps, nextState)
+ }
+
+ render() {
+ if (
+ process.env.NODE_ENV === `production` &&
+ !(this.state.pageResources && this.state.pageResources.json)
+ ) {
+ // Try to load the page directly - this should result in a 404 or
+ // network offline error.
+ const url = new URL(window.location)
+ if (url.search) {
+ url.search += `&no-cache=1`
+ } else {
+ url.search = `?no-cache=1`
+ }
+ window.location.replace(url)
+
+ return null
+ }
+
+ return this.props.children(this.state)
+ }
+}
+
+EnsureResources.propTypes = {
+ location: PropTypes.object.isRequired,
+ pageResources: PropTypes.object,
+}
+
+export default EnsureResources
diff --git a/.cache/find-page.js b/.cache/find-page.js
new file mode 100644
index 0000000..f25078f
--- /dev/null
+++ b/.cache/find-page.js
@@ -0,0 +1,55 @@
+// TODO add tests especially for handling prefixed links.
+import { match as matchPath } from "@reach/router/lib/utils"
+import stripPrefix from "./strip-prefix"
+
+const pageCache = {}
+
+export default (pages, pathPrefix = ``) => rawPathname => {
+ let pathname = decodeURIComponent(rawPathname)
+
+ // Remove the pathPrefix from the pathname.
+ let trimmedPathname = stripPrefix(pathname, pathPrefix)
+
+ // Remove any hashfragment
+ if (trimmedPathname.split(`#`).length > 1) {
+ trimmedPathname = trimmedPathname
+ .split(`#`)
+ .slice(0, -1)
+ .join(``)
+ }
+
+ // Remove search query
+ if (trimmedPathname.split(`?`).length > 1) {
+ trimmedPathname = trimmedPathname
+ .split(`?`)
+ .slice(0, -1)
+ .join(``)
+ }
+
+ if (pageCache[trimmedPathname]) {
+ return pageCache[trimmedPathname]
+ }
+
+ let foundPage
+ // Array.prototype.find is not supported in IE so we use this somewhat odd
+ // work around.
+ pages.some(page => {
+ let pathToMatch = page.matchPath ? page.matchPath : page.path
+ if (matchPath(pathToMatch, trimmedPathname)) {
+ foundPage = page
+ pageCache[trimmedPathname] = page
+ return true
+ }
+
+ // Finally, try and match request with default document.
+ if (matchPath(`${page.path}index.html`, trimmedPathname)) {
+ foundPage = page
+ pageCache[trimmedPathname] = page
+ return true
+ }
+
+ return false
+ })
+
+ return foundPage
+}
diff --git a/.cache/gatsby-browser-entry.js b/.cache/gatsby-browser-entry.js
new file mode 100644
index 0000000..63f5eec
--- /dev/null
+++ b/.cache/gatsby-browser-entry.js
@@ -0,0 +1,62 @@
+import React from "react"
+import PropTypes from "prop-types"
+import Link, {
+ withPrefix,
+ navigate,
+ push,
+ replace,
+ navigateTo,
+} from "gatsby-link"
+import { waitForRouteChange } from "./wait-for-route-change"
+import PageRenderer from "./public-page-renderer"
+import parsePath from "./parse-path"
+
+const StaticQueryContext = React.createContext({})
+
+const StaticQuery = props => (
+
+ {staticQueryData => {
+ if (
+ props.data ||
+ (staticQueryData[props.query] && staticQueryData[props.query].data)
+ ) {
+ return (props.render || props.children)(
+ props.data ? props.data.data : staticQueryData[props.query].data
+ )
+ } else {
+ return
Loading (StaticQuery)
+ }
+ }}
+
+)
+
+StaticQuery.propTypes = {
+ data: PropTypes.object,
+ query: PropTypes.string.isRequired,
+ render: PropTypes.func,
+ children: PropTypes.func,
+}
+
+function graphql() {
+ throw new Error(
+ `It appears like Gatsby is misconfigured. Gatsby related \`graphql\` calls ` +
+ `are supposed to only be evaluated at compile time, and then compiled away,. ` +
+ `Unfortunately, something went wrong and the query was left in the compiled code.\n\n.` +
+ `Unless your site has a complex or custom babel/Gatsby configuration this is likely a bug in Gatsby.`
+ )
+}
+
+export {
+ Link,
+ withPrefix,
+ graphql,
+ parsePath,
+ navigate,
+ push, // TODO replace for v3
+ replace, // TODO remove replace for v3
+ navigateTo, // TODO: remove navigateTo for v3
+ StaticQueryContext,
+ StaticQuery,
+ PageRenderer,
+ waitForRouteChange,
+}
diff --git a/.cache/json-store.js b/.cache/json-store.js
new file mode 100644
index 0000000..c7120f5
--- /dev/null
+++ b/.cache/json-store.js
@@ -0,0 +1,102 @@
+import React from "react"
+
+import PageRenderer from "./page-renderer"
+import { StaticQueryContext } from "gatsby"
+import {
+ getStaticQueryData,
+ getPageQueryData,
+ registerPath as socketRegisterPath,
+ unregisterPath as socketUnregisterPath,
+} from "./socketIo"
+
+if (process.env.NODE_ENV === `production`) {
+ throw new Error(
+ `It appears like Gatsby is misconfigured. JSONStore is Gatsby internal ` +
+ `development-only component and should never be used in production.\n\n` +
+ `Unless your site has a complex or custom webpack/Gatsby ` +
+ `configuration this is likely a bug in Gatsby. ` +
+ `Please report this at https://github.com/gatsbyjs/gatsby/issues ` +
+ `with steps to reproduce this error.`
+ )
+}
+
+const getPathFromProps = props =>
+ props.pageResources && props.pageResources.page
+ ? props.pageResources.page.path
+ : undefined
+
+class JSONStore extends React.Component {
+ constructor(props) {
+ super(props)
+ this.state = {
+ staticQueryData: getStaticQueryData(),
+ pageQueryData: getPageQueryData(),
+ path: null,
+ }
+ }
+
+ handleMittEvent = (type, event) => {
+ this.setState({
+ staticQueryData: getStaticQueryData(),
+ pageQueryData: getPageQueryData(),
+ })
+ }
+
+ componentDidMount() {
+ socketRegisterPath(getPathFromProps(this.props))
+ ___emitter.on(`*`, this.handleMittEvent)
+ }
+
+ componentWillUnmount() {
+ socketUnregisterPath(this.state.path)
+ ___emitter.off(`*`, this.handleMittEvent)
+ }
+
+ static getDerivedStateFromProps(props, state) {
+ const newPath = getPathFromProps(props)
+ if (newPath !== state.path) {
+ socketUnregisterPath(state.path)
+ socketRegisterPath(newPath)
+ return {
+ path: newPath,
+ }
+ }
+
+ return null
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ // We want to update this component when:
+ // - location changed
+ // - page data for path changed
+ // - static query results changed
+
+ return (
+ this.props.location !== nextProps.location ||
+ this.state.path !== nextState.path ||
+ this.state.pageQueryData[nextState.path] !==
+ nextState.pageQueryData[nextState.path] ||
+ this.state.staticQueryData !== nextState.staticQueryData
+ )
+ }
+
+ render() {
+ const data = this.state.pageQueryData[getPathFromProps(this.props)]
+ // eslint-disable-next-line
+ const { pages, ...propsWithoutPages } = this.props
+ if (!data) {
+ return
+ }
+
+ return (
+
+
+
+ )
+ }
+}
+
+export default JSONStore
diff --git a/.cache/load-directly-or-404.js b/.cache/load-directly-or-404.js
new file mode 100644
index 0000000..5c0c137
--- /dev/null
+++ b/.cache/load-directly-or-404.js
@@ -0,0 +1,60 @@
+/**
+ * When other parts of the code can't find resources for a page, they load the 404 page's
+ * resources (if it exists) and then pass them here. This module then does the following:
+ * 1. Checks if 404 pages resources exist. If not, just navigate directly to the desired URL
+ * to show whatever server 404 page exists.
+ * 2. Try fetching the desired page to see if it exists on the server but we
+ * were just prevented from seeing it due to loading the site from a SW. If this is the case,
+ * trigger a hard reload to grab that page from the server.
+ * 3. If the page doesn't exist, show the normal 404 page component.
+ * 4. If the fetch failed (generally meaning we're offline), then navigate anyways to show
+ * either the browser's offline page or whatever the server error is.
+ */
+export default function(resources, path, replaceOnSuccess = false) {
+ return new Promise((resolve, reject) => {
+ const url = new URL(window.location.origin + path)
+
+ if (url.search.match(/\?(.*&)?no-cache=1(&|$)/)) {
+ console.log(
+ `Found no-cache=1 while attempting to load a page directly; ` +
+ `this is likely due to a bug in Gatsby, or a misconfiguration in your project.`
+ )
+ return reject()
+ }
+
+ // Append the appropriate query to the URL.
+ if (url.search) {
+ url.search += `&no-cache=1`
+ } else {
+ url.search = `?no-cache=1`
+ }
+
+ // Always navigate directly if a custom 404 page doesn't exist.
+ if (!resources) {
+ window.location = url
+ } else {
+ // Now test if the page is available directly
+ fetch(url.href)
+ .then(response => {
+ if (response.status !== 404) {
+ // Redirect there if there isn't a 404. If a different HTTP
+ // error occurs, the appropriate error message will be
+ // displayed after loading the page directly.
+ if (replaceOnSuccess) {
+ window.location.replace(url)
+ } else {
+ window.location = url
+ }
+ } else {
+ // If a 404 occurs, show the custom 404 page.
+ resolve()
+ }
+ })
+ .catch(() => {
+ // If an error occurs (usually when offline), navigate to the
+ // page anyway to show the browser's proper offline error page
+ window.location = url
+ })
+ }
+ })
+}
diff --git a/.cache/loader.js b/.cache/loader.js
new file mode 100644
index 0000000..34bba67
--- /dev/null
+++ b/.cache/loader.js
@@ -0,0 +1,390 @@
+import pageFinderFactory from "./find-page"
+import emitter from "./emitter"
+import stripPrefix from "./strip-prefix"
+import prefetchHelper from "./prefetch"
+
+const preferDefault = m => (m && m.default) || m
+
+let prefetcher
+let devGetPageData
+let inInitialRender = true
+let hasFetched = Object.create(null)
+let syncRequires = {}
+let asyncRequires = {}
+let jsonDataPaths = {}
+let fetchHistory = []
+let fetchingPageResourceMapPromise = null
+let fetchedPageResourceMap = false
+let apiRunner
+const failedPaths = {}
+const failedResources = {}
+const MAX_HISTORY = 5
+
+const jsonPromiseStore = {}
+
+if (process.env.NODE_ENV !== `production`) {
+ devGetPageData = require(`./socketIo`).getPageData
+}
+
+/**
+ * Fetch resource map (pages data and paths to json files with results of
+ * queries)
+ */
+const fetchPageResourceMap = () => {
+ if (!fetchingPageResourceMapPromise) {
+ fetchingPageResourceMapPromise = new Promise(resolve => {
+ asyncRequires.data().then(({ pages, dataPaths }) => {
+ // TODO — expose proper way to access this data from plugins.
+ // Need to come up with an API for plugins to access
+ // site info.
+ window.___dataPaths = dataPaths
+ queue.addPagesArray(pages)
+ queue.addDataPaths(dataPaths)
+ resolve((fetchedPageResourceMap = true))
+ })
+ })
+ }
+ return fetchingPageResourceMapPromise
+}
+
+const createJsonURL = jsonName => `${__PATH_PREFIX__}/static/d/${jsonName}.json`
+const createComponentUrls = componentChunkName =>
+ window.___chunkMapping[componentChunkName].map(
+ chunk => __PATH_PREFIX__ + chunk
+ )
+
+const fetchResource = resourceName => {
+ // Find resource
+ let resourceFunction
+ if (resourceName.slice(0, 12) === `component---`) {
+ resourceFunction = asyncRequires.components[resourceName]
+ } else {
+ if (resourceName in jsonPromiseStore) {
+ resourceFunction = () => jsonPromiseStore[resourceName]
+ } else {
+ resourceFunction = () => {
+ const fetchPromise = new Promise((resolve, reject) => {
+ const url = createJsonURL(jsonDataPaths[resourceName])
+ const req = new XMLHttpRequest()
+ req.open(`GET`, url, true)
+ req.withCredentials = true
+ req.onreadystatechange = () => {
+ if (req.readyState == 4) {
+ if (req.status === 200) {
+ resolve(JSON.parse(req.responseText))
+ } else {
+ reject()
+ }
+ }
+ }
+ req.send(null)
+ })
+ jsonPromiseStore[resourceName] = fetchPromise
+ return fetchPromise
+ }
+ }
+ }
+
+ // Download the resource
+ hasFetched[resourceName] = true
+ return new Promise(resolve => {
+ const fetchPromise = resourceFunction()
+ let failed = false
+ return fetchPromise
+ .catch(() => {
+ failed = true
+ })
+ .then(component => {
+ fetchHistory.push({
+ resource: resourceName,
+ succeeded: !failed,
+ })
+
+ if (!failedResources[resourceName]) {
+ failedResources[resourceName] = failed
+ }
+
+ fetchHistory = fetchHistory.slice(-MAX_HISTORY)
+
+ resolve(component)
+ })
+ })
+}
+
+const prefetchResource = resourceName => {
+ if (resourceName.slice(0, 12) === `component---`) {
+ createComponentUrls(resourceName).forEach(url => prefetchHelper(url))
+ } else {
+ const url = createJsonURL(jsonDataPaths[resourceName])
+ prefetchHelper(url)
+ }
+}
+
+const getResourceModule = resourceName =>
+ fetchResource(resourceName).then(preferDefault)
+
+const appearsOnLine = () => {
+ const isOnLine = navigator.onLine
+ if (typeof isOnLine === `boolean`) {
+ return isOnLine
+ }
+
+ // If no navigator.onLine support assume onLine if any of last N fetches succeeded
+ const succeededFetch = fetchHistory.find(entry => entry.succeeded)
+ return !!succeededFetch
+}
+
+const handleResourceLoadError = (path, message) => {
+ if (!failedPaths[path]) {
+ failedPaths[path] = message
+ }
+
+ if (
+ appearsOnLine() &&
+ window.location.pathname.replace(/\/$/g, ``) !== path.replace(/\/$/g, ``)
+ ) {
+ window.location.pathname = path
+ }
+}
+
+// Note we're not actively using the path data atm. There
+// could be future optimizations however around trying to ensure
+// we load all resources for likely-to-be-visited paths.
+// let pathArray = []
+// let pathCount = {}
+
+let resourcesCount = Object.create(null)
+const sortResourcesByCount = (a, b) => {
+ if (resourcesCount[a] > resourcesCount[b]) return 1
+ else if (resourcesCount[a] < resourcesCount[b]) return -1
+ else return 0
+}
+
+let findPage
+let pathScriptsCache = {}
+let prefetchTriggered = {}
+let disableCorePrefetching = false
+
+const queue = {
+ addPagesArray: newPages => {
+ findPage = pageFinderFactory(newPages, __PATH_PREFIX__)
+ },
+ addDevRequires: devRequires => {
+ syncRequires = devRequires
+ },
+ addProdRequires: prodRequires => {
+ asyncRequires = prodRequires
+ },
+ addDataPaths: dataPaths => {
+ jsonDataPaths = dataPaths
+ },
+ // Hovering on a link is a very strong indication the user is going to
+ // click on it soon so let's start prefetching resources for this
+ // pathname.
+ hovering: rawPath => {
+ const path = stripPrefix(rawPath, __PATH_PREFIX__)
+ queue.getResourcesForPathname(path)
+ },
+ enqueue: rawPath => {
+ const path = stripPrefix(rawPath, __PATH_PREFIX__)
+ if (!apiRunner)
+ console.error(`Run setApiRunnerForLoader() before enqueing paths`)
+
+ // Tell plugins with custom prefetching logic that they should start
+ // prefetching this path.
+ if (!prefetchTriggered[path]) {
+ apiRunner(`onPrefetchPathname`, {
+ pathname: path,
+ })
+ prefetchTriggered[path] = true
+ }
+
+ // If a plugin has disabled core prefetching, stop now.
+ if (disableCorePrefetching.some(a => a)) {
+ return false
+ }
+
+ // Check if the page exists.
+ let page = findPage(path)
+
+ // In production, we lazy load page metadata. If that
+ // hasn't been fetched yet, start fetching it now.
+ if (
+ process.env.NODE_ENV === `production` &&
+ !page &&
+ !fetchedPageResourceMap
+ ) {
+ // If page wasn't found check and we didn't fetch resources map for
+ // all pages, wait for fetch to complete and try find page again
+ return fetchPageResourceMap().then(() => queue.enqueue(rawPath))
+ }
+
+ if (!page) {
+ return false
+ }
+
+ if (
+ process.env.NODE_ENV !== `production` &&
+ process.env.NODE_ENV !== `test`
+ ) {
+ devGetPageData(page.path)
+ }
+
+ // Prefetch resources.
+ if (process.env.NODE_ENV === `production`) {
+ prefetchResource(page.jsonName)
+ prefetchResource(page.componentChunkName)
+ }
+
+ return true
+ },
+
+ getPage: pathname => findPage(pathname),
+
+ getResourceURLsForPathname: path => {
+ const page = findPage(path)
+ if (page) {
+ return [
+ ...createComponentUrls(page.componentChunkName),
+ createJsonURL(jsonDataPaths[page.jsonName]),
+ ]
+ } else {
+ return null
+ }
+ },
+
+ getResourcesForPathnameSync: path => {
+ const page = findPage(path)
+ if (page) {
+ return pathScriptsCache[page.path]
+ } else {
+ return null
+ }
+ },
+
+ // Get resources (code/data) for a path. Fetches metdata first
+ // if necessary and then the code/data bundles. Used for prefetching
+ // and getting resources for page changes.
+ getResourcesForPathname: path =>
+ new Promise((resolve, reject) => {
+ const doingInitialRender = inInitialRender
+ inInitialRender = false
+
+ // Production code path
+ if (failedPaths[path]) {
+ handleResourceLoadError(
+ path,
+ `Previously detected load failure for "${path}"`
+ )
+ return reject()
+ }
+ const page = findPage(path)
+
+ // In production, we lazy load page metadata. If that
+ // hasn't been fetched yet, start fetching it now.
+ if (
+ !page &&
+ !fetchedPageResourceMap &&
+ process.env.NODE_ENV === `production`
+ ) {
+ // If page wasn't found check and we didn't fetch resources map for
+ // all pages, wait for fetch to complete and try to get resources again
+ return fetchPageResourceMap().then(() =>
+ resolve(queue.getResourcesForPathname(path))
+ )
+ }
+
+ if (!page) {
+ console.log(`A page wasn't found for "${path}"`)
+
+ // Preload the custom 404 page
+ if (path !== `/404.html`) {
+ return resolve(queue.getResourcesForPathname(`/404.html`))
+ }
+
+ return resolve()
+ }
+
+ // Use the path from the page so the pathScriptsCache uses
+ // the normalized path.
+ path = page.path
+
+ // Check if it's in the cache already.
+ if (pathScriptsCache[path]) {
+ emitter.emit(`onPostLoadPageResources`, {
+ page,
+ pageResources: pathScriptsCache[path],
+ })
+ return resolve(pathScriptsCache[path])
+ }
+
+ // Nope, we need to load resource(s)
+ emitter.emit(`onPreLoadPageResources`, {
+ path,
+ })
+
+ // In development we know the code is loaded already
+ // so we just return with it immediately.
+ if (process.env.NODE_ENV !== `production`) {
+ const pageResources = {
+ component: syncRequires.components[page.componentChunkName],
+ page,
+ }
+
+ // Add to the cache.
+ pathScriptsCache[path] = pageResources
+ devGetPageData(page.path).then(pageData => {
+ emitter.emit(`onPostLoadPageResources`, {
+ page,
+ pageResources,
+ })
+ resolve(pageResources)
+ })
+ } else {
+ Promise.all([
+ getResourceModule(page.componentChunkName),
+ getResourceModule(page.jsonName),
+ ]).then(([component, json]) => {
+ if (!(component && json)) {
+ resolve(null)
+ return
+ }
+
+ const pageResources = {
+ component,
+ json,
+ page,
+ }
+ pageResources.page.jsonURL = createJsonURL(
+ jsonDataPaths[page.jsonName]
+ )
+ pathScriptsCache[path] = pageResources
+ resolve(pageResources)
+
+ emitter.emit(`onPostLoadPageResources`, {
+ page,
+ pageResources,
+ })
+
+ if (doingInitialRender) {
+ // We got all resources needed for first mount,
+ // we can fetch resoures for all pages.
+ fetchPageResourceMap()
+ }
+ })
+ }
+ }),
+}
+
+export const setApiRunnerForLoader = runner => {
+ apiRunner = runner
+ disableCorePrefetching = apiRunner(`disableCorePrefetching`)
+}
+
+export const publicLoader = {
+ getResourcesForPathname: queue.getResourcesForPathname,
+ getResourceURLsForPathname: queue.getResourceURLsForPathname,
+ getResourcesForPathnameSync: queue.getResourcesForPathnameSync,
+}
+
+export default queue
diff --git a/.cache/navigation.js b/.cache/navigation.js
new file mode 100644
index 0000000..7de1190
--- /dev/null
+++ b/.cache/navigation.js
@@ -0,0 +1,142 @@
+import loader, { setApiRunnerForLoader } from "./loader"
+import redirects from "./redirects.json"
+import { apiRunner } from "./api-runner-browser"
+import emitter from "./emitter"
+import {
+ resolveRouteChangePromise,
+ resetRouteChangePromise,
+} from "./wait-for-route-change"
+import { navigate as reachNavigate } from "@reach/router"
+import parsePath from "./parse-path"
+import loadDirectlyOr404 from "./load-directly-or-404"
+
+// Convert to a map for faster lookup in maybeRedirect()
+const redirectMap = redirects.reduce((map, redirect) => {
+ map[redirect.fromPath] = redirect
+ return map
+}, {})
+
+function maybeRedirect(pathname) {
+ const redirect = redirectMap[pathname]
+
+ if (redirect != null) {
+ if (process.env.NODE_ENV !== `production`) {
+ const pageResources = loader.getResourcesForPathnameSync(pathname)
+
+ if (pageResources != null) {
+ console.error(
+ `The route "${pathname}" matches both a page and a redirect; this is probably not intentional.`
+ )
+ }
+ }
+
+ window.___replace(redirect.toPath)
+ return true
+ } else {
+ return false
+ }
+}
+
+const onPreRouteUpdate = location => {
+ if (!maybeRedirect(location.pathname)) {
+ apiRunner(`onPreRouteUpdate`, { location })
+ }
+}
+
+const onRouteUpdate = location => {
+ if (!maybeRedirect(location.pathname)) {
+ apiRunner(`onRouteUpdate`, { location })
+ resolveRouteChangePromise()
+
+ // Temp hack while awaiting https://github.com/reach/router/issues/119
+ window.__navigatingToLink = false
+ }
+}
+
+const navigate = (to, options = {}) => {
+ // Temp hack while awaiting https://github.com/reach/router/issues/119
+ if (!options.replace) {
+ window.__navigatingToLink = true
+ }
+
+ let { pathname } = parsePath(to)
+ const redirect = redirectMap[pathname]
+
+ // If we're redirecting, just replace the passed in pathname
+ // to the one we want to redirect to.
+ if (redirect) {
+ to = redirect.toPath
+ pathname = parsePath(to).pathname
+ }
+
+ // If we had a service worker update, no matter the path, reload window
+ if (window.GATSBY_SW_UPDATED) {
+ window.location = pathname
+ return
+ }
+
+ resetRouteChangePromise()
+
+ // Start a timer to wait for a second before transitioning and showing a
+ // loader in case resources aren't around yet.
+ const timeoutId = setTimeout(() => {
+ emitter.emit(`onDelayedLoadPageResources`, { pathname })
+ apiRunner(`onRouteUpdateDelayed`, {
+ location: window.location,
+ })
+ }, 1000)
+
+ loader.getResourcesForPathname(pathname).then(pageResources => {
+ if (!pageResources && process.env.NODE_ENV === `production`) {
+ loader.getResourcesForPathname(`/404.html`).then(resources => {
+ clearTimeout(timeoutId)
+ loadDirectlyOr404(resources, to).then(() => reachNavigate(to, options))
+ })
+ } else {
+ reachNavigate(to, options)
+ clearTimeout(timeoutId)
+ }
+ })
+}
+
+// reset route change promise after going back / forward
+// in history (when not using Gatsby navigation)
+window.addEventListener(`popstate`, () => {
+ resetRouteChangePromise()
+})
+
+function shouldUpdateScroll(prevRouterProps, { location: { pathname } }) {
+ const results = apiRunner(`shouldUpdateScroll`, {
+ prevRouterProps,
+ pathname,
+ })
+ if (results.length > 0) {
+ return results[0]
+ }
+
+ if (prevRouterProps) {
+ const {
+ location: { pathname: oldPathname },
+ } = prevRouterProps
+ if (oldPathname === pathname) {
+ return false
+ }
+ }
+ return true
+}
+
+function init() {
+ // Temp hack while awaiting https://github.com/reach/router/issues/119
+ window.__navigatingToLink = false
+
+ setApiRunnerForLoader(apiRunner)
+ window.___loader = loader
+ window.___push = to => navigate(to, { replace: false })
+ window.___replace = to => navigate(to, { replace: true })
+ window.___navigate = (to, options) => navigate(to, options)
+
+ // Check for initial page-load redirect
+ maybeRedirect(window.location.pathname)
+}
+
+export { init, shouldUpdateScroll, onRouteUpdate, onPreRouteUpdate }
diff --git a/.cache/page-renderer.js b/.cache/page-renderer.js
new file mode 100644
index 0000000..058bd21
--- /dev/null
+++ b/.cache/page-renderer.js
@@ -0,0 +1,79 @@
+import React, { createElement } from "react"
+import PropTypes from "prop-types"
+import { publicLoader } from "./loader"
+import { apiRunner } from "./api-runner-browser"
+import { onRouteUpdate, onPreRouteUpdate } from "./navigation"
+
+// Renders page and fire on(Pre)RouteUpdate APIs
+class PageRenderer extends React.Component {
+ constructor(props) {
+ super(props)
+ if (props.isMain) {
+ onPreRouteUpdate(props.location)
+ }
+ }
+
+ componentDidMount() {
+ if (this.props.isMain) {
+ onRouteUpdate(this.props.location)
+ }
+ }
+
+ componentDidUpdate(prevProps, prevState, shouldFireRouteUpdate) {
+ if (this.props.isMain && shouldFireRouteUpdate) {
+ onRouteUpdate(this.props.location)
+ }
+ }
+
+ getSnapshotBeforeUpdate(prevProps, prevState) {
+ if (this.props.isMain) {
+ if (this.props.location.pathname !== prevProps.location.pathname) {
+ onPreRouteUpdate(this.props.location)
+ return true
+ }
+
+ return false
+ }
+ return null
+ }
+
+ render() {
+ const props = {
+ ...this.props,
+ pathContext: this.props.pageContext,
+ }
+
+ const [replacementElement] = apiRunner(`replaceComponentRenderer`, {
+ props: this.props,
+ loader: publicLoader,
+ })
+
+ const pageElement =
+ replacementElement ||
+ createElement(this.props.pageResources.component, {
+ ...props,
+ key: this.props.location.pathname,
+ })
+
+ const wrappedPage = apiRunner(
+ `wrapPageElement`,
+ { element: pageElement, props },
+ pageElement,
+ ({ result }) => {
+ return { element: result, props }
+ }
+ ).pop()
+
+ return wrappedPage
+ }
+}
+
+PageRenderer.propTypes = {
+ location: PropTypes.object.isRequired,
+ pageResources: PropTypes.object.isRequired,
+ data: PropTypes.object,
+ pageContext: PropTypes.object.isRequired,
+ isMain: PropTypes.bool,
+}
+
+export default PageRenderer
diff --git a/.cache/pages.json b/.cache/pages.json
new file mode 100644
index 0000000..f40c6e0
--- /dev/null
+++ b/.cache/pages.json
@@ -0,0 +1,7 @@
+[
+ {
+ "componentChunkName": "component---src-pages-index-js",
+ "jsonName": "index",
+ "path": "/"
+ }
+]
\ No newline at end of file
diff --git a/.cache/parse-path.js b/.cache/parse-path.js
new file mode 100644
index 0000000..040ffef
--- /dev/null
+++ b/.cache/parse-path.js
@@ -0,0 +1,23 @@
+export default function parsePath(path) {
+ var pathname = path || `/`
+ var search = ``
+ var hash = ``
+
+ var hashIndex = pathname.indexOf(`#`)
+ if (hashIndex !== -1) {
+ hash = pathname.substr(hashIndex)
+ pathname = pathname.substr(0, hashIndex)
+ }
+
+ var searchIndex = pathname.indexOf(`?`)
+ if (searchIndex !== -1) {
+ search = pathname.substr(searchIndex)
+ pathname = pathname.substr(0, searchIndex)
+ }
+
+ return {
+ pathname: pathname,
+ search: search === `?` ? `` : search,
+ hash: hash === `#` ? `` : hash,
+ }
+}
diff --git a/.cache/prefetch.js b/.cache/prefetch.js
new file mode 100644
index 0000000..182864e
--- /dev/null
+++ b/.cache/prefetch.js
@@ -0,0 +1,47 @@
+const support = function(feature) {
+ if (typeof document === `undefined`) {
+ return false
+ }
+ const fakeLink = document.createElement(`link`)
+ try {
+ if (fakeLink.relList && typeof fakeLink.relList.supports === `function`) {
+ return fakeLink.relList.supports(feature)
+ }
+ } catch (err) {
+ return false
+ }
+}
+const linkPrefetchStrategy = function(url) {
+ if (typeof document === `undefined`) {
+ return
+ }
+ const link = document.createElement(`link`)
+ link.setAttribute(`rel`, `prefetch`)
+ link.setAttribute(`href`, url)
+ const parentElement =
+ document.getElementsByTagName(`head`)[0] ||
+ document.getElementsByName(`script`)[0].parentNode
+ parentElement.appendChild(link)
+}
+const xhrPrefetchStrategy = function(url) {
+ const req = new XMLHttpRequest()
+ req.open(`GET`, url, true)
+ req.withCredentials = true
+ req.send(null)
+}
+
+const supportedPrefetchStrategy = support(`prefetch`)
+ ? linkPrefetchStrategy
+ : xhrPrefetchStrategy
+
+const preFetched = {}
+
+const prefetch = function(url) {
+ if (preFetched[url]) {
+ return
+ }
+ preFetched[url] = true
+ supportedPrefetchStrategy(url)
+}
+
+export default prefetch
diff --git a/.cache/production-app.js b/.cache/production-app.js
new file mode 100644
index 0000000..55e31c6
--- /dev/null
+++ b/.cache/production-app.js
@@ -0,0 +1,137 @@
+import { apiRunner, apiRunnerAsync } from "./api-runner-browser"
+import React, { createElement } from "react"
+import ReactDOM from "react-dom"
+import { Router, navigate } from "@reach/router"
+import { match } from "@reach/router/lib/utils"
+import { ScrollContext } from "gatsby-react-router-scroll"
+import domReady from "domready"
+import { shouldUpdateScroll, init as navigationInit } from "./navigation"
+import emitter from "./emitter"
+window.___emitter = emitter
+import PageRenderer from "./page-renderer"
+import asyncRequires from "./async-requires"
+import loader from "./loader"
+import loadDirectlyOr404 from "./load-directly-or-404"
+import EnsureResources from "./ensure-resources"
+
+window.asyncRequires = asyncRequires
+window.___emitter = emitter
+window.___loader = loader
+
+loader.addPagesArray([window.page])
+loader.addDataPaths({ [window.page.jsonName]: window.dataPath })
+loader.addProdRequires(asyncRequires)
+
+navigationInit()
+
+// Let the site/plugins run code very early.
+apiRunnerAsync(`onClientEntry`).then(() => {
+ // Let plugins register a service worker. The plugin just needs
+ // to return true.
+ if (apiRunner(`registerServiceWorker`).length > 0) {
+ require(`./register-service-worker`)
+ }
+
+ class RouteHandler extends React.Component {
+ render() {
+ let { location } = this.props
+ // TODO
+ // check if hash + if element and if so scroll
+ // remove hash handling from gatsby-link
+ // check if scrollbehavior handles back button for
+ // restoring old position
+ // if not, add that.
+
+ return (
+
+
+ {({ pageResources, location }) => (
+
+ )}
+
+
+ )
+ }
+ }
+
+ const { page, location: browserLoc } = window
+ // TODO: comment what this check does
+ if (
+ page &&
+ page.path !== `/404.html` &&
+ __PATH_PREFIX__ + page.path !== browserLoc.pathname &&
+ !page.path.match(/^\/offline-plugin-app-shell-fallback\/?$/) &&
+ (!page.matchPath ||
+ !match(__PATH_PREFIX__ + page.matchPath, browserLoc.pathname))
+ ) {
+ navigate(
+ __PATH_PREFIX__ + page.path + browserLoc.search + browserLoc.hash,
+ { replace: true }
+ )
+ }
+
+ loader
+ .getResourcesForPathname(browserLoc.pathname)
+ .then(() => {
+ if (!loader.getPage(browserLoc.pathname)) {
+ return loader
+ .getResourcesForPathname(`/404.html`)
+ .then(resources =>
+ loadDirectlyOr404(
+ resources,
+ browserLoc.pathname + browserLoc.search + browserLoc.hash,
+ true
+ )
+ )
+ }
+ return null
+ })
+ .then(() => {
+ const Root = () =>
+ createElement(
+ Router,
+ {
+ basepath: __PATH_PREFIX__,
+ },
+ createElement(RouteHandler, { path: `/*` })
+ )
+
+ const WrappedRoot = apiRunner(
+ `wrapRootElement`,
+ { element: },
+ ,
+ ({ result }) => {
+ return { element: result }
+ }
+ ).pop()
+
+ let NewRoot = () => WrappedRoot
+
+ const renderer = apiRunner(
+ `replaceHydrateFunction`,
+ undefined,
+ ReactDOM.hydrate
+ )[0]
+
+ domReady(() => {
+ renderer(
+ ,
+ typeof window !== `undefined`
+ ? document.getElementById(`___gatsby`)
+ : void 0,
+ () => {
+ apiRunner(`onInitialClientRender`)
+ }
+ )
+ })
+ })
+})
diff --git a/.cache/public-page-renderer-dev.js b/.cache/public-page-renderer-dev.js
new file mode 100644
index 0000000..5d283d0
--- /dev/null
+++ b/.cache/public-page-renderer-dev.js
@@ -0,0 +1,23 @@
+import React from "react"
+import PropTypes from "prop-types"
+
+import pages from "./pages.json"
+import loader from "./loader"
+import JSONStore from "./json-store"
+
+const DevPageRenderer = ({ location }) => {
+ const pageResources = loader.getResourcesForPathnameSync(location.pathname)
+ return React.createElement(JSONStore, {
+ pages,
+ location,
+ pageResources,
+ })
+}
+
+DevPageRenderer.propTypes = {
+ location: PropTypes.shape({
+ pathname: PropTypes.string.isRequired,
+ }).isRequired,
+}
+
+export default DevPageRenderer
diff --git a/.cache/public-page-renderer-prod.js b/.cache/public-page-renderer-prod.js
new file mode 100644
index 0000000..9734692
--- /dev/null
+++ b/.cache/public-page-renderer-prod.js
@@ -0,0 +1,22 @@
+import React from "react"
+import PropTypes from "prop-types"
+
+import InternalPageRenderer from "./page-renderer"
+import loader from "./loader"
+
+const ProdPageRenderer = ({ location }) => {
+ const pageResources = loader.getResourcesForPathnameSync(location.pathname)
+ return React.createElement(InternalPageRenderer, {
+ location,
+ pageResources,
+ ...pageResources.json,
+ })
+}
+
+ProdPageRenderer.propTypes = {
+ location: PropTypes.shape({
+ pathname: PropTypes.string.isRequired,
+ }).isRequired,
+}
+
+export default ProdPageRenderer
diff --git a/.cache/public-page-renderer.js b/.cache/public-page-renderer.js
new file mode 100644
index 0000000..6a91ada
--- /dev/null
+++ b/.cache/public-page-renderer.js
@@ -0,0 +1,9 @@
+const preferDefault = m => (m && m.default) || m
+
+if (process.env.BUILD_STAGE === `develop`) {
+ module.exports = preferDefault(require(`./public-page-renderer-dev`))
+} else if (process.env.BUILD_STAGE === `build-javascript`) {
+ module.exports = preferDefault(require(`./public-page-renderer-prod`))
+} else {
+ module.exports = () => null
+}
diff --git a/.cache/react-lifecycles-compat.js b/.cache/react-lifecycles-compat.js
new file mode 100644
index 0000000..cc9ce1e
--- /dev/null
+++ b/.cache/react-lifecycles-compat.js
@@ -0,0 +1 @@
+exports.polyfill = Component => Component
diff --git a/.cache/redirects.json b/.cache/redirects.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/.cache/redirects.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/.cache/redux-state.json b/.cache/redux-state.json
new file mode 100644
index 0000000..b0b3b9c
--- /dev/null
+++ b/.cache/redux-state.json
@@ -0,0 +1,393 @@
+{
+ "nodes": {
+ "SitePage /dev-404-page/": {
+ "path": "/dev-404-page/",
+ "id": "SitePage /dev-404-page/",
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "type": "SitePage",
+ "contentDigest": "f91d29e10ba680b413138cf9ed86e655",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin dev-404-page": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/dev-404-page",
+ "id": "Plugin dev-404-page",
+ "name": "dev-404-page",
+ "version": "1.0.0",
+ "pluginOptions": {
+ "plugins": []
+ },
+ "nodeAPIs": [
+ "createPagesStatefully"
+ ],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/dev-404-page",
+ "packageJson": {
+ "name": "dev-404-page",
+ "description": "Internal plugin to add a 404 page in development with helpful information",
+ "version": "1.0.0",
+ "main": "index.js",
+ "author": "Kyle Mathews ",
+ "license": "MIT",
+ "dependencies": [],
+ "devDependencies": [],
+ "peerDependencies": [],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "98e58c24a731712c2835f333c0cc306a",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin load-babel-config": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/load-babel-config",
+ "id": "Plugin load-babel-config",
+ "name": "load-babel-config",
+ "version": "1.0.0",
+ "pluginOptions": {
+ "plugins": []
+ },
+ "nodeAPIs": [
+ "onPreBootstrap"
+ ],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/load-babel-config",
+ "packageJson": {
+ "name": "load-babel-config",
+ "description": "Internal plugin that handles loading Babel configs",
+ "version": "1.0.0",
+ "main": "index.js",
+ "author": "Kyle Mathews ",
+ "license": "MIT",
+ "dependencies": [],
+ "devDependencies": [],
+ "peerDependencies": [],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "eeb386f7c7ff4c5547a31f6e61a940d0",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin internal-data-bridge": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/internal-data-bridge",
+ "id": "Plugin internal-data-bridge",
+ "name": "internal-data-bridge",
+ "version": "1.0.0",
+ "pluginOptions": {
+ "plugins": []
+ },
+ "nodeAPIs": [
+ "sourceNodes",
+ "onCreatePage"
+ ],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/internal-data-bridge",
+ "packageJson": {
+ "name": "internal-data-bridge",
+ "description": "An internal Gatsby plugin which creates data nodes from internal data",
+ "version": "1.0.0",
+ "main": "index.js",
+ "author": "Kyle Mathews ",
+ "license": "MIT",
+ "dependencies": [],
+ "devDependencies": [],
+ "peerDependencies": [],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "0bf0d8c2e85a78a5db732f8cb2907051",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin prod-404": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/prod-404",
+ "id": "Plugin prod-404",
+ "name": "prod-404",
+ "version": "1.0.0",
+ "pluginOptions": {
+ "plugins": []
+ },
+ "nodeAPIs": [
+ "onCreatePage"
+ ],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/prod-404",
+ "packageJson": {
+ "name": "prod-404",
+ "description": "Internal plugin to detect various flavors of 404 pages and ensure there's a 404.html path created as well to ensure compatability with static hosts",
+ "version": "1.0.0",
+ "main": "index.js",
+ "author": "Kyle Mathews ",
+ "license": "MIT",
+ "dependencies": [],
+ "devDependencies": [],
+ "peerDependencies": [],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "7efcc36ce497a9f966387b1e8ca3c806",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin query-runner": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/query-runner",
+ "id": "Plugin query-runner",
+ "name": "query-runner",
+ "version": "1.0.0",
+ "pluginOptions": {
+ "plugins": []
+ },
+ "nodeAPIs": [
+ "onCreatePage"
+ ],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby/dist/internal-plugins/query-runner",
+ "packageJson": {
+ "name": "query-runner",
+ "description": "Internal plugin for running queries",
+ "version": "1.0.0",
+ "main": "index.js",
+ "author": "",
+ "license": "MIT",
+ "dependencies": [],
+ "devDependencies": [],
+ "peerDependencies": [],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "adf19397f3535b8a14eab056245acae7",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin default-site-plugin": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com",
+ "id": "Plugin default-site-plugin",
+ "name": "default-site-plugin",
+ "version": "d41d8cd98f00b204e9800998ecf8427e",
+ "pluginOptions": {
+ "plugins": []
+ },
+ "nodeAPIs": [],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com",
+ "packageJson": {
+ "name": "partialsband.com",
+ "description": "The website for P A R T I A L S, a psychedelic dance band from Athens, Georgia.",
+ "license": "UNLICENSED",
+ "dependencies": [
+ {
+ "name": "@tensorflow/tfjs",
+ "version": "^0.13.0"
+ },
+ {
+ "name": "gatsby",
+ "version": "^2.0.0"
+ },
+ {
+ "name": "react",
+ "version": "^16.5.1"
+ },
+ {
+ "name": "react-dom",
+ "version": "^16.5.1"
+ }
+ ],
+ "devDependencies": [
+ {
+ "name": "prettier",
+ "version": "^1.14.3"
+ },
+ {
+ "name": "standard",
+ "version": "^12.0.1"
+ }
+ ],
+ "peerDependencies": [],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "bbe5f74b117c6b24e86774e3685881e3",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Plugin gatsby-plugin-page-creator": {
+ "resolve": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby-plugin-page-creator",
+ "id": "Plugin gatsby-plugin-page-creator",
+ "name": "gatsby-plugin-page-creator",
+ "version": "2.0.0",
+ "pluginOptions": {
+ "plugins": [],
+ "path": "/Users/noisemachines/dev/partialsband.com/src/pages",
+ "pathCheck": false
+ },
+ "nodeAPIs": [
+ "createPagesStatefully"
+ ],
+ "browserAPIs": [],
+ "ssrAPIs": [],
+ "pluginFilepath": "/Users/noisemachines/dev/partialsband.com/node_modules/gatsby-plugin-page-creator",
+ "packageJson": {
+ "name": "gatsby-plugin-page-creator",
+ "description": "Gatsby plugin that automatically creates pages from React components in specified directories",
+ "version": "2.0.0",
+ "main": "index.js",
+ "keywords": [
+ "gatsby",
+ "gatsby-plugin"
+ ],
+ "author": "Kyle Mathews ",
+ "license": "MIT",
+ "dependencies": [
+ {
+ "name": "@babel/runtime",
+ "version": "^7.0.0"
+ },
+ {
+ "name": "bluebird",
+ "version": "^3.5.0"
+ },
+ {
+ "name": "chokidar",
+ "version": "^1.7.0"
+ },
+ {
+ "name": "fs-exists-cached",
+ "version": "^1.0.0"
+ },
+ {
+ "name": "glob",
+ "version": "^7.1.1"
+ },
+ {
+ "name": "lodash",
+ "version": "^4.17.10"
+ },
+ {
+ "name": "parse-filepath",
+ "version": "^1.0.1"
+ },
+ {
+ "name": "slash",
+ "version": "^1.0.0"
+ }
+ ],
+ "devDependencies": [
+ {
+ "name": "@babel/cli",
+ "version": "^7.0.0"
+ },
+ {
+ "name": "@babel/core",
+ "version": "^7.0.0"
+ },
+ {
+ "name": "cross-env",
+ "version": "^5.0.5"
+ }
+ ],
+ "peerDependencies": [
+ {
+ "name": "gatsby",
+ "version": ">2.0.0-alpha"
+ }
+ ],
+ "optionalDependecies": [],
+ "bundledDependecies": []
+ },
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "b3d7a6129d9870bed7acd69a133e03f8",
+ "type": "SitePlugin",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "Site": {
+ "siteMetadata": {},
+ "pathPrefix": "",
+ "polyfill": true,
+ "buildTime": "2018-09-20T17:50:58.569Z",
+ "id": "Site",
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "contentDigest": "df7c088d20772cc6c091cccb8a728b74",
+ "type": "Site",
+ "owner": "internal-data-bridge"
+ }
+ },
+ "SitePage /": {
+ "jsonName": "index",
+ "internalComponentName": "ComponentIndex",
+ "path": "/",
+ "component": "/Users/noisemachines/dev/partialsband.com/src/pages/index.js",
+ "componentChunkName": "component---src-pages-index-js",
+ "context": {},
+ "pluginCreator___NODE": "Plugin gatsby-plugin-page-creator",
+ "pluginCreatorId": "Plugin gatsby-plugin-page-creator",
+ "componentPath": "/Users/noisemachines/dev/partialsband.com/src/pages/index.js",
+ "id": "SitePage /",
+ "parent": "SOURCE",
+ "children": [],
+ "internal": {
+ "type": "SitePage",
+ "contentDigest": "befe352f9c2828a53b94ca351c31ca35",
+ "description": "Plugin gatsby-plugin-page-creator",
+ "owner": "internal-data-bridge"
+ }
+ }
+ },
+ "status": {
+ "plugins": {},
+ "PLUGINS_HASH": "dfc7a5131d1a8cd44010ccbf24d11d2f"
+ },
+ "componentDataDependencies": {
+ "nodes": {},
+ "connections": {}
+ },
+ "jsonDataPaths": {
+ "index": "173/path---index-6a9-NZuapzHg3X9TaN1iIixfv1W23E",
+ "dev-404-page-5f9": "920/path---dev-404-page-5-f-9-fab-NZuapzHg3X9TaN1iIixfv1W23E",
+ "model-f03": "117/path---model-f-03-947-NZuapzHg3X9TaN1iIixfv1W23E"
+ },
+ "components": {
+ "/Users/noisemachines/dev/partialsband.com/src/pages/index.js": {
+ "query": "",
+ "componentPath": "/Users/noisemachines/dev/partialsband.com/src/pages/index.js"
+ }
+ },
+ "staticQueryComponents": {}
+}
\ No newline at end of file
diff --git a/.cache/register-service-worker.js b/.cache/register-service-worker.js
new file mode 100644
index 0000000..adcdee9
--- /dev/null
+++ b/.cache/register-service-worker.js
@@ -0,0 +1,48 @@
+import { apiRunner } from "./api-runner-browser"
+
+if (`serviceWorker` in navigator) {
+ navigator.serviceWorker
+ .register(`${__PATH_PREFIX__}/sw.js`)
+ .then(function(reg) {
+ reg.addEventListener(`updatefound`, () => {
+ apiRunner(`onServiceWorkerUpdateFound`, { serviceWorker: reg })
+ // The updatefound event implies that reg.installing is set; see
+ // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event
+ const installingWorker = reg.installing
+ console.log(`installingWorker`, installingWorker)
+ installingWorker.addEventListener(`statechange`, () => {
+ switch (installingWorker.state) {
+ case `installed`:
+ if (navigator.serviceWorker.controller) {
+ // At this point, the old content will have been purged and the fresh content will
+ // have been added to the cache.
+ // We set a flag so Gatsby Link knows to refresh the page on next navigation attempt
+ window.GATSBY_SW_UPDATED = true
+ } else {
+ // At this point, everything has been precached.
+ // It's the perfect time to display a "Content is cached for offline use." message.
+ console.log(`Content is now available offline!`)
+
+ // Post to service worker that install is complete.
+ // Delay to allow time for the event listener to be added --
+ // otherwise fetch is called too soon and resources aren't cached.
+ apiRunner(`onServiceWorkerInstalled`, { serviceWorker: reg })
+ }
+ break
+
+ case `redundant`:
+ console.error(`The installing service worker became redundant.`)
+ apiRunner(`onServiceWorkerRedundant`, { serviceWorker: reg })
+ break
+
+ case `activated`:
+ apiRunner(`onServiceWorkerActive`, { serviceWorker: reg })
+ break
+ }
+ })
+ })
+ })
+ .catch(function(e) {
+ console.error(`Error during service worker registration:`, e)
+ })
+}
diff --git a/.cache/root.js b/.cache/root.js
new file mode 100644
index 0000000..6f2651f
--- /dev/null
+++ b/.cache/root.js
@@ -0,0 +1,110 @@
+import React, { createElement } from "react"
+import { Router } from "@reach/router"
+import { ScrollContext } from "gatsby-react-router-scroll"
+import { shouldUpdateScroll, init as navigationInit } from "./navigation"
+import { apiRunner } from "./api-runner-browser"
+import syncRequires from "./sync-requires"
+import pages from "./pages.json"
+import loader from "./loader"
+import JSONStore from "./json-store"
+import EnsureResources from "./ensure-resources"
+
+import * as ErrorOverlay from "react-error-overlay"
+
+// Report runtime errors
+ErrorOverlay.startReportingRuntimeErrors({
+ onError: () => {},
+ filename: `/commons.js`,
+})
+ErrorOverlay.setEditorHandler(errorLocation =>
+ window.fetch(
+ `/__open-stack-frame-in-editor?fileName=` +
+ window.encodeURIComponent(errorLocation.fileName) +
+ `&lineNumber=` +
+ window.encodeURIComponent(errorLocation.lineNumber || 1)
+ )
+)
+
+if (window.__webpack_hot_middleware_reporter__ !== undefined) {
+ // Report build errors
+ window.__webpack_hot_middleware_reporter__.useCustomOverlay({
+ showProblems(type, obj) {
+ if (type !== `errors`) {
+ ErrorOverlay.dismissBuildError()
+ return
+ }
+ ErrorOverlay.reportBuildError(obj[0])
+ },
+ clear() {
+ ErrorOverlay.dismissBuildError()
+ },
+ })
+}
+
+navigationInit()
+
+class RouteHandler extends React.Component {
+ render() {
+ let { location } = this.props
+ let child
+
+ // check if page exists - in dev pages are sync loaded, it's safe to use
+ // loader.getPage
+ let page = loader.getPage(location.pathname)
+
+ if (page) {
+ child = (
+
+ {locationAndPageResources => (
+
+ )}
+
+ )
+ } else {
+ const dev404Page = pages.find(p => /^\/dev-404-page\/$/.test(p.path))
+ child = createElement(
+ syncRequires.components[dev404Page.componentChunkName],
+ {
+ pages,
+ ...this.props,
+ }
+ )
+ }
+
+ return (
+
+ {child}
+
+ )
+ }
+}
+
+const Root = () =>
+ createElement(
+ Router,
+ {
+ basepath: __PATH_PREFIX__,
+ },
+ createElement(RouteHandler, { path: `/*` })
+ )
+
+// Let site, plugins wrap the site e.g. for Redux.
+const WrappedRoot = apiRunner(
+ `wrapRootElement`,
+ { element: },
+ ,
+ ({ result, plugin }) => {
+ return { element: result }
+ }
+).pop()
+
+export default () => WrappedRoot
diff --git a/.cache/socketIo.js b/.cache/socketIo.js
new file mode 100644
index 0000000..799b08c
--- /dev/null
+++ b/.cache/socketIo.js
@@ -0,0 +1,93 @@
+let socket = null
+
+let staticQueryData = {}
+let pageQueryData = {}
+let isInitialized = false
+
+export const getStaticQueryData = () => staticQueryData
+export const getPageQueryData = () => pageQueryData
+export const getIsInitialized = () => isInitialized
+
+export default function socketIo() {
+ if (process.env.NODE_ENV !== `production`) {
+ if (!socket) {
+ // Try to initialize web socket if we didn't do it already
+ try {
+ // eslint-disable-next-line no-undef
+ socket = io()
+
+ const didDataChange = (msg, queryData) =>
+ !(msg.payload.id in queryData) ||
+ JSON.stringify(msg.payload.result) !==
+ JSON.stringify(queryData[msg.payload.id])
+
+ socket.on(`message`, msg => {
+ if (msg.type === `staticQueryResult`) {
+ if (didDataChange(msg, staticQueryData)) {
+ staticQueryData = {
+ ...staticQueryData,
+ [msg.payload.id]: msg.payload.result,
+ }
+ }
+ }
+ if (msg.type === `pageQueryResult`) {
+ if (didDataChange(msg, pageQueryData)) {
+ pageQueryData = {
+ ...pageQueryData,
+ [msg.payload.id]: msg.payload.result,
+ }
+ }
+ }
+ if (msg.type && msg.payload) {
+ ___emitter.emit(msg.type, msg.payload)
+ }
+ })
+ } catch (err) {
+ console.error(`Could not connect to socket.io on dev server.`)
+ }
+ }
+ return socket
+ } else {
+ return null
+ }
+}
+
+const inFlightGetPageDataPromiseCache = {}
+function getPageData(pathname) {
+ if (inFlightGetPageDataPromiseCache[pathname]) {
+ return inFlightGetPageDataPromiseCache[pathname]
+ } else {
+ inFlightGetPageDataPromiseCache[pathname] = new Promise(resolve => {
+ if (pageQueryData[pathname]) {
+ delete inFlightGetPageDataPromiseCache[pathname]
+ resolve(pageQueryData[pathname])
+ } else {
+ const onPageDataCallback = msg => {
+ if (msg.type === `pageQueryResult` && msg.payload.id === pathname) {
+ socket.off(`message`, onPageDataCallback)
+ delete inFlightGetPageDataPromiseCache[pathname]
+ resolve(pageQueryData[pathname])
+ }
+ }
+ socket.on(`message`, onPageDataCallback)
+
+ socket.emit(`getDataForPath`, pathname)
+ }
+ })
+ }
+ return inFlightGetPageDataPromiseCache[pathname]
+}
+
+// Tell websocket-manager.js the new path we're on.
+// This will help the backend prioritize queries for this
+// path.
+function registerPath(path) {
+ socket.emit(`registerPath`, path)
+}
+
+// Unregister the former path
+function unregisterPath(path) {
+ socket.emit(`unregisterPath`, path)
+}
+
+export { getPageData, registerPath, unregisterPath }
diff --git a/.cache/static-entry.js b/.cache/static-entry.js
new file mode 100644
index 0000000..66b3bf8
--- /dev/null
+++ b/.cache/static-entry.js
@@ -0,0 +1,385 @@
+const React = require(`react`)
+const fs = require(`fs`)
+const { join } = require(`path`)
+const { renderToString, renderToStaticMarkup } = require(`react-dom/server`)
+const { ServerLocation, Router, isRedirect } = require(`@reach/router`)
+const { get, merge, isObject, flatten, uniqBy } = require(`lodash`)
+
+const apiRunner = require(`./api-runner-ssr`)
+const syncRequires = require(`./sync-requires`)
+const { dataPaths, pages } = require(`./data.json`)
+const { version: gatsbyVersion } = require(`gatsby/package.json`)
+
+// Speed up looking up pages.
+const pagesObjectMap = new Map()
+pages.forEach(p => pagesObjectMap.set(p.path, p))
+
+const stats = JSON.parse(
+ fs.readFileSync(`${process.cwd()}/public/webpack.stats.json`, `utf-8`)
+)
+
+const chunkMapping = JSON.parse(
+ fs.readFileSync(`${process.cwd()}/public/chunk-map.json`, `utf-8`)
+)
+
+// const testRequireError = require("./test-require-error")
+// For some extremely mysterious reason, webpack adds the above module *after*
+// this module so that when this code runs, testRequireError is undefined.
+// So in the meantime, we'll just inline it.
+const testRequireError = (moduleName, err) => {
+ const regex = new RegExp(`Error: Cannot find module\\s.${moduleName}`)
+ const firstLine = err.toString().split(`\n`)[0]
+ return regex.test(firstLine)
+}
+
+let Html
+try {
+ Html = require(`../src/html`)
+} catch (err) {
+ if (testRequireError(`../src/html`, err)) {
+ Html = require(`./default-html`)
+ } else {
+ throw err
+ }
+}
+
+Html = Html && Html.__esModule ? Html.default : Html
+
+const getPage = path => pagesObjectMap.get(path)
+
+const createElement = React.createElement
+
+export default (pagePath, callback) => {
+ let bodyHtml = ``
+ let headComponents = [
+
+ ]
+ let htmlAttributes = {}
+ let bodyAttributes = {}
+ let preBodyComponents = []
+ let postBodyComponents = []
+ let bodyProps = {}
+
+ const replaceBodyHTMLString = body => {
+ bodyHtml = body
+ }
+
+ const setHeadComponents = components => {
+ headComponents = headComponents.concat(components)
+ }
+
+ const setHtmlAttributes = attributes => {
+ htmlAttributes = merge(htmlAttributes, attributes)
+ }
+
+ const setBodyAttributes = attributes => {
+ bodyAttributes = merge(bodyAttributes, attributes)
+ }
+
+ const setPreBodyComponents = components => {
+ preBodyComponents = preBodyComponents.concat(components)
+ }
+
+ const setPostBodyComponents = components => {
+ postBodyComponents = postBodyComponents.concat(components)
+ }
+
+ const setBodyProps = props => {
+ bodyProps = merge({}, bodyProps, props)
+ }
+
+ const getHeadComponents = () => headComponents
+
+ const replaceHeadComponents = components => {
+ headComponents = components
+ }
+
+ const getPreBodyComponents = () => preBodyComponents
+
+ const replacePreBodyComponents = components => {
+ preBodyComponents = components
+ }
+
+ const getPostBodyComponents = () => postBodyComponents
+
+ const replacePostBodyComponents = components => {
+ postBodyComponents = components
+ }
+
+ const page = getPage(pagePath)
+
+ let dataAndContext = {}
+ if (page.jsonName in dataPaths) {
+ const pathToJsonData = `../public/` + dataPaths[page.jsonName]
+ try {
+ dataAndContext = JSON.parse(
+ fs.readFileSync(
+ `${process.cwd()}/public/static/d/${dataPaths[page.jsonName]}.json`
+ )
+ )
+ } catch (e) {
+ console.log(`error`, pathToJsonData, e)
+ process.exit()
+ }
+ }
+
+ class RouteHandler extends React.Component {
+ render() {
+ const props = {
+ ...this.props,
+ ...dataAndContext,
+ pathContext: dataAndContext.pageContext,
+ }
+
+ const pageElement = createElement(
+ syncRequires.components[page.componentChunkName],
+ props
+ )
+
+ const wrappedPage = apiRunner(
+ `wrapPageElement`,
+ { element: pageElement, props },
+ pageElement,
+ ({ result }) => {
+ return { element: result, props }
+ }
+ ).pop()
+
+ return wrappedPage
+ }
+ }
+
+ const routerElement = createElement(
+ ServerLocation,
+ { url: `${__PATH_PREFIX__}${pagePath}` },
+ createElement(
+ Router,
+ {
+ baseuri: `${__PATH_PREFIX__}`,
+ },
+ createElement(RouteHandler, { path: `/*` })
+ )
+ )
+
+ const bodyComponent = apiRunner(
+ `wrapRootElement`,
+ { element: routerElement },
+ routerElement,
+ ({ result }) => {
+ return { element: result }
+ }
+ ).pop()
+
+ // Let the site or plugin render the page component.
+ apiRunner(`replaceRenderer`, {
+ bodyComponent,
+ replaceBodyHTMLString,
+ setHeadComponents,
+ setHtmlAttributes,
+ setBodyAttributes,
+ setPreBodyComponents,
+ setPostBodyComponents,
+ setBodyProps,
+ })
+
+ // If no one stepped up, we'll handle it.
+ if (!bodyHtml) {
+ try {
+ bodyHtml = renderToString(bodyComponent)
+ } catch (e) {
+ // ignore @reach/router redirect errors
+ if (!isRedirect(e)) throw e
+ }
+ }
+
+ // Create paths to scripts
+ let scriptsAndStyles = flatten(
+ [`app`, page.componentChunkName].map(s => {
+ const fetchKey = `assetsByChunkName[${s}]`
+
+ let chunks = get(stats, fetchKey)
+ let namedChunkGroups = get(stats, `namedChunkGroups`)
+
+ if (!chunks) {
+ return null
+ }
+
+ chunks = chunks.map(chunk => {
+ if (chunk === `/`) {
+ return null
+ }
+ return { rel: `preload`, name: chunk }
+ })
+
+ namedChunkGroups[s].assets.forEach(asset =>
+ chunks.push({ rel: `preload`, name: asset })
+ )
+
+ const childAssets = namedChunkGroups[s].childAssets
+ for (const rel in childAssets) {
+ chunks = merge(
+ chunks,
+ childAssets[rel].map(chunk => {
+ return { rel, name: chunk }
+ })
+ )
+ }
+
+ return chunks
+ })
+ )
+ .filter(s => isObject(s))
+ .sort((s1, s2) => (s1.rel == `preload` ? -1 : 1)) // given priority to preload
+
+ scriptsAndStyles = uniqBy(scriptsAndStyles, item => item.name)
+
+ const scripts = scriptsAndStyles.filter(
+ script => script.name && script.name.endsWith(`.js`)
+ )
+ const styles = scriptsAndStyles.filter(
+ style => style.name && style.name.endsWith(`.css`)
+ )
+
+ apiRunner(`onRenderBody`, {
+ setHeadComponents,
+ setHtmlAttributes,
+ setBodyAttributes,
+ setPreBodyComponents,
+ setPostBodyComponents,
+ setBodyProps,
+ pathname: pagePath,
+ bodyHtml,
+ scripts,
+ styles,
+ pathPrefix: __PATH_PREFIX__,
+ })
+
+ scripts
+ .slice(0)
+ .reverse()
+ .forEach(script => {
+ // Add preload/prefetch s for scripts.
+ headComponents.push(
+
+ )
+ })
+
+ if (page.jsonName in dataPaths) {
+ const dataPath = `${__PATH_PREFIX__}/static/d/${
+ dataPaths[page.jsonName]
+ }.json`
+ headComponents.push(
+
+ )
+ }
+
+ styles
+ .slice(0)
+ .reverse()
+ .forEach(style => {
+ // Add s for styles that should be prefetched
+ // otherwise, inline as a