Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Update examples in v2 branch #5598

Closed
camsjams opened this issue May 30, 2018 · 12 comments
Closed

[v2] Update examples in v2 branch #5598

camsjams opened this issue May 30, 2018 · 12 comments
Assignees
Labels
help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@camsjams
Copy link
Contributor

Summary

Some of the examples in the v2 branch https://github.com/gatsbyjs/gatsby/tree/v2/examples

Have package.json versions pointed at latest instead of next - is this intentional?

Examples include:
https://github.com/gatsbyjs/gatsby/blob/v2/examples/using-styled-components/package.json
https://github.com/gatsbyjs/gatsby/blob/v2/examples/using-redux/package.json

@m-allanson m-allanson added help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change labels May 30, 2018
@m-allanson
Copy link
Contributor

Upgrading the examples is still a work in progress - any help would be very welcome!

Although note that the v2 upgrade guide hasn't been written yet, so you'll need to rely on checking how other examples have been changed and the placeholder breaking changes list.

If anyone wants to take any of these on, I'm happy to provide any guidance needed.

@pieh pieh changed the title [v2] Update examples in v2 branch to utilize v2 code? [v2] Update examples in v2 branch May 30, 2018
@pieh
Copy link
Contributor

pieh commented May 30, 2018

I added this issue to v2 project, so people can discover it easier if they want to help out on v2

@webwurst
Copy link

It would be nice to have a list of already ported and yet to be done examples :)

@m-allanson
Copy link
Contributor

A list would be excellent - would you like to make one and and add it here?

You can check the package.json of each example to see which ones have been upgraded. For examples running on v2, their Gatsby dependencies will be using the next version and have react and react-dom included:

"gatsby": "next",
"gatsby-image": "next",
"gatsby-plugin-google-analytics": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-sharp": "next",
"gatsby-plugin-typography": "next",
"gatsby-source-drupal": "next",
"gatsby-source-filesystem": "next",
"gatsby-transformer-sharp": "next",
"react": "^16.4.0",
"react-dom": "^16.4.0",

Examples running on v1 will have different version numbers and no react or react-dom:

"gatsby": "latest",
"gatsby-plugin-google-analytics": "^1.0.12",
"gatsby-plugin-offline": "^1.0.10",
"gatsby-plugin-react-helmet": "^2.0.1",
"gatsby-plugin-sharp": "latest",
"gatsby-plugin-typography": "latest",
"gatsby-remark-copy-linked-files": "latest",
"gatsby-remark-images": "latest",
"gatsby-remark-prismjs": "latest",
"gatsby-remark-responsive-iframe": "latest",
"gatsby-remark-smartypants": "latest",
"gatsby-source-filesystem": "latest",
"gatsby-transformer-remark": "latest",
"gatsby-transformer-sharp": "latest",

@m-allanson
Copy link
Contributor

m-allanson commented May 31, 2018

Oh and there's a work-in-progress migration guide at https://github.com/gatsbyjs/gatsby/blob/v2/docs/docs/migrating-from-v1-to-v2.md

@webwurst
Copy link

webwurst commented Jun 1, 2018

@piotrkwiecinski
Copy link
Contributor

I could probably grab sitemap one for start :). Happy to help

@m-allanson
Copy link
Contributor

😍 for all the pull requests updating these examples. Keep 'em coming :)

@piotrkwiecinski
Copy link
Contributor

RSS feed one has similar issue as sitemap. It's quite basic. I'll try to PR extended version to master first over the weekend.

@ryanditjia
Copy link
Contributor

I’m getting errors with source-hacker-news.

⠠ source and transform nodesfetch HN data: 17699.665ms
success source and transform nodes — 23.070 s
error UNHANDLED REJECTION


  TypeError: Cannot read property 'internal' of undefined

 - build-node-types.js:85 _.flatMap.groupBy.node
    [project-name]/[gatsby]/dist/schema/build-node-typ    es.js:85:55

  - lodash.js:489 arrayAggregator
    [project-name]/[lodash]/lodash.js:489:34

  - lodash.js:4835 Function.groupBy
    [project-name]/[lodash]/lodash.js:4835:16

  - lodash.js:4380
    [project-name]/[lodash]/lodash.js:4380:28

  - lodash.js:675 arrayReduce
    [project-name]/[lodash]/lodash.js:675:21

  - lodash.js:4379 baseWrapperValue
    [project-name]/[lodash]/lodash.js:4379:14

  - lodash.js:9042 LodashWrapper.wrapperValue
    [project-name]/[lodash]/lodash.js:9042:14

  - build-node-types.js:85 createNodeFields
    [project-name]/[gatsby]/dist/schema/build-node-typ    es.js:85:111

  - build-node-types.js:171 fields
    [project-name]/[gatsby]/dist/schema/build-node-typ    es.js:171:23

  - Array.forEach

  npm ERR!

@ajayns
Copy link
Contributor

ajayns commented Jun 11, 2018

@ryanditjia I'm getting the same errors. Looks like an issue with the plugin itself.

Also, going through using-javascript-transforms example, I'm unsure of what's going wrong but looks like it keeps throwing exports is undefined errors.

@m-allanson
Copy link
Contributor

Thanks everyone for your help with this issue 🎉 Marking this as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

No branches or pull requests

7 participants