Skip to content

Commit e7ad98d

Browse files
authored
[1.0] Refactor data layer (gatsbyjs#818)
* Refactor data layer * new node schema w/ "content digest" required instead of ad hoc "hash" key * New cache module for typegen plugins to cache their data * Save and restore node data state * rename 'parser' plugins to 'transformer' * Update tests + add basic tests for gatsby-transformer-json * Add simple tests for yaml transformation * Add a test for transformer-sharp * Rename function * Add test for transformer-remark * Build and copy over built src to websites when building them so they're truely running from HEAD * Require the HTML component from the new src directory * Make imports relative + remove gatsby-helpers * Move fonts from the static directory to the src directory since we import with webpack * Correct path
1 parent c95be69 commit e7ad98d

File tree

116 files changed

+1828
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+1828
-709
lines changed

docs/blog/gatsbygram-case-study/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,10 @@ module.exports = {
442442
// several other plugins.
443443
`gatsby-plugin-sharp`,
444444
// This plugin identifies file nodes that are images and
445-
// extends these to create new "ImageSharp" nodes.
446-
`gatsby-parser-sharp`,
447-
// This plugin parses JSON file nodes.
448-
`gatsby-parser-json`,
445+
// transforms these to create new ImageSharp nodes.
446+
`gatsby-transformer-sharp`,
447+
// This plugin transforms JSON file nodes.
448+
`gatsby-transformer-json`,
449449
`gatsby-typegen-filesystem`,
450450
// This plugin adds GraphQL fields to the ImageSharp
451451
// GraphQL type. With them you can resize images and

examples/gatsbygram/gatsby-config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ module.exports = {
2828
// several other plugins.
2929
`gatsby-plugin-sharp`,
3030
// This plugin identifies file nodes that are images and
31-
// extends these to create new “ImageSharp” nodes.
32-
`gatsby-parser-sharp`,
33-
// This plugin parses JSON file nodes.
34-
`gatsby-parser-json`,
31+
// transforms these to create new “ImageSharp” nodes.
32+
`gatsby-transformer-sharp`,
33+
// This plugin transforms JSON file nodes.
34+
`gatsby-transformer-json`,
3535
`gatsby-typegen-filesystem`,
3636
// This plugin adds GraphQL fields to the ImageSharp
3737
// GraphQL type. With them you can resize images and

examples/gatsbygram/gatsby-node.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const slash = require("slash")
88
// called after the Gatsby bootstrap is finished so you have
99
// access to any information necessary to programatically
1010
// create pages.
11-
exports.createPages = ({ graphql, actionCreators }) => {
12-
const { upsertPage } = actionCreators
11+
exports.createPages = ({ graphql, boundActionCreators }) => {
12+
const { upsertPage } = boundActionCreators
1313

1414
return new Promise((resolve, reject) => {
1515
// The “graphql” function allows us to run arbitrary

examples/gatsbygram/package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55
"version": "1.0.0",
66
"author": "Kyle Mathews <[email protected]>",
77
"dependencies": {
8-
"gatsby": "1.0.0-alpha12-alpha.1fdb9004",
9-
"gatsby-link": "1.0.0-alpha12-alpha.1fdb9004",
10-
"gatsby-parser-json": "1.0.0-alpha12-alpha.1fdb9004",
11-
"gatsby-parser-sharp": "1.0.0-alpha12-alpha.1fdb9004",
12-
"gatsby-plugin-glamor": "1.0.0-alpha12-alpha.1fdb9004",
13-
"gatsby-plugin-google-analytics": "^1.0.0-alpha12-alpha.1fdb9004",
14-
"gatsby-plugin-manifest": "1.0.0-alpha12-alpha.1fdb9004",
15-
"gatsby-plugin-offline": "1.0.0-alpha12-alpha.1fdb9004",
16-
"gatsby-plugin-sharp": "1.0.0-alpha12-alpha.1fdb9004",
17-
"gatsby-source-filesystem": "1.0.0-alpha12-alpha.1fdb9004",
18-
"gatsby-typegen-filesystem": "1.0.0-alpha12-alpha.1fdb9004",
19-
"gatsby-typegen-sharp": "1.0.0-alpha12-alpha.1fdb9004",
8+
"gatsby": "1.0.0-alpha12-alpha.51e1923f",
9+
"gatsby-link": "1.0.0-alpha12-alpha.51e1923f",
10+
"gatsby-transformer-json": "1.0.0-alpha12-alpha.51e1923f",
11+
"gatsby-transformer-sharp": "1.0.0-alpha12-alpha.51e1923f",
12+
"gatsby-plugin-glamor": "1.0.0-alpha12-alpha.51e1923f",
13+
"gatsby-plugin-google-analytics": "^1.0.0-alpha12-alpha.51e1923f",
14+
"gatsby-plugin-manifest": "1.0.0-alpha12-alpha.51e1923f",
15+
"gatsby-plugin-offline": "1.0.0-alpha12-alpha.51e1923f",
16+
"gatsby-plugin-sharp": "1.0.0-alpha12-alpha.51e1923f",
17+
"gatsby-source-filesystem": "1.0.0-alpha12-alpha.51e1923f",
18+
"gatsby-typegen-filesystem": "1.0.0-alpha12-alpha.51e1923f",
19+
"gatsby-typegen-sharp": "1.0.0-alpha12-alpha.51e1923f",
2020
"instagram-screen-scrape": "^2.0.0",
2121
"lodash": "^4.16.4",
2222
"mkdirp": "^0.5.1",
2323
"mousetrap": "^1.6.0",
2424
"progress": "^1.1.8",
2525
"react-gravatar": "^2.6.1",
2626
"react-icons": "^2.2.3",
27-
"react-modal": "^1.6.5",
27+
"react-modal": "^1.7.6",
2828
"react-typography": "^0.15.0",
2929
"request": "^2.79.0",
3030
"slug": "^0.9.1",

examples/gatsbygram/src/html.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from "react"
22
import DocumentTitle from "react-document-title"
3-
4-
//import { prefixLink } from 'gatsby-helpers'
53
import { GoogleFont, TypographyStyle } from "react-typography"
4+
65
import typography from "./utils/typography"
76
import logo from "!file-loader!../static/images/logo.png"
87

examples/gatsbygram/src/pages/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class Index extends React.Component {
5151
}
5252

5353
render() {
54+
console.log(this.props)
5455
this.context.setEdges(this.props.data.allPosts.edges)
5556
return (
5657
<div

0 commit comments

Comments
 (0)