Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gatsbyjs/gatsby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 135e554aa9e8f10a282983eca65c29ffae738339
Choose a base ref
...
head repository: gatsbyjs/gatsby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3d607f1ae0cdde12fb8de53e6d0784f83875df25
Choose a head ref

Commits on Nov 10, 2020

  1. chore(release): Publish pre-release

     - babel-plugin-remove-graphql-queries@2.11.0-next.0
     - babel-preset-gatsby-package@0.7.0-next.0
     - babel-preset-gatsby@0.7.0-next.0
     - gatsby-admin@0.3.0-next.0
     - gatsby-cli@2.14.0-next.0
     - gatsby-codemods@1.5.0-next.0
     - gatsby-core-utils@1.5.0-next.0
     - gatsby-cypress@0.6.0-next.0
     - gatsby-design-tokens@2.2.0-next.0
     - gatsby-dev-cli@2.9.0-next.0
     - gatsby-graphiql-explorer@0.6.0-next.0
     - gatsby-image@2.6.0-next.0
     - gatsby-legacy-polyfills@0.2.0-next.0
     - gatsby-link@2.6.0-next.0
     - gatsby-page-utils@0.4.0-next.0
     - gatsby-plugin-benchmark-reporting@0.4.0-next.0
     - gatsby-plugin-canonical-urls@2.5.0-next.0
     - gatsby-plugin-catch-links@2.5.0-next.0
     - gatsby-plugin-coffeescript@2.5.0-next.0
     - gatsby-plugin-create-client-paths@2.5.0-next.0
     - gatsby-plugin-cxs@2.5.0-next.0
     - gatsby-plugin-emotion@4.5.0-next.0
     - gatsby-plugin-facebook-analytics@2.6.0-next.0
     - gatsby-plugin-feed@2.8.0-next.0
     - gatsby-plugin-flow@1.5.0-next.0
     - gatsby-plugin-fullstory@2.5.0-next.0
     - gatsby-plugin-glamor@2.5.0-next.0
     - gatsby-plugin-google-analytics@2.6.0-next.0
     - gatsby-plugin-google-gtag@2.3.0-next.0
     - gatsby-plugin-google-tagmanager@2.6.0-next.0
     - gatsby-plugin-graphql-config@0.2.0-next.0
     - gatsby-plugin-guess-js@1.5.0-next.0
     - gatsby-plugin-image@0.2.0-next.0
     - gatsby-plugin-jss@2.5.0-next.0
     - gatsby-plugin-layout@1.5.0-next.0
     - gatsby-plugin-less@4.2.0-next.0
     - gatsby-plugin-lodash@3.5.0-next.0
     - gatsby-plugin-manifest@2.7.0-next.0
     - gatsby-plugin-mdx@1.5.0-next.0
     - gatsby-plugin-netlify-cms@4.5.0-next.0
     - gatsby-plugin-netlify@2.6.0-next.0
     - gatsby-plugin-no-sourcemaps@2.4.0-next.0
     - gatsby-plugin-nprogress@2.5.0-next.0
     - gatsby-plugin-offline@3.5.0-next.0
     - gatsby-plugin-page-creator@2.5.0-next.0
     - gatsby-plugin-postcss@3.2.0-next.0
     - gatsby-plugin-preact@4.2.0-next.0
     - gatsby-plugin-preload-fonts@1.4.0-next.0
     - gatsby-plugin-react-css-modules@2.5.0-next.0
     - gatsby-plugin-react-helmet@3.5.0-next.0
     - gatsby-plugin-remove-trailing-slashes@2.5.0-next.0
     - gatsby-plugin-sass@2.6.0-next.0
     - gatsby-plugin-schema-snapshot@1.2.0-next.0
     - gatsby-plugin-sharp@2.9.0-next.0
     - gatsby-plugin-sitemap@2.7.0-next.0
     - gatsby-plugin-styled-components@3.5.0-next.0
     - gatsby-plugin-styled-jsx@3.5.0-next.0
     - gatsby-plugin-styletron@5.2.0-next.0
     - gatsby-plugin-stylus@2.5.0-next.0
     - gatsby-plugin-subfont@2.4.0-next.0
     - gatsby-plugin-twitter@2.5.0-next.0
     - gatsby-plugin-typescript@2.7.0-next.0
     - gatsby-plugin-typography@2.7.0-next.0
     - gatsby-plugin-utils@0.4.0-next.0
     - gatsby-react-router-scroll@3.2.0-next.0
     - gatsby-recipes@0.4.0-next.0
     - gatsby-remark-autolink-headers@2.6.0-next.0
     - gatsby-remark-code-repls@3.4.0-next.0
     - gatsby-remark-copy-linked-files@2.5.0-next.0
     - gatsby-remark-custom-blocks@2.5.0-next.0
     - gatsby-remark-embed-snippet@4.5.0-next.0
     - gatsby-remark-graphviz@1.5.0-next.0
     - gatsby-remark-images-contentful@2.5.0-next.0
     - gatsby-remark-images@3.6.0-next.0
     - gatsby-remark-katex@3.5.0-next.0
     - gatsby-remark-prismjs@3.8.0-next.0
     - gatsby-remark-responsive-iframe@2.6.0-next.0
     - gatsby-remark-smartypants@2.5.0-next.0
     - gatsby-source-contentful@4.1.0-next.0
     - gatsby-source-drupal@3.8.0-next.0
     - gatsby-source-faker@2.5.0-next.0
     - gatsby-source-filesystem@2.6.0-next.0
     - gatsby-source-graphql@2.9.0-next.0
     - gatsby-source-hacker-news@2.6.0-next.0
     - gatsby-source-lever@2.5.0-next.0
     - gatsby-source-medium@2.5.0-next.0
     - gatsby-source-mongodb@2.5.0-next.0
     - gatsby-source-npm-package-search@2.5.0-next.0
     - gatsby-source-shopify@3.5.0-next.0
     - gatsby-source-wikipedia@2.5.0-next.0
     - gatsby-source-wordpress@3.6.0-next.0
     - gatsby-telemetry@1.5.0-next.0
     - gatsby-theme@0.3.0-next.0
     - gatsby-transformer-asciidoc@1.5.0-next.0
     - gatsby-transformer-csv@2.5.0-next.0
     - gatsby-transformer-documentationjs@4.5.0-next.0
     - gatsby-transformer-excel@2.6.0-next.0
     - gatsby-transformer-hjson@2.6.0-next.0
     - gatsby-transformer-javascript-frontmatter@2.5.0-next.0
     - gatsby-transformer-javascript-static-exports@2.6.0-next.0
     - gatsby-transformer-json@2.6.0-next.0
     - gatsby-transformer-pdf@1.5.0-next.0
     - gatsby-transformer-react-docgen@5.4.0-next.0
     - gatsby-transformer-remark@2.11.0-next.0
     - gatsby-transformer-screenshot@2.5.0-next.0
     - gatsby-transformer-sharp@2.7.0-next.0
     - gatsby-transformer-sqip@2.6.0-next.0
     - gatsby-transformer-toml@2.6.0-next.0
     - gatsby-transformer-xml@2.5.0-next.0
     - gatsby-transformer-yaml@2.6.0-next.0
     - gatsby@2.27.0-next.0
    vladar committed Nov 10, 2020
    Copy the full SHA
    3ed71f9 View commit details
  2. fix(gatsby-transformer-asciidoc): fails when doc doesn't have title (#…

    …27865)
    
    * title field is optional, so check if it exists
    
    * previous commit did not check for existence of title correctly, fixed
    jerrydevs authored Nov 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ce43564 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a98ca49 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5e2b3ee View commit details

Commits on Nov 11, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c6d754a View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    172cb10 View commit details
  3. pref(gatsby-plugin-mdx): add lessBabel option, 40% perf win (#27941)

    * pref(gatsby-plugin-mdx): add lessBabel option, 40% perf win
    
    * clean up
    
    * Add e2e tests with the lessBabel option
    
    * Add `lessBabel` option to other mdx tests where relevant
    pvdz authored Nov 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3c4069f View commit details
  4. feat(gatsby-recipes): add Chakra UI recipe (#27721)

    * feat(gatsby-recipes): add Chakra UI recipe
    
    * feat(gatsby-recipes): Add Chakra UI recipe to menu
    
    * fix: revert to use GatsbyShadowFile
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    
    * fix: remove unused code
    
    Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
    shoxton and KyleAMathews authored Nov 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d0c94e9 View commit details
  5. Added snipcart recipe to gatsby-recipes package

    Francis Cote authored and KyleAMathews committed Nov 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    642876d View commit details
  6. Fixed typo and formating in snipcart.mdx recipe file

    Francis Cote authored and KyleAMathews committed Nov 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6ad8120 View commit details
  7. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e4aeff5 View commit details

Commits on Nov 12, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c7af18d View commit details
  2. perf(gatsby): pull in cache lib and change lock from fs to mem (#27873)

    * Inline the fs cache handler
    
    Imported from https://github.com/rolandstarke/node-cache-manager-fs-hash with applied prettier/eslint styles (no manual fixes).
    
    We already use this from https://github.com/rolandstarke/node-cache-manager-fs-hash but we need to pull it in in order to subdue the fs-based locking mechanism and replace it for an in-memory lock.
    
    * Satisfy TS checker
    
    * perf(gatsby): replace fs-based lock with in-memory lock
    
    * Remove dependency, update yarn.lock
    
    * Port tests
    
    From https://github.com/rolandstarke/node-cache-manager-fs-hash/blob/master/test/index.test.js
    
    * Actually set the lock
    
    * review feedback
    
    * Copy license int imported files
    pvdz authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    84aae96 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3fda83b View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    001e045 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    08447bd View commit details
  6. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3675467 View commit details
  7. fix(gatsby): allow unknown plugin options (#27938)

    * fix(gatsby): allow unknown plugin options
    
    * Warn on unknown options
    
    * Add telemetry for unknown plugin options
    
    * Log validation errors only
    mxstbr authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    412b523 View commit details
  8. chore(deps): update minor and patch for gatsby-admin (#27896)

    * chore(deps): update minor and patch for gatsby-admin
    
    * Revert breaking gatsby-interface upgrade
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Max Stoiber <contact@mxstbr.com>
    3 people authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fb96705 View commit details
  9. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ccceda3 View commit details
  10. Copy the full SHA
    ac37599 View commit details
  11. docs(gatsby-source-contentful): clean up changelog (#28000)

    * docs(gatsby-source-contentful): clean up changelog
    
    * Update CHANGELOG.md
    
    * Fix source-contentful changelog formatting
    stefanjudis authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    83a8f13 View commit details
  12. Remove CODEOWNERS

    sidharthachatterjee committed Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8005d02 View commit details
  13. feat(develop): add explicit express handler for page-data requests (#…

    …27882)
    
    * feat(develop): add explicit express handler for page-data requests and dont rely on express-static
    
    * don't crash process on errors trying to read page-data
    
    * fix(prod-404): remove "/404.html" page when tracked 404 is deleted
    
    * test(e2e-dev): rename not only page-data file but also page component
    
    new express handler will try to load the page result if page exists in store
    so to mimic 404 page not existing we actually need to delete that page
    
    * fix: make sure there is response for every page-data fetch request
    
    * drop debugging logs
    pieh authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3d0de4a View commit details
  14. feat(create-gatsby): Add create-gatsby (#27703)

    * Add create-gatsby
    
    * add question and readme, update some wording
    
    * Update readme
    
    * Update handling of questions
    
    * Stylish!
    
    * Update message
    
    * Update messages
    
    * Catch ctrl^c
    
    * v0.0.0-2
    
    * Add test
    
    * Fix test
    
    * feat(gatsby): Add "gatsby plugin add" command
    
    * Load readme from local package
    
    * ensure skipped steps are actually skipped
    
    * attempt to add some more tests
    
    * Move command to cli
    
    * Try to install plugins
    
    * feat(create-gatsby): add wip plugin configuration forms (#27801)
    
    * add wip plugin configuration forms
    
    * Use plugins array
    
    * Typings
    
    Co-authored-by: Matt Kane <matt@gatsbyjs.com>
    
    * Install plugins
    
    * Add error handling
    
    * Return, don't exit
    
    * Fix tests
    
    * Resolve themes relative to root
    
    * Change back to original dir
    
    * Use starter with canary
    
    * v0.0.0-3
    
    * Fix to force publish
    
    * Working!
    
    * Change from review
    
    * Fix package name
    
    * Use gatsby-source-wordpress-experimental
    
    * Add schema import script
    
    * v0.0.0-4
    
    * Add dep
    
    * v0.0.0-5
    
    * handle peer dependencies
    
    * forgot to save a file
    
    * bump core-utils dependency
    
    * update styling and text to match Flo's design, in progress
    
    * use magenta for all actions to be taken
    
    * add final prompts
    
    * consistent coloring
    
    * consistent coloring
    
    * consistent coloring
    
    * Initial input test
    
    * Layout helpers
    
    * Add custom textinput prompt
    
    * Fixes to hint
    
    * Fix error
    
    * Add select control
    
    * update options for gatsby new
    
    * Tab to end
    
    * update tests
    
    * send both tabs
    
    * it was the right hex code, or not
    
    * order shouldn't matter but I'm very confused
    
    * will slash tab work
    
    * Formatting fixes
    
    * v0.0.0-6
    
    * use down inside of tab
    
    * test enter
    
    * trying one more thing, but suspect it's unrelated
    
    * Update packages/create-gatsby/src/cmses.json
    
    Co-authored-by: Lennart <lekoarts@gmail.com>
    
    * Update packages/create-gatsby/src/styles.json
    
    Co-authored-by: Lennart <lekoarts@gmail.com>
    
    * one more time
    
    * bane of my existence
    
    * try different keys for different OS
    
    * somehow bypasses linter
    
    * remove console.log
    
    * add fake plugin schemas for other cmses
    
    * Fix test
    
    * Longer tick
    
    * Add description to form inputs
    
    * Test changes
    
    * increase interval
    
    * add initial working test
    
    * missing return type
    
    * not sure why linter keeps skipping these diles
    
    * all tests except project name exists
    
    * just in case it's a timeout thing
    
    * does a single question pass
    
    * have CI run individual questions and see if we falter
    
    * Test
    
    * Burn it with fire 🔥
    
    * Move components into plugin
    
    * Replace Prismic with Dato
    
    * Install plugins at the start
    
    * Add support for plugin dependencies (#27995)
    
    * feat(create-gatsby): Add support for plugin dependencies
    
    * Fix extra plugin handling
    
    * Apply suggestions from code review
    
    Co-authored-by: Max Stoiber <contact@mxstbr.com>
    
    * Remove broken tests 😢
    
    Co-authored-by: Kyle Gill <kylerobertgill@gmail.com>
    Co-authored-by: Laurie <laurie@gatsbyjs.com>
    Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
    Co-authored-by: Lennart <lekoarts@gmail.com>
    Co-authored-by: Max Stoiber <contact@mxstbr.com>
    6 people authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2371fd5 View commit details
  15. update utils dependency (#28012)

    LB authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e520226 View commit details
  16. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7558a71 View commit details
  17. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8b59486 View commit details
  18. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4865ea7 View commit details
  19. missing dependency (#28019)

    LB authored Nov 12, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    77714a8 View commit details

Commits on Nov 13, 2020

  1. Copy the full SHA
    e99187f View commit details
  2. Copy the full SHA
    f345ca4 View commit details
  3. chore(docs): Update add-seo-component (#28022)

    Typo: location -> pathname
    lellky authored Nov 13, 2020
    Copy the full SHA
    6b4b7cd View commit details
  4. chore(gatsby-plugin-glamor): Add pluginOptionsSchema validation (#27602)

    * chore(gatsby-plugin-glamor): Add pluginOptionsSchema validation
    
    * Update package.json
    
    Co-authored-by: Max Stoiber <contact@mxstbr.com>
    MichaelDeBoey and mxstbr authored Nov 13, 2020
    Copy the full SHA
    e19a1d7 View commit details
  5. chore(gatsby-plugin-twitter): Add pluginOptionsSchema validation (#27601

    )
    
    * chore(gatsby-plugin-twitter): Add pluginOptionsSchema validation
    
    * Update package.json
    
    Co-authored-by: Max Stoiber <contact@mxstbr.com>
    MichaelDeBoey and mxstbr authored Nov 13, 2020
    Copy the full SHA
    bf6624b View commit details
  6. chore(create-gatsby): Microbundle package (#28030)

    * chore(create-gatsby): Microbundle package
    
    * Fix dep
    ascorbic authored Nov 13, 2020
    Copy the full SHA
    ff805c6 View commit details
  7. Revert "fix(gatsby): refresh browser when receiving update and runtim…

    …e errored (#27467)" (#28034)
    
    This reverts commit f227e85.
    pieh authored Nov 13, 2020
    Copy the full SHA
    076b59f View commit details
  8. Copy the full SHA
    d5807ac View commit details
  9. fix(create-gatsby): Disable emojis on Windows (#28039)

    * No emojis for windows 😢
    
    * v0.0.0-9
    ascorbic authored Nov 13, 2020
    Copy the full SHA
    5fbda3c View commit details
  10. feat(gatsby-cli): add GATSBY_EXPERIMENTAL_GATSBY_NEW_FLOW flag to use…

    … create-gatsby when no options are provided (#27954)
    
    * adjust gatsby new logic to use create-gatsby
    
    * remove unused code
    
    * udpate docs for changed behavior
    
    * add basic test to verify create-gatsby is run
    
    * add flag for the new interactive experience
    
    * remove line break that doesnt need to be added
    
    * add more explicit comment
    
    * update create-gatsby version
    
    Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
    gillkyle and gatsbybot authored Nov 13, 2020
    Copy the full SHA
    55821db View commit details

Commits on Nov 14, 2020

  1. Make optional SVG favicon come after the fallback (#27843)

    * Make optional SVG favicon come after the fallback
    
    Fixes #26083 Chrome choosing the favicon which comes last.
    
    * Flip brackets/parens
    
    * Update snapshots
    
    Co-authored-by: Ciro Mattia Gonano <ciromattia@gmail.com>
    trevorblades and ciromattia authored Nov 14, 2020
    Copy the full SHA
    3b9a9fe View commit details
  2. Copy the full SHA
    d4ab6d2 View commit details
  3. fix(plugin-manifest): Allow for all valid WebAppManifest properties (#…

    …27951)
    
    * bring in complete(albeit outdated) WebAppManifest validation frrom previous unmerged PR
    
    * Cleanup Gatsby Plugin Options
    
    * update validation to match recent spec changes
    
    * update compatible gatsby version
    
    * reomve unused service worker object and fix numberic string
    
    * lint
    
    * add details from suplementry spec
    
    * final return
    
    * Prettify
    
    Co-authored-by: Max Stoiber <contact@mxstbr.com>
    moonmeister and mxstbr authored Nov 14, 2020
    Copy the full SHA
    88b990a View commit details

Commits on Nov 15, 2020

  1. Copy the full SHA
    4c400f3 View commit details

Commits on Nov 16, 2020

  1. add query pluginOption for mongodb plugin (#27756)

    * add query pluginOption for mongodb plugin
    
    * add documention for pluginOption
    
    * add query example to README.md
    nm123github authored Nov 16, 2020
    Copy the full SHA
    58747b2 View commit details
  2. chore(release): Publish pre-release

     - create-gatsby@0.0.0-next.0
     - gatsby-admin@0.3.0-next.1
     - gatsby-cli@2.14.0-next.1
     - gatsby-plugin-glamor@2.5.0-next.1
     - gatsby-plugin-manifest@2.7.0-next.1
     - gatsby-plugin-mdx@1.5.0-next.1
     - gatsby-plugin-sass@2.6.0-next.1
     - gatsby-plugin-twitter@2.5.0-next.1
     - gatsby-recipes@0.4.0-next.1
     - gatsby-remark-images@3.6.0-next.1
     - gatsby-source-mongodb@2.5.0-next.1
     - gatsby-telemetry@1.5.0-next.1
     - gatsby-transformer-asciidoc@1.5.0-next.1
     - gatsby-transformer-sharp@2.7.0-next.1
     - gatsby@2.27.0-next.1
    KyleAMathews committed Nov 16, 2020
    Copy the full SHA
    ba5abc8 View commit details
  3. test(gatsby-plugin-image): gatsby-image-server.ts (#27989)

    Marvin Frachet authored Nov 16, 2020
    Copy the full SHA
    51454f6 View commit details
  4. Copy the full SHA
    dd8b72b View commit details
  5. perf(gatsby): fix performance regression with query dependency cleani…

    …ng (#28032)
    
    * perf(gatsby): fix performance regression with query dependency cleaning
    
    * update snapshot
    
    * More consistent codestyle
    vladar authored Nov 16, 2020
    Copy the full SHA
    de5517b View commit details
  6. Copy the full SHA
    bd9df72 View commit details
Showing 661 changed files with 12,984 additions and 4,829 deletions.
34 changes: 34 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -117,6 +117,23 @@ aliases:
- notify-status:
condition: << parameters.nightly >>

e2e_tests_development_runtime_lazy_alias:
&e2e_tests_development_runtime_lazy_alias
<<: *e2e-executor
parameters:
nightly:
type: boolean
default: false
environment:
CYPRESS_PROJECT_ID: ihj5mz
CYPRESS_RECORD_KEY: 01acdce8-75bd-4280-9839-6cb215b2c84b
steps:
- e2e-test:
test_path: e2e-tests/lazy-development-runtime
skip_file_change_test: << parameters.nightly >>
- notify-status:
condition: << parameters.nightly >>

e2e_tests_gatsby-image_alias: &e2e_tests_gatsby-image_alias
<<: *e2e-executor
parameters:
@@ -271,6 +288,12 @@ jobs:
- e2e-test:
test_path: integration-tests/artifacts

integration_tests_ssr:
executor: node
steps:
- e2e-test:
test_path: integration-tests/ssr

e2e_tests_path-prefix:
<<: *e2e-executor
environment:
@@ -326,6 +349,13 @@ jobs:
e2e_tests_development_runtime:
<<: *e2e_tests_development_runtime_alias

e2e_tests_development_runtime_lazy_devjs:
<<: *e2e_tests_development_runtime_alias
environment:
GATSBY_EXPERIMENT_LAZY_DEVJS: true
CYPRESS_PROJECT_ID: ihj5mz
CYPRESS_RECORD_KEY: 01acdce8-75bd-4280-9839-6cb215b2c84b

e2e_tests_development_runtime_with_experimental_react:
<<: *e2e_tests_development_runtime_alias

@@ -582,6 +612,8 @@ workflows:
<<: *e2e-test-workflow
- integration_tests_artifacts:
<<: *e2e-test-workflow
- integration_tests_ssr:
<<: *e2e-test-workflow
- integration_tests_gatsby_cli:
requires:
- bootstrap
@@ -597,6 +629,8 @@ workflows:
<<: *e2e-test-workflow
- e2e_tests_development_runtime:
<<: *e2e-test-workflow
- e2e_tests_development_runtime_lazy_devjs:
<<: *e2e-test-workflow
- e2e_tests_production_runtime:
<<: *e2e-test-workflow
- themes_e2e_tests_production_runtime:
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -26,8 +26,6 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
examples/biz-website/public/
examples/blog/public/
integration-tests/gatsby-cli/execution-folder/*
*.un~
dist
18 changes: 0 additions & 18 deletions CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
<a href="https://circleci.com/gh/gatsbyjs/gatsby">
<img src="https://circleci.com/gh/gatsbyjs/gatsby.svg?style=shield" alt="Current CircleCI build status." />
</a>
<a href="https://www.npmjs.org/package/gatsby">
<a href="https://www.npmjs.com/package/gatsby">
<img src="https://img.shields.io/npm/v/gatsby.svg" alt="Current npm package version." />
</a>
<a href="https://npmcharts.com/compare/gatsby?minimal=true">
7 changes: 6 additions & 1 deletion benchmarks/gabe-fs-mdx/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ module.exports = {
path: `${__dirname}/generated_articles/`,
},
},
`gatsby-plugin-mdx`,
{
resolve: `gatsby-plugin-mdx`,
options: {
// lessBabel: true,
},
},
],
}
1 change: 1 addition & 0 deletions benchmarks/source-contentful/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ module.exports = {
{
resolve: "gatsby-source-contentful",
options: contentfulConfig,
pageLimit: 1000,
},
],
}
2 changes: 1 addition & 1 deletion benchmarks/source-strapi/package.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"sharp": "^0.25.4"
"sharp": "^0.26.3"
},
"devDependencies": {
"prettier": "2.0.5"
4 changes: 4 additions & 0 deletions docs/contributing/community.md
Original file line number Diff line number Diff line change
@@ -62,6 +62,10 @@ If you need an answer right away, check out the
[Gatsby Discord](https://gatsby.dev/discord). Community & team members are happy to help you out or point you to
useful resources.

### GitHub Discussions

Directly integrated into the repository, you can use [GitHub Discussions](https://github.com/gatsbyjs/gatsby/discussions) to ask for help or share ideas.

### Hashnode

Many members of the community also use Hashnode to ask questions and share their tips. Read through
2 changes: 1 addition & 1 deletion docs/docs/add-seo-component.md
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ Now define the query and pass it to `useStaticQuery`. You can also alias query i

```jsx:title=src/components/seo.js
const SEO = ({ title, description, image, article }) => {
const { location } = useLocation()
const { pathname } = useLocation()
const { site } = useStaticQuery(query)

return null
6 changes: 3 additions & 3 deletions docs/docs/deploying-to-firebase.md
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ In this guide, you will learn how to deploy your Gatsby site to Firebase Hosting
"headers": [
{
"key": "cache-control",
"value": "cache-control: public, max-age=0, must-revalidate"
"value": "public, max-age=0, must-revalidate"
}
]
},
@@ -85,7 +85,7 @@ In this guide, you will learn how to deploy your Gatsby site to Firebase Hosting
"headers": [
{
"key": "cache-control",
"value": "cache-control: public, max-age=0, must-revalidate"
"value": "public, max-age=0, must-revalidate"
}
]
},
@@ -94,7 +94,7 @@ In this guide, you will learn how to deploy your Gatsby site to Firebase Hosting
"headers": [
{
"key": "cache-control",
"value": "cache-control: public, max-age=0, must-revalidate"
"value": "public, max-age=0, must-revalidate"
}
]
}
2 changes: 2 additions & 0 deletions docs/docs/gatsby-cli.md
Original file line number Diff line number Diff line change
@@ -66,6 +66,8 @@ gatsby new
(Use a different starter)
```
_Note: you can try out the experimental interactive experience from the `create-gatsby` package with the `GATSBY_EXPERIMENTAL_GATSBY_NEW_FLOW=true` flag, which will prompt you with questions about the kind of site you're building, and install the plugins you'll need automatically._
See the [Gatsby starters docs](/docs/gatsby-starters/) for more details.
### `develop`
26 changes: 16 additions & 10 deletions docs/docs/recipes/styling-css.md
Original file line number Diff line number Diff line change
@@ -395,35 +395,41 @@ Hosting your own [Google Fonts](https://fonts.google.com/) locally within a proj

- A [Gatsby site](/docs/quick-start)
- The [Gatsby CLI](/docs/gatsby-cli/) installed
- Choosing a font package from [the typefaces project](https://github.com/KyleAMathews/typefaces)
- A chosen font package from [Fontsource](https://github.com/fontsource/fontsource)

### Directions

1. Run `npm install typeface-your-chosen-font`, replacing `your-chosen-font` with the name of the font you want to install from [the typefaces project](https://github.com/KyleAMathews/typefaces).
This example shows how to set up the [Open Sans](https://fonts.google.com/specimen/Open+Sans) font. If you have a different Google Font you want to use, you can find the corresponding package in [NPM](https://www.npmjs.com/search?q=fontsource) or the [packages directory in the Fontsource repository](https://github.com/fontsource/fontsource/tree/master/packages).

An example to load the popular 'Source Sans Pro' font would be: `npm install typeface-source-sans-pro`.
1. Run `npm install fontsource-open-sans` to download the necessary package files.

2. Add `import "typeface-your-chosen-font"` to a layout template, page component, or `gatsby-browser.js`.
2. Then within your app entry file or site component, import the font package. It is recommended you import it via the layout template (`layout.js`). However, importing via page component (`index.js`), or `gatsby-browser.js` are viable alternatives.

```jsx:title=src/components/layout.js
import "typeface-your-chosen-font"
import "fontsource-open-sans" // Defaults to weight 400 with all styles included.
```

If you wish to select a particular weight or style, you may specify it by changing the import path.

```jsx:title=src/components/layout.js
import "fontsource-open-sans/500.css" // Weight 500 with all styles included.
import "fontsource-open-sans/900-normal.css" // Select either normal or italic.
```

**Note**: The range of supported weights and styles a font may support is shown in each package's README file.

3. Once it's imported, you can reference the font name in a CSS stylesheet, CSS Module, or CSS-in-JS.

```css:title=src/components/layout.css
body {
font-family: "Your Chosen Font";
font-family: "Open Sans";
}
```

_NOTE: So for the above example, the relevant CSS declaration would be `font-family: 'Source Sans Pro';`_

### Additional resources

- [Fontsource repo on GitHub](https://github.com/fontsource/fontsource)
- [Typography.js](/docs/typography-js/) - Another option for using Google fonts on a Gatsby site
- [The Typefaces Project Docs](https://github.com/KyleAMathews/typefaces/blob/master/README.md)
- [Live example on Kyle Mathews' blog](https://www.bricolage.io/typefaces-easiest-way-to-self-host-fonts/)

## Using Font Awesome

30 changes: 13 additions & 17 deletions docs/docs/using-web-fonts.md
Original file line number Diff line number Diff line change
@@ -18,36 +18,32 @@ Some examples of web font services include [Google Fonts](https://fonts.google.c

### Using Google Fonts

The fastest way to get started using Google Fonts is by choosing a font from [the typefaces project](https://github.com/KyleAMathews/typefaces). This example shows how you can add Open Sans to your project.
The fastest way to get started using Google Fonts is by choosing a font from [Fontsource](https://github.com/fontsource/fontsource).

First, install the typeface package with npm:
This example shows how to set up the [Open Sans](https://fonts.google.com/specimen/Open+Sans) font. If you have a different Google Font you want to use, you can find the corresponding package in [NPM](https://www.npmjs.com/search?q=fontsource) or the [packages directory in the Fontsource repository](https://github.com/fontsource/fontsource/tree/master/packages).

```bash
npm install --save typeface-open-sans
```
1. Run `npm install fontsource-open-sans` to download the necessary package files.

Or with yarn:
2. Then within your app entry file or site component, import the font package. It is recommended you import it via the layout template (`layout.js`). However, importing via page component (`index.js`), or `gatsby-browser.js` are viable alternatives.

```bash
yarn add typeface-open-sans
```jsx:title=src/components/layout.js
import "fontsource-open-sans" // Defaults to weight 400 with all styles included.
```

In your `layout.js` file, import the typeface.
If you wish to select a particular weight or style, you may specify it by changing the import path.

```jsx:title=src/components/layout.js
import "typeface-open-sans"
import "fontsource-open-sans/500.css" // Weight 500 with all styles included.
import "fontsource-open-sans/900-normal.css" // Select either normal or italic.
```

Next, add the typeface name to the appropriate place in your CSS. In this case, you will override the `body` element's `font-family` default values.
**Note**: The range of supported weights and styles a font may support is shown in each package's README file.

3. Once it's imported, you can reference the font name in a CSS stylesheet, CSS Module, or CSS-in-JS.

```css:title=src/components/layout.css
body {
color: hsla(0, 0%, 0%, 0.8);
// highlight-next-line
font-family: "Open Sans", georgia, serif;
font-weight: normal;
word-wrap: break-word;
font-kerning: normal;
font-family: "Open Sans";
}
```

185 changes: 185 additions & 0 deletions docs/reference/release-notes/v2.26/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
---
date: "2020-11-12"
version: "2.26.0"
---

# [v2.26](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.26.0-next.0...gatsby@2.26.0) (November 2020)

---

Welcome to `gatsby@2.26.0` release (November 2020).
Key highlights of this release:

- [New Image Plugin (beta)](#gatsby-plugin-image010-beta) - access static images without GraphQL, high Lighthouse scores again
- [File System Route API](#file-system-route-api) - create routes from your data using filename conventions
- [New Release Process](#new-release-process) - more stability and clarity around Gatsby releases
- [gatsby-source-contentful v4.0](#gatsby-source-contentful400) - new RichText implementation, performance improvements

Other notable changes:

- [gatsby-plugin-mdx](#gatsby-plugin-mdx140) - performance improvements
- [Enable compression in the dev server](#enable-compression-in-the-dev-server) - speeds up remote previews

Sneak peek to next releases:

- [Queries on Demand](#queries-on-demand) - improves `gatsby develop` bootup time
- [Experimental: Lazy images in develop](#experimental-lazy-images-in-develop)
- [Documentation Reorganization](#documentation-reorganization)

**Bleeding Edge:** Want to try new features as soon as possible? Install `gatsby@next` and let us know
if you have any [issues](https://github.com/gatsbyjs/gatsby/issues).

### New Release Process

We are evaluating a new process that should bring more stability and clarity
to Gatsby releases.

### File System Route API

This new API enables you to create routes from your GraphQL data using filename conventions,
e.g. to create individual blog post pages for your blog. It also allows for creating client-only routes more easily.

Some examples:

- `src/pages/products/{Product.name}.js` will generate pages for all products with a path like `/products/burger`
- `src/pages/products/{Product.fields__sku}.js` will generate pages for all products with a path like `/products/001923`
- `src/pages/users/[id].js` will generate a route like `/users/:id`
- `src/pages/image/[...].js` will generate a route like `/image/*`

See [full documentation](https://www.gatsbyjs.com/docs/file-system-route-api/),
[examples](https://github.com/gatsbyjs/gatsby/tree/master/examples/route-api)
and related PR [#27424](https://github.com/gatsbyjs/gatsby/pull/27424).

### Enable compression in the dev server

This lowers the amount of data transferred for one site especially in remote situations.
Most of that drop was from the commons.js bundle.

See PR [#27948](https://github.com/gatsbyjs/gatsby/pull/27948) for details.

## gatsby-plugin-image@0.1.0 (beta)

[New image plugin](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-image) to replace `gatsby-image`, which greatly improves performance (Lighthouse 💯 again) and adds easy static images (no GraphQL). Part of it is also a new, simpler API for `gatsby-transformer-sharp`.

### StaticImage

This component is a new, simpler way to use Gatsby's image processing for static images without needing to write GraphQL queries:

```js
import React from "react"
import { StaticImage } from "gatsby-plugin-image"

export const Dino = () => (
<StaticImage width={100} height={100} src="trex.png" alt="T-Rex" />
)
```

### GatsbyImage

This is a complete rewrite of the Gatsby Image component, using native lazy loading whenever possible.
In our tests it allows sites whose Lighthouse scores dropped in recent updates to get back to 100s across the board.

### Simpler GraphQL for non-static images

Instead of having to remember lots of different fragments for different image types,
you can pass all your options as field arguments (and get inline help in GraphiQL):

```graphql
query {
file(relativePath: { eq: "plant.jpg" }) {
childImageSharp {
gatsbyImageData(maxWidth: 720, layout: FLUID, placeholder: TRACED_SVG)
}
}
}
```

You then use the data like this:

```jsx
import { GatsbyImage, getImage } from "gatsby-plugin-image"

export function Plant({ data }) {
const imageData = getImage(data.file)
return <GatsbyImage image={imageData} alt="Plant" />
}
```

- [Details, Migration guide and discussion](https://github.com/gatsbyjs/gatsby/discussions/27950)
- [Documentation](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-image)

## gatsby-source-contentful@4.0.0

### New Rich Text Implementation

**Breaking Change**: New rich text implementation for performance and usability. This is only a breaking change if you rely on the Rich Text Contentful field type.

See PR [#25249](https://github.com/gatsbyjs/gatsby/pull/25249) description for details and migration guide.

### Performance improvements

The max of `pageLimit` option was raised from `100` to `1000` (on Contentful's side) which should lead
to significant reduction of remote fetching times.

Note that the default value for the `pageLimit` option is still `100`, so you need to change
it manually in your site config to see performance improvements.

Due to technical limitations, the response payload size is still bound by a hard chunk download
size, so it is possible you may need to use a lower value for your particular site.

## gatsby-plugin-mdx@1.4.0

There was a significant performance improvement by making a certain node fetching step lazy.
This is especially noticeable at scale. See PR [#27937](https://github.com/gatsbyjs/gatsby/pull/27937) for details.

## Work in progress

### Queries on Demand

When developing a Gatsby site there's no need to run all graphql queries before serving the site.
Instead, Gatsby could run queries for pages as they're requested by a browser.
This would avoid having to wait for slower queries (like image processing) if you're editing an unrelated part of a site.

Try early alpha (and [let us know](https://github.com/gatsbyjs/gatsby/discussions/27620) if you have any issues with it):

```
npm install gatsby@qod
```

Enable in your `gatsby-config.js`:

```js
module.exports = {
// your existing configuration
__experimentalQueryOnDemand: true,
}
```

[Details and discussion](https://github.com/gatsbyjs/gatsby/discussions/27620).

### Experimental: Lazy images in develop

We've got some feedback that the more image-heavy your website gets, the slower `gatsby develop`.
This experimental version of `gatsby-plugin-sharp` only does image processing when the page gets requested.

Try early alpha (and [let us know](https://github.com/gatsbyjs/gatsby/discussions/27603) if you have any issues with it):

```
npm install gatsby-plugin-sharp@lazy-images
```

Lazy images are enabled by-default in this version.

[Details and discussion](https://github.com/gatsbyjs/gatsby/discussions/27603).

### Documentation Reorganization

We’ve heard repeatedly from the community that Gatsby is a powerful tool,
but it has a steep learning curve. We want to make it easier to get started with Gatsby.
And that means having documentation that helps y’all find the information you need when you need it.

[Announcement and discussion](https://github.com/gatsbyjs/gatsby/discussions/27856).

## Contributors

A big **Thank You** to [everyone who contributed](https://github.com/gatsbyjs/gatsby/compare/gatsby@2.26.0-next.0...gatsby@2.26.0) to this release 💜

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-404-to-B-to-404-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-404-to-B-to-404-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-CO-to-B-to-CO-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-CO-to-B-to-CO-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-no-trailing-slash-A-to-B-to-A-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-no-trailing-slash-A-to-B-to-A-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-with-trailing-slash-A-to-B-to-A-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "page-query-with-trailing-slash-A-to-B-to-A-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-404-to-B-to-404-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-404-to-B-to-404-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-CO-to-B-to-CO-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-CO-to-B-to-CO-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-no-trailing-slash-A-to-B-to-A-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-no-trailing-slash-A-to-B-to-A-link",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-with-trailing-slash-A-to-B-to-A-history",
"status": "before-edit"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"selector": "static-query-with-trailing-slash-A-to-B-to-A-link",
"status": "before-edit"
}
3 changes: 2 additions & 1 deletion e2e-tests/development-runtime/cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"baseUrl": "http://localhost:8000",
"failOnStatusCode": false,
"chromeWebSecurity": false
"chromeWebSecurity": false,
"defaultCommandTimeout": 30000
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
/*
* Those are the tests for page and static query caches that we store in runtime.
* It should make sure that we correctly update them when needed. In particular:
* a) we don't display stale content
* b) that various edge cases are handled and we don't end up showing blank page of death
*
* Important part here is to make sure we only use client-side navigation, as regular browser navigation would clear those caches
*
* How those test work?
*
* There is 16 test scenarios:
* - Each scenario has 2 dedicated pages (with exception of 404 scenario, because we only can have one 404 page, so this is shared for multiple pages).
* - Each scenario has dedicated data node (queried by both pages dedicated to the scenario). This is coming from `.json` file (see `content/query-data-caches`)
* - There are 4 page types:
* - Regular static page that has trailing slash (referred to as `with-trailing-slash-A` in tests, data files, page components, etc)
* - Regular static page that DOESN't have trailing slash (referred to as `no-trailing-slash-A` in tests, data files, page components, etc)
* - Client-only page (referred to as `client-only` or `CO`)
* - 404 page (referred to as `404`)
* - There are 2 types of query - page query and static query
* - Each scenario has follow same steps:
* 1. Visit starting page
* 2. Set variable on `window` object (will be used in step 11.)
* 3. Assert page type, page canonical path and data for initial page and initial data
* 4. At this point all runtime data caches for that page should be saturated
* 5. Navigate to second page for the scenario using `gatsby-link` (we want to `cy.visit` only once per scenario to keep cached data in memory)
* 6. Assert page type, page canonical path and data for second page and initial data
* 7. Update data (edit `.json` file) that is used by both pages used in the scenario
* 8. Assert page type, page canonical path and data for second page and *updated* data
* 9. Navigate to initial page. There are 2 cases for navigating back and there are separate scenarios for those
* - using `gatsby-link`
* - using `history.back()`
* 10. Assert page type, page canonical path and data for initial page and *updated* data
* 11. Assert that variable set on `window` object in step 2. is still there (this is to make sure we used only client side navigation and cached data wasn't lost as part of refresh or traditional browser navigation)
*/

// --- common helpers ---
function updateData(config) {
cy.exec(
`npm run update -- --file content/query-data-caches/${config.slug}.json --replacements "before-edit:after-edit" --exact`
)
}
function preTestSetup(config) {
cy.exec(
`npm run update -- --file content/query-data-caches/${config.slug}.json --restore`
)
}

before(() => {
cy.exec(`npm run reset`)
})

after(() => {
cy.exec(`npm run reset`)
})

function setupForAssertingNotReloading() {
cy.window().then(win => {
win.__checkIfDidNotReload = true
})
}

function assertNotReloading() {
// this is making sure we used only client-side navigation
// if there was reload, `__checkIfDidNotReload` on window object wouldn't exist
cy.window().its(`__checkIfDidNotReload`).should(`equal`, true)
}

function getExpectedCanonicalPath(config) {
if (config.page === `404`) {
return `/404.html`
}

return `/query-data-caches/${config.slug}/${
config.page === `client-only`
? `:client-only`
: `page-${config.page}${config.trailingSlash === false ? `` : `/`}`
}`
}

function pageTitleAndDataAssertion(config) {
cy.log(
`Asserting that we are on page "${config.page}" with data "${config.data}"`
)

if (config.page === `404`) {
// if we are on 404 we need to hide dev-404 to show real 404 page
cy.findByText(`Preview custom 404 page`).click()
}

cy.getTestElement(`${config.prefix || ``}page-path`)
.invoke(`text`)
.should(`equal`, getExpectedCanonicalPath(config))

cy.getTestElement(`${config.prefix || ``}query-data-caches-page-title`)
.invoke(`text`)
.should(`equal`, `This is page ${config.page}`)

cy.getTestElement(`${config.prefix || ``}${config.queryType}-query-result`)
.invoke(`text`)
.should(
`equal`,
`${config.slug} / ${
config.page === config.initialPage ? `initial-page` : `second-page`
}: ${config.data}`
)
}

function runTests(config) {
preTestSetup(config)

cy.visit(`/query-data-caches/${config.slug}/page-A/`).waitForRouteChange()

setupForAssertingNotReloading()

// baseline assertions
pageTitleAndDataAssertion({
...config,
page: config.initialPage,
data: `before-edit`,
})

cy.getTestElement(`page-b-link`).click().waitForRouteChange()

// assert we navigated
pageTitleAndDataAssertion({ ...config, page: `B`, data: `before-edit` })

// edit data
updateData(config)

// assert data on current page changed
pageTitleAndDataAssertion({ ...config, page: `B`, data: `after-edit` })

if (config.navigateBack === `link`) {
cy.getTestElement(`page-a-link`).click().waitForRouteChange()
} else if (config.navigateBack === `history`) {
// this is just making sure page components don't have link to navigate back (asserting correct setup)
cy.getTestElement(`page-a-link`).should(`not.exist`)
cy.go(`back`).waitForRouteChange()
}

// assert data on page we previously visited is updated
pageTitleAndDataAssertion({
...config,
page: config.initialPage,
data: `after-edit`,
})

assertNotReloading()
}

describe(`Navigate from static page A to page B, invalidate some data resources for static page A, navigate back to static page A`, () => {
describe(`Navigating back with gatsby-link`, () => {
it(`page query (page has trailing slash)`, () => {
const config = {
slug: `page-query-with-trailing-slash-A-to-B-to-A-link`,
queryType: `page`,
navigateBack: `link`,
initialPage: `A`,
}

runTests(config)
})

it(`page query (page doesn't have trailing slash)`, () => {
const config = {
slug: `page-query-no-trailing-slash-A-to-B-to-A-link`,
trailingSlash: false,
queryType: `page`,
navigateBack: `link`,
initialPage: `A`,
}

runTests(config)
})

it(`static query (page has trailing slash)`, () => {
const config = {
slug: `static-query-with-trailing-slash-A-to-B-to-A-link`,
queryType: `static`,
navigateBack: `link`,
initialPage: `A`,
}

runTests(config)
})

it(`static query (page doesn't have trailing slash)`, () => {
const config = {
slug: `static-query-no-trailing-slash-A-to-B-to-A-link`,
trailingSlash: false,
queryType: `static`,
navigateBack: `link`,
initialPage: `A`,
}

runTests(config)
})
})

describe(`Navigating back with history.back()`, () => {
it(`page query (page has trailing slash)`, () => {
const config = {
slug: `page-query-with-trailing-slash-A-to-B-to-A-history`,
queryType: `page`,
navigateBack: `history`,
initialPage: `A`,
}

runTests(config)
})

it(`page query (page doesn't have trailing slash)`, () => {
const config = {
slug: `page-query-no-trailing-slash-A-to-B-to-A-history`,
trailingSlash: false,
queryType: `page`,
navigateBack: `history`,
initialPage: `A`,
}

runTests(config)
})

it(`static query (page has trailing slash)`, () => {
const config = {
slug: `static-query-with-trailing-slash-A-to-B-to-A-history`,
queryType: `static`,
navigateBack: `history`,
initialPage: `A`,
}

runTests(config)
})

it(`static query (page doesn't have trailing slash)`, () => {
const config = {
slug: `static-query-no-trailing-slash-A-to-B-to-A-history`,
trailingSlash: false,
queryType: `static`,
navigateBack: `history`,
initialPage: `A`,
}

runTests(config)
})
})
})

describe(`Navigate from client-only page A to page B, invalidate some data resources for client-only page A, navigate back to client-only page A`, () => {
describe(`Navigating back with gatsby-link`, () => {
it(`page query`, () => {
const config = {
slug: `page-query-CO-to-B-to-CO-link`,
queryType: `page`,
navigateBack: `link`,
initialPage: `client-only`,
}

runTests(config)
})

it(`static query`, () => {
const config = {
slug: `static-query-CO-to-B-to-CO-link`,
queryType: `static`,
navigateBack: `link`,
initialPage: `client-only`,
}

runTests(config)
})
})

describe(`Navigating back with history.back()`, () => {
it(`page query`, () => {
const config = {
slug: `page-query-CO-to-B-to-CO-history`,
queryType: `page`,
navigateBack: `history`,
initialPage: `client-only`,
}

runTests(config)
})

it(`static query`, () => {
const config = {
slug: `static-query-CO-to-B-to-CO-history`,
queryType: `static`,
navigateBack: `history`,
initialPage: `client-only`,
}

runTests(config)
})
})
})

describe(`Navigate from 404 page A to page B, invalidate some data resources for 404 page A, navigate back to 404 page A`, () => {
describe(`Navigating back with gatsby-link`, () => {
it(`page query`, () => {
const config = {
slug: `page-query-404-to-B-to-404-link`,
queryType: `page`,
navigateBack: `link`,
initialPage: `404`,
prefix: `page-link-`,
}

runTests(config)
})

it(`static query`, () => {
const config = {
slug: `static-query-404-to-B-to-404-link`,
queryType: `static`,
navigateBack: `link`,
initialPage: `404`,
prefix: `static-link-`,
}

runTests(config)
})
})

describe(`Navigating back with history.back()`, () => {
it(`page query`, () => {
const config = {
slug: `page-query-404-to-B-to-404-history`,
queryType: `page`,
navigateBack: `history`,
initialPage: `404`,
prefix: `page-history-`,
}

runTests(config)
})

it(`static query`, () => {
const config = {
slug: `static-query-404-to-B-to-404-history`,
queryType: `static`,
navigateBack: `history`,
initialPage: `404`,
prefix: `static-history-`,
}

runTests(config)
})
})
})

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -90,6 +90,9 @@ describe(`redirect`, () => {
pagePath: `/404.html`,
filter: `page-data`,
})
cy.task(`blockPageComponent`, {
path: `pages/404.js`,
})
})

after(() => {
31 changes: 26 additions & 5 deletions e2e-tests/development-runtime/cypress/plugins/block-resources.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,9 @@ const fs = require(`fs-extra`)
const path = require(`path`)
const glob = require(`glob`)

const publicDir = path.join(__dirname, `..`, `..`, `public`)
const siteDir = path.join(__dirname, `..`, `..`)
const srcDir = path.join(siteDir, `src`)
const publicDir = path.join(siteDir, `public`)

const moveAsset = (from, to) => {
const fromExists = fs.existsSync(from)
@@ -18,7 +20,7 @@ const moveAsset = (from, to) => {
}
}

const restorePageData = hiddenPath => {
const restoreAsset = hiddenPath => {
if (path.basename(hiddenPath).charAt(0) !== `_`) {
throw new Error(`hiddenPath should have _ prefix`)
}
@@ -51,10 +53,28 @@ const blockAssetsForPage = ({ pagePath, filter }) => {
return null
}

function blockPageComponent({ path: pageComponentPath }) {
const hiddenPath = path.join(
path.dirname(pageComponentPath),
`_` + path.basename(pageComponentPath)
)

moveAsset(path.join(srcDir, pageComponentPath), path.join(srcDir, hiddenPath))
return null
}

const restore = () => {
const globPattern = path.join(publicDir, `/page-data/**`, `_page-data.json`)
const hiddenPageDatas = glob.sync(globPattern)
hiddenPageDatas.forEach(restorePageData)
const hiddenPageDataGlobPattern = path.join(
publicDir,
`/page-data/**`,
`_page-data.json`
)
const hiddenPageDatas = glob.sync(hiddenPageDataGlobPattern)
hiddenPageDatas.forEach(restoreAsset)

const hiddenPageComponentGlobPattern = path.join(srcDir, `**`, `_*`)
const hiddenPageComponents = glob.sync(hiddenPageComponentGlobPattern)
hiddenPageComponents.forEach(restoreAsset)

console.log(`Restored resources`)
return null
@@ -63,4 +83,5 @@ const restore = () => {
module.exports = {
restoreAllBlockedResources: restore,
blockAssetsForPage,
blockPageComponent,
}
27 changes: 2 additions & 25 deletions e2e-tests/development-runtime/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ Cypress.Commands.add(`lifecycleCallOrder`, expectedActionCallOrder =>
if (expectedActionCallOrderLength > actionsLength) {
return false
}

let prevActionIndex = -1
for (let i = 0; i < actionsLength; i += 1) {
const nextActionIndex = prevActionIndex + 1
@@ -81,29 +81,6 @@ Cypress.Commands.add(
}
)

Cypress.Commands.add(`assertRoute`, route => {
Cypress.Commands.add(`assertRoute`, (route) => {
cy.url().should(`equal`, `${window.location.origin}${route}`)
})

// react-error-overlay is iframe, so this is just convenience helper
// https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/#custom-command
Cypress.Commands.add(`getOverlayIframe`, () => {
// get the iframe > document > body
// and retry until the body element is not empty
return (
cy
.get(`iframe`, { log: true, timeout: 150000 })
.its(`0.contentDocument.body`)
.should(`not.be.empty`)
// wraps "body" DOM element to allow
// chaining more Cypress commands, like ".find(...)"
// https://on.cypress.io/wrap
.then(cy.wrap, { log: true })
)
})

Cypress.Commands.add(`assertNoOverlayIframe`, () => {
// get the iframe > document > body
// and retry until the body element is not empty
return cy.get(`iframe`, { log: true, timeout: 15000 }).should(`not.exist`)
})
45 changes: 45 additions & 0 deletions e2e-tests/development-runtime/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -134,4 +134,49 @@ exports.onCreatePage = async ({ page, actions }) => {
},
})
}

if (page.path.includes(`query-data-caches`)) {
if (page.path.includes(`with-trailing-slash`)) {
// just make sure it actually has trailing slash
const hasTrailingSlash = /\/$/.test(page.path)
if (!hasTrailingSlash) {
throw new Error(
`Page reporting to have trailing slash, doesn't have it`
)
}
}

if (page.path.includes(`no-trailing-slash`)) {
// strip both slashes
deletePage(page)
createPage({
...page,
path: page.path.replace(/\/$/, ``),
})
}
}
}

exports.createResolvers = ({ createResolvers }) => {
const resolvers = {
QueryDataCachesJson: {
// this field doesn't do anything useful on its own
// it's only added so we can use it to make sure query text
// in various queries used by `query-data-caches` is different
// at least a little bit, so the static queries is different
// between initial and second page
dummy: {
type: `String`,
args: {
text: {
type: `String`,
},
},
resolve(_source, args) {
return args.text
},
},
},
}
createResolvers(resolvers)
}
4 changes: 2 additions & 2 deletions e2e-tests/development-runtime/package.json
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@
"author": "Dustin Schau <dustin@gatsbyjs.com>",
"dependencies": {
"gatsby": "^2.4.4",
"gatsby-plugin-image": "^0.0.2",
"gatsby-image": "^2.0.41",
"gatsby-plugin-image": "^0.0.2",
"gatsby-plugin-manifest": "^2.0.17",
"gatsby-plugin-offline": "^2.1.0",
"gatsby-plugin-react-helmet": "^3.0.6",
"gatsby-plugin-sharp": "^2.0.37",
"gatsby-seo": "^0.1.0",
"gatsby-source-filesystem": "^2.0.33",
"gatsby-transformer-json": "^2.4.14",
"gatsby-transformer-json": "^2.5.0",
"gatsby-transformer-remark": "^2.3.12",
"gatsby-transformer-sharp": "^2.1.19",
"isomorphic-fetch": "^2.2.1",
20 changes: 2 additions & 18 deletions e2e-tests/development-runtime/scripts/update.js
Original file line number Diff line number Diff line change
@@ -34,29 +34,13 @@ const args = yargs
`
).trim(),
type: `string`,
})
.option(`restore`, {
default: false,
type: `boolean`,
}).argv

async function update() {
const history = await getHistory()

const { file: fileArg, replacements, restore } = args
const { file: fileArg, replacements } = args
const filePath = path.resolve(fileArg)
if (restore) {
const original = history.get(filePath)
if (original) {
await fs.writeFile(filePath, original, `utf-8`)
} else if (original === false) {
await fs.remove(filePath)
} else {
console.log(`Didn't make changes to "${fileArg}". Nothing to restore.`)
}
history.delete(filePath)
return
}
let exists = true
if (!fs.existsSync(filePath)) {
exists = false
@@ -66,7 +50,7 @@ async function update() {
`utf8`
)
}
let file = await fs.readFile(filePath, `utf8`)
const file = await fs.readFile(filePath, `utf8`)

if (!history.has(filePath)) {
history.set(filePath, exists ? file : false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { graphql, useStaticQuery } from "gatsby"

export function use404HistoryStaticQuery() {
return useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-404-to-B-to-404-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { graphql, useStaticQuery } from "gatsby"

export function use404LinkStaticQuery() {
return useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-404-to-B-to-404-link" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from "react"
import { graphql } from "gatsby"

export function QueryDataCachesView({
data,
pageType,
dataType,
path,
prefix = ``,
}) {
if (
pageType !== `A` &&
pageType !== `B` &&
pageType !== `client-only` &&
pageType !== `404`
) {
throw new Error(
`[QueryDataCachesView] Wrong page type - ${JSON.stringify(pageType)}`
)
}

if (dataType !== `page-query` && dataType !== `static-query`) {
throw new Error(
`[QueryDataCachesView] Wrong data type - ${JSON.stringify(dataType)}`
)
}

return (
<>
<h1 data-testid={`${prefix}query-data-caches-page-title`}>
This is page {pageType}
</h1>
<h2>Page query</h2>
<p>
<span data-testid={`${prefix}${dataType}-result`}>
{data.queryDataCachesJson.selector} /{` `}
{data.queryDataCachesJson.initialOrSecond}:{` `}
{data.queryDataCachesJson.status}
</span>
</p>
{path && (
<p>
Canonical path: <span data-testid={`${prefix}page-path`}>{path}</span>
</p>
)}
</>
)
}

export const fragments = graphql`
fragment QueryDataCachesBaseFragment on QueryDataCachesJson {
selector
status
}
fragment QueryDataCachesFragmentInitialPage on QueryDataCachesJson {
...QueryDataCachesBaseFragment
initialOrSecond: dummy(text: "initial-page")
}
fragment QueryDataCachesFragmentSecondPage on QueryDataCachesJson {
...QueryDataCachesBaseFragment
initialOrSecond: dummy(text: "second-page")
}
`
74 changes: 73 additions & 1 deletion e2e-tests/development-runtime/src/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,86 @@
import React from "react"
import { graphql, Link } from "gatsby"

import Layout from "../components/layout"
import SEO from "../components/seo"

const NotFoundPage = () => (
import { QueryDataCachesView } from "../components/query-data-caches/view"
import { use404LinkStaticQuery } from "../components/query-data-caches/static-query-404-link"
import { use404HistoryStaticQuery } from "../components/query-data-caches/static-query-404-history"

// FIXME: implementation showing 404 page is special cased and doesn't have all the props that other pages have
// in particular `path` and `uri` props are missing. This is just a hack to show canonical path of the 404 page
// in QueryDataCachesView helper component
const path = `/404.html`

function QueryDataCachesWrapper({ data, slug, prefix, ...rest }) {
return (
<fieldset>
<legend>{slug}</legend>
<QueryDataCachesView
data={{ queryDataCachesJson: data }}
pageType="404"
path={path}
prefix={prefix}
{...rest}
/>

{/* <pre>{JSON.stringify({ data, path }, null, 2)}</pre> */}
</fieldset>
)
}

const NotFoundPage = ({ data }) => (
<Layout>
<SEO title="404: Not found" />
<h1 data-testid="page-title">NOT FOUND</h1>
<p>You just hit a route that does not exist... the sadness.</p>
<fieldset>
<legend>query-data-caches</legend>
<QueryDataCachesWrapper
data={data.pageLink}
slug="page-query-404-to-B-to-404-link"
dataType="page-query"
prefix="page-link-"
/>
<QueryDataCachesWrapper
data={use404LinkStaticQuery().queryDataCachesJson}
slug="static-query-404-to-B-to-404-link"
dataType="static-query"
prefix="static-link-"
/>
<QueryDataCachesWrapper
data={data.pageHistory}
slug="page-query-404-to-B-to-404-history"
dataType="page-query"
prefix="page-history-"
/>
<QueryDataCachesWrapper
data={use404HistoryStaticQuery().queryDataCachesJson}
slug="static-query-404-to-B-to-404-history"
dataType="static-query"
prefix="static-history-"
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</fieldset>
</Layout>
)

export default NotFoundPage

export const query = graphql`
{
pageLink: queryDataCachesJson(
selector: { eq: "page-query-404-to-B-to-404-link" }
) {
...QueryDataCachesFragmentInitialPage
}
pageHistory: queryDataCachesJson(
selector: { eq: "page-query-404-to-B-to-404-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQuery404toBto404HistoryPageB({ data, path }) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
prefix="page-history-"
/>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-404-to-B-to-404-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQuery404toBto404LinkPageB({ data, path }) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
prefix="page-link-"
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(selector: { eq: "page-query-404-to-B-to-404-link" }) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryCOtoBtoCOHistoryPageA({ data, path }) {
return (
<>
<QueryDataCachesView
data={data}
pageType="client-only"
dataType="page-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(selector: { eq: "page-query-CO-to-B-to-CO-history" }) {
...QueryDataCachesFragmentInitialPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react"
import { graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryCOtoBtoCOHistoryPageB({ data, path }) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
/>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(selector: { eq: "page-query-CO-to-B-to-CO-history" }) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryCOtoBtoCOLinkPageA({ data, path }) {
return (
<>
<QueryDataCachesView
data={data}
pageType="client-only"
dataType="page-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(selector: { eq: "page-query-CO-to-B-to-CO-link" }) {
...QueryDataCachesFragmentInitialPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryCOtoBtoCOLinkPageB({ data, path }) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(selector: { eq: "page-query-CO-to-B-to-CO-link" }) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryNoTrailingSlashAtoBtoAHistoryPageA({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="page-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-no-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryNoTrailingSlashAtoBtoAHistoryPageB({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
/>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-no-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryNoTrailingSlashAtoBtoALinkPageA({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="page-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-no-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryNoTrailingSlashAtoBtoALinkPageB({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-no-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryWithTrailingSlashAtoBtoAHistoryPageA({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="page-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-with-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryWithTrailingSlashAtoBtoAHistoryPageB({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
/>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-with-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryWithTrailingSlashAtoBtoALinkPageA({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="page-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-with-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react"
import { Link, graphql } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function PageQueryWithTrailingSlashAtoBtoALinkPageB({
data,
path,
}) {
return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="page-query"
path={path}
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}

export const query = graphql`
{
queryDataCachesJson(
selector: { eq: "page-query-with-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQuery404toBto404HistoryPageB({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-404-to-B-to-404-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
prefix="static-history-"
/>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQuery404toBto404LinkPageB({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-404-to-B-to-404-link" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
prefix="static-link-"
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryCOtoBtoCOHistoryPageA({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-CO-to-B-to-CO-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="client-only"
dataType="static-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react"
import { graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryCOtoBtoCOHistoryPageB({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-CO-to-B-to-CO-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
/>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryCOtoBtoCOLinkPageA({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(selector: { eq: "static-query-CO-to-B-to-CO-link" }) {
...QueryDataCachesFragmentInitialPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="client-only"
dataType="static-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryCOtoBtoCOLinkPageB({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(selector: { eq: "static-query-CO-to-B-to-CO-link" }) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryNoTrailingSlashAtoBtoAHistoryPageA({
path,
}) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-no-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="static-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import { graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryNoTrailingSlashAtoBtoAHistoryPageB({
path,
}) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-no-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
/>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryNoTrailingSlashAtoBtoALinkPageA({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-no-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="static-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryNoTrailingSlashAtoBtoALinkPageB({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-no-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryWithTrailingSlashAtoBtoAHistoryPageA({
path,
}) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-with-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="static-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import { graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryWithTrailingSlashAtoBtoAHistoryPageB({
path,
}) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-with-trailing-slash-A-to-B-to-A-history" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
/>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryWithTrailingSlashAtoBtoALinkPageA({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-with-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentInitialPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="A"
dataType="static-query"
path={path}
/>
<Link to="../page-B" data-testid="page-b-link">
Go to page B
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import { Link, graphql, useStaticQuery } from "gatsby"
import { QueryDataCachesView } from "../../../components/query-data-caches/view"

export default function StaticQueryWithTrailingSlashAtoBtoALinkPageB({ path }) {
const data = useStaticQuery(graphql`
{
queryDataCachesJson(
selector: { eq: "static-query-with-trailing-slash-A-to-B-to-A-link" }
) {
...QueryDataCachesFragmentSecondPage
}
}
`)

return (
<>
<QueryDataCachesView
data={data}
pageType="B"
dataType="static-query"
path={path}
/>
<Link to="../page-A" data-testid="page-a-link">
Go back to page A
</Link>
</>
)
}
Original file line number Diff line number Diff line change
@@ -6,3 +6,6 @@ yarn-error.log
# Build directory
/public
.DS_Store

# Cypress output
cypress/videos/
3 changes: 3 additions & 0 deletions e2e-tests/mdx-less-babel/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"baseUrl": "http://localhost:9000"
}
38 changes: 38 additions & 0 deletions e2e-tests/mdx-less-babel/cypress/integration/pages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* global cy */

describe(`Pages`, () => {
it(`can be created with MDX`, () => {
cy.visit(`/`).waitForRouteChange()
cy.get(`h2`).invoke(`text`).should(`eq`, `Do you work`)
})

it(`can include shortcode component`, () => {
cy.visit(`/`).waitForRouteChange()
cy.getTestElement(`shortcode`).contains(`I am an example of a component in MDX.`)
})

it(`can include external import`, () => {
cy.visit(`/`).waitForRouteChange()
cy.getTestElement(`external`).contains(`Now an external import`)
})

it (`generates slug for mdx in pages dir`, () => {
cy.visit(`/list`).waitForRouteChange()
cy.getTestElement(`mdx-slug`).contains(`another`)
})

it (`generates complex slug with md extension`, () => {
cy.visit(`/list`).waitForRouteChange()
cy.getTestElement(`md-slug`).contains(`my-blog`)
})

it (`generates a slug with an index file`, () => {
cy.visit(`/list`).waitForRouteChange()
cy.getTestElement(`complex-slug`).contains(`about`)
})

it (`generates a slug with a slash`, () => {
cy.visit(`/list`).waitForRouteChange()
cy.getTestElement(`embed-slug`).contains(`about/embedded`)
})
})
17 changes: 17 additions & 0 deletions e2e-tests/mdx-less-babel/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
16 changes: 16 additions & 0 deletions e2e-tests/mdx-less-babel/cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

import "gatsby-cypress"
44 changes: 44 additions & 0 deletions e2e-tests/mdx-less-babel/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
siteMetadata: {
title: `Gatsby MDX e2e`,
},
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/pages/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/posts`,
},
},
{
resolve: `gatsby-plugin-mdx`,
options: {
lessBabel: true,
extensions: [`.mdx`, `.md`],
defaultLayouts: {
default: require.resolve("./src/components/layout.js"),
},
remarkPlugins: [remarkRequireFilePathPlugin],
},
},
],
}

/**
* This is a test to ensure that `gatsby-plugin-mdx` correctly pass the `file` argument to the underlying remark plugins.
* See #26914 for more info.
*/
function remarkRequireFilePathPlugin() {
return function transformer(tree, file) {
if (!file.dirname) {
throw new Error("No directory name for this markdown file!")
}
}
}
37 changes: 37 additions & 0 deletions e2e-tests/mdx-less-babel/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "gatsby-mdx-tester",
"description": "Gatsby MDX tester",
"version": "1.0.0",
"dependencies": {
"@mdx-js/mdx": "^1.6.6",
"@mdx-js/react": "^1.6.6",
"cypress": "^3.1.0",
"gatsby": "^2.0.118",
"gatsby-plugin-mdx": "^1.2.19",
"gatsby-source-filesystem": "^2.3.14",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"theme-ui": "^0.3.1"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write '**/*.js'",
"test": "cross-env CYPRESS_SUPPORT=y npm run build && npm run start-server-and-test",
"start-server-and-test": "start-server-and-test serve http://localhost:9000 cy:run",
"serve": "gatsby serve",
"cy:open": "cypress open",
"cy:run": "(is-ci && cypress run --browser chrome --record) || cypress run --browser chrome"
},
"devDependencies": {
"cross-env": "^5.2.0",
"gatsby-cypress": "^0.1.7",
"is-ci": "^2.0.0",
"prettier": "2.0.4",
"start-server-and-test": "^1.7.1"
}
}
7 changes: 7 additions & 0 deletions e2e-tests/mdx-less-babel/src/components/example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react"

const Example = () => (
<div data-testid="shortcode">I am an example of a component in MDX.</div>
)

export default Example
10 changes: 10 additions & 0 deletions e2e-tests/mdx-less-babel/src/components/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react"
import { MDXProvider } from "@mdx-js/react"
import Example from "./example"

const shortcodes = { Example }
export default function Layout({ children }) {
return (
<MDXProvider components={shortcodes}>{children}</MDXProvider>
)
}
1 change: 1 addition & 0 deletions e2e-tests/mdx-less-babel/src/pages/another.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is to add another source page for slugification.
17 changes: 17 additions & 0 deletions e2e-tests/mdx-less-babel/src/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Message } from "theme-ui"

Let's go MDX!

## Do you work

- nobody knows

````
```javascript
const codefence = true
```
````

<Example/>

<Message data-testid="external">Now an external import</Message>
46 changes: 46 additions & 0 deletions e2e-tests/mdx-less-babel/src/pages/list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react'
import { graphql } from 'gatsby'

const ListPage = ({ data }) => {
const anotherPage = data.another.nodes[0]
const blogPage = data.blog.nodes[0]
const aboutPage = data.complex.nodes[0]
const embedPage = data.embed.nodes[0]


return (
<div>
<div data-testid="mdx-slug">{anotherPage.slug}</div>
<div data-testid="md-slug">{blogPage.slug}</div>
<div data-testid="complex-slug">{aboutPage.slug}</div>
<div data-testid="embed-slug">{embedPage.slug}</div>

</div>
)
}

export const query = graphql`
{
another: allMdx(filter: {slug: {eq: "another"}}) {
nodes {
slug
}
}
blog: allMdx(filter: {slug: {eq: "my-blog"}}) {
nodes {
slug
}
}
complex: allMdx(filter: {slug: {eq: "about/"}}) {
nodes {
slug
}
}
embed: allMdx(filter: {slug: {eq: "about/embedded"}}) {
nodes {
slug
}
}
}
`
export default ListPage
1 change: 1 addition & 0 deletions e2e-tests/mdx-less-babel/src/posts/about/embedded.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a page that should include a slash slug
1 change: 1 addition & 0 deletions e2e-tests/mdx-less-babel/src/posts/about/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This should be an about page we can access with a nested slug.
1 change: 1 addition & 0 deletions e2e-tests/mdx-less-babel/src/posts/my-blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Let's see if we can generate a slug for this too
1 change: 1 addition & 0 deletions e2e-tests/mdx/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ module.exports = {
{
resolve: `gatsby-plugin-mdx`,
options: {
lessBabel: false,
extensions: [`.mdx`, `.md`],
defaultLayouts: {
default: require.resolve("./src/components/layout.js"),
1 change: 0 additions & 1 deletion examples/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions examples/client-only-paths/.eslintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions examples/client-only-paths/package.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
"version": "1.0.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-plugin-netlify": "^2.3.15",
"gatsby-plugin-typography": "^2.5.11",
"gatsby": "next",
"gatsby-plugin-netlify": "next",
"gatsby-plugin-typography": "next",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-transition-group": "^2.9.0",
8 changes: 4 additions & 4 deletions examples/creating-source-plugins/example-site/package.json
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-image": "^2.4.19",
"gatsby-plugin-sharp": "^2.6.36",
"gatsby-transformer-sharp": "^2.5.15",
"gatsby": "next",
"gatsby-image": "next",
"gatsby-plugin-sharp": "next",
"gatsby-transformer-sharp": "next",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
"apollo-link-http": "^1.5.17",
"apollo-link-ws": "^1.0.20",
"apollo-utilities": "^1.3.4",
"gatsby-source-filesystem": "^2.3.30",
"gatsby-source-filesystem": "next",
"graphql": "^15.3.0",
"graphql-tag": "^2.11.0",
"node-fetch": "^2.6.1",
File renamed without changes.
6 changes: 3 additions & 3 deletions examples/data-fetching/package.json
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
"author": "@gatsbyjs",
"dependencies": {
"dotenv": "^8.2.0",
"gatsby": "^2.24.63",
"gatsby-plugin-react-helmet": "^3.3.11",
"gatsby-source-graphql": "^2.7.4",
"gatsby": "next",
"gatsby-plugin-react-helmet": "next",
"gatsby-source-graphql": "next",
"prop-types": "^15.7.2",
"react": "^16.11.0",
"react-dom": "^16.11.0",
16 changes: 8 additions & 8 deletions examples/ecommerce-tutorial-with-stripe/package.json
Original file line number Diff line number Diff line change
@@ -6,15 +6,15 @@
"author": "@thorwebdev",
"dependencies": {
"@stripe/stripe-js": "^1.9.0",
"gatsby": "^2.24.63",
"gatsby-image": "^2.4.19",
"gatsby-plugin-manifest": "^2.4.30",
"gatsby-plugin-offline": "^2.2.10",
"gatsby-plugin-react-helmet": "^3.3.11",
"gatsby-plugin-sharp": "^2.6.36",
"gatsby-source-filesystem": "^2.3.30",
"gatsby": "next",
"gatsby-image": "next",
"gatsby-plugin-manifest": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-react-helmet": "next",
"gatsby-plugin-sharp": "next",
"gatsby-source-filesystem": "next",
"gatsby-source-stripe": "^3.1.1",
"gatsby-transformer-sharp": "^2.5.15",
"gatsby-transformer-sharp": "next",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
8 changes: 4 additions & 4 deletions examples/feed/package.json
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@
"version": "1.0.0",
"author": "Nicholas Young <nicholas@nicholaswyoung.com>",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-plugin-feed": "^2.5.12",
"gatsby-source-filesystem": "^2.3.30",
"gatsby-transformer-remark": "^2.8.35",
"gatsby": "next",
"gatsby-plugin-feed": "next",
"gatsby-source-filesystem": "next",
"gatsby-transformer-remark": "next",
"react": "^16.4.1",
"react-dom": "^16.4.1"
},
8 changes: 0 additions & 8 deletions examples/gatsbygram/.eslintrc.json

This file was deleted.

24 changes: 12 additions & 12 deletions examples/gatsbygram/package.json
Original file line number Diff line number Diff line change
@@ -6,18 +6,18 @@
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"core-js": "^2.6.11",
"gatsby": "^2.24.63",
"gatsby-core-utils": "^1.3.20",
"gatsby-image": "^2.4.19",
"gatsby-plugin-glamor": "^2.3.11",
"gatsby-plugin-google-analytics": "^2.3.14",
"gatsby-plugin-manifest": "^2.4.30",
"gatsby-plugin-offline": "^2.2.10",
"gatsby-plugin-sharp": "^2.6.36",
"gatsby-plugin-typography": "^2.5.11",
"gatsby-source-filesystem": "^2.3.30",
"gatsby-transformer-json": "^2.4.12",
"gatsby-transformer-sharp": "^2.5.15",
"gatsby": "next",
"gatsby-core-utils": "next",
"gatsby-image": "next",
"gatsby-plugin-glamor": "next",
"gatsby-plugin-google-analytics": "next",
"gatsby-plugin-manifest": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-sharp": "next",
"gatsby-plugin-typography": "next",
"gatsby-source-filesystem": "next",
"gatsby-transformer-json": "next",
"gatsby-transformer-sharp": "next",
"glamor": "^2.20.40",
"instagram-screen-scrape": "^2.0.0",
"lodash": "^4.17.20",
21 changes: 0 additions & 21 deletions examples/graphql-reference/LICENSE

This file was deleted.

20 changes: 10 additions & 10 deletions examples/graphql-reference/package.json
Original file line number Diff line number Diff line change
@@ -5,16 +5,16 @@
"version": "0.1.0",
"author": "LekoArts <hello@lekoarts.de>",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-image": "^2.4.19",
"gatsby-plugin-react-helmet": "^3.3.11",
"gatsby-plugin-sharp": "^2.6.36",
"gatsby-plugin-typography": "^2.5.11",
"gatsby-remark-responsive-iframe": "^2.4.14",
"gatsby-source-filesystem": "^2.3.30",
"gatsby-transformer-remark": "^2.8.35",
"gatsby-transformer-sharp": "^2.5.15",
"gatsby-transformer-yaml": "^2.4.12",
"gatsby": "next",
"gatsby-image": "next",
"gatsby-plugin-react-helmet": "next",
"gatsby-plugin-sharp": "next",
"gatsby-plugin-typography": "next",
"gatsby-remark-responsive-iframe": "next",
"gatsby-source-filesystem": "next",
"gatsby-transformer-remark": "next",
"gatsby-transformer-sharp": "next",
"gatsby-transformer-yaml": "next",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-helmet": "^5.2.1",
8 changes: 0 additions & 8 deletions examples/hn/.eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions examples/hn/package.json
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"flat": "^2.0.1",
"gatsby": "^2.24.63",
"gatsby-core-utils": "^1.3.20",
"gatsby-plugin-manifest": "^2.4.30",
"gatsby-source-hacker-news": "^2.4.11",
"gatsby": "next",
"gatsby-core-utils": "next",
"gatsby-plugin-manifest": "next",
"gatsby-source-hacker-news": "next",
"lodash": "^4.17.20",
"react": "^16.3.1",
"react-dom": "^16.3.1",
18 changes: 9 additions & 9 deletions examples/image-processing/package.json
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@
"version": "1.0.0",
"author": "Florian Kissling <sechskilo@gmail.com>",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-image": "^2.4.19",
"gatsby-plugin-google-analytics": "^2.3.14",
"gatsby-plugin-offline": "^2.2.10",
"gatsby-plugin-sharp": "^2.6.36",
"gatsby-plugin-typography": "^2.5.11",
"gatsby-source-drupal": "^3.5.33",
"gatsby-source-filesystem": "^2.3.30",
"gatsby-transformer-sharp": "^2.5.15",
"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",
"react-typography": "^0.16.19",
8 changes: 0 additions & 8 deletions examples/no-plugins/.eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/no-plugins/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions examples/no-plugins/package.json

This file was deleted.

28 changes: 0 additions & 28 deletions examples/no-plugins/src/components/layout.js

This file was deleted.

45 changes: 0 additions & 45 deletions examples/no-plugins/src/html.js

This file was deleted.

10 changes: 0 additions & 10 deletions examples/no-plugins/src/pages/a.js

This file was deleted.

10 changes: 0 additions & 10 deletions examples/no-plugins/src/pages/b.js

This file was deleted.

10 changes: 0 additions & 10 deletions examples/no-plugins/src/pages/c.js

This file was deleted.

10 changes: 0 additions & 10 deletions examples/no-plugins/src/pages/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions examples/no-trailing-slashes/.eslintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions examples/no-trailing-slashes/package.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
"version": "1.0.0",
"author": "Scotty Eckenthal <scott.eckenthal@gmail.com>",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-plugin-google-analytics": "^2.3.14",
"gatsby-plugin-offline": "^2.2.10",
"gatsby": "next",
"gatsby-plugin-google-analytics": "next",
"gatsby-plugin-offline": "next",
"lodash": "^4.17.20",
"react": "^16.4.0",
"react-dom": "^16.4.0",
2 changes: 1 addition & 1 deletion examples/recipe-createPage/package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"version": "0.1.0",
"author": "@gatsbyjs",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby": "next",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
2 changes: 1 addition & 1 deletion examples/recipe-linking-between-pages/package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"version": "0.1.0",
"author": "@gatsbyjs",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby": "next",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
10 changes: 5 additions & 5 deletions examples/recipe-sourcing-contentful/package.json
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@
"version": "0.1.0",
"author": "@gatsbyjs",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-image": "^2.4.19",
"gatsby-plugin-offline": "^2.2.10",
"gatsby-source-contentful": "^2.3.46",
"gatsby-transformer-remark": "^2.8.35",
"gatsby": "next",
"gatsby-image": "next",
"gatsby-plugin-offline": "next",
"gatsby-source-contentful": "next",
"gatsby-transformer-remark": "next",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0"
6 changes: 3 additions & 3 deletions examples/recipe-sourcing-markdown/package.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
"version": "0.1.0",
"author": "@gatsbyjs",
"dependencies": {
"gatsby": "^2.24.63",
"gatsby-source-filesystem": "^2.3.30",
"gatsby-transformer-remark": "^2.8.35",
"gatsby": "next",
"gatsby-source-filesystem": "next",
"gatsby-transformer-remark": "next",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
Loading