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: 1f30882907b20b63df4d63b97a80b233a7da37f8
Choose a base ref
...
head repository: gatsbyjs/gatsby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: babel-preset-gatsby@2.8.0
Choose a head ref

Commits on Feb 7, 2022

  1. chore(release): Publish next pre-minor

     - babel-plugin-remove-graphql-queries@4.8.0-next.0
     - babel-preset-gatsby-package@2.8.0-next.0
     - babel-preset-gatsby@2.8.0-next.0
     - create-gatsby@2.8.0-next.0
     - gatsby-cli@4.8.0-next.0
     - gatsby-codemods@3.8.0-next.0
     - gatsby-core-utils@3.8.0-next.0
     - gatsby-cypress@2.8.0-next.0
     - gatsby-design-tokens@4.8.0-next.0
     - gatsby-dev-cli@4.8.0-next.0
     - gatsby-graphiql-explorer@2.8.0-next.0
     - gatsby-legacy-polyfills@2.8.0-next.0
     - gatsby-link@4.8.0-next.0
     - gatsby-page-utils@2.8.0-next.0
     - gatsby-plugin-benchmark-reporting@2.8.0-next.0
     - gatsby-plugin-canonical-urls@4.8.0-next.0
     - gatsby-plugin-catch-links@4.8.0-next.0
     - gatsby-plugin-coffeescript@4.8.0-next.0
     - gatsby-plugin-create-client-paths@4.8.0-next.0
     - gatsby-plugin-cxs@4.8.0-next.0
     - gatsby-plugin-emotion@7.8.0-next.0
     - gatsby-plugin-facebook-analytics@4.8.0-next.0
     - gatsby-plugin-feed@4.8.0-next.0
     - gatsby-plugin-flow@3.8.0-next.0
     - gatsby-plugin-fullstory@4.8.0-next.0
     - gatsby-plugin-gatsby-cloud@4.8.0-next.0
     - gatsby-plugin-google-analytics@4.8.0-next.0
     - gatsby-plugin-google-gtag@4.8.0-next.0
     - gatsby-plugin-google-tagmanager@4.8.0-next.0
     - gatsby-plugin-graphql-config@1.8.0-next.0
     - gatsby-plugin-image@2.8.0-next.0
     - gatsby-plugin-jss@4.8.0-next.0
     - gatsby-plugin-layout@3.8.0-next.0
     - gatsby-plugin-less@6.8.0-next.0
     - gatsby-plugin-lodash@5.8.0-next.0
     - gatsby-plugin-manifest@4.8.0-next.0
     - gatsby-plugin-mdx@3.8.0-next.0
     - gatsby-plugin-netlify-cms@6.8.0-next.0
     - gatsby-plugin-no-sourcemaps@4.8.0-next.0
     - gatsby-plugin-nprogress@4.8.0-next.0
     - gatsby-plugin-offline@5.8.0-next.0
     - gatsby-plugin-page-creator@4.8.0-next.0
     - gatsby-plugin-postcss@5.8.0-next.0
     - gatsby-plugin-preact@6.8.0-next.0
     - gatsby-plugin-preload-fonts@3.8.0-next.0
     - gatsby-plugin-react-css-modules@4.8.0-next.0
     - gatsby-plugin-react-helmet@5.8.0-next.0
     - gatsby-plugin-remove-trailing-slashes@4.8.0-next.0
     - gatsby-plugin-sass@5.8.0-next.0
     - gatsby-plugin-schema-snapshot@3.8.0-next.0
     - gatsby-plugin-sharp@4.8.0-next.0
     - gatsby-plugin-sitemap@5.8.0-next.0
     - gatsby-plugin-styled-components@5.8.0-next.0
     - gatsby-plugin-styled-jsx@5.8.0-next.0
     - gatsby-plugin-styletron@7.8.0-next.0
     - gatsby-plugin-stylus@4.8.0-next.0
     - gatsby-plugin-subfont@4.8.0-next.0
     - gatsby-plugin-twitter@4.8.0-next.0
     - gatsby-plugin-typescript@4.8.0-next.0
     - gatsby-plugin-typography@4.8.0-next.0
     - gatsby-plugin-utils@3.2.0-next.0
     - gatsby-react-router-scroll@5.8.0-next.0
     - gatsby-remark-autolink-headers@5.8.0-next.0
     - gatsby-remark-code-repls@6.8.0-next.0
     - gatsby-remark-copy-linked-files@5.8.0-next.0
     - gatsby-remark-custom-blocks@4.8.0-next.0
     - gatsby-remark-embed-snippet@7.8.0-next.0
     - gatsby-remark-graphviz@4.8.0-next.0
     - gatsby-remark-images-contentful@5.8.0-next.0
     - gatsby-remark-images@6.8.0-next.0
     - gatsby-remark-katex@6.8.0-next.0
     - gatsby-remark-prismjs@6.8.0-next.0
     - gatsby-remark-responsive-iframe@5.8.0-next.0
     - gatsby-remark-smartypants@5.8.0-next.0
     - gatsby-sharp@0.2.0-next.0
     - gatsby-source-contentful@7.6.0-next.0
     - gatsby-source-drupal@5.8.0-next.0
     - gatsby-source-faker@4.8.0-next.0
     - gatsby-source-filesystem@4.8.0-next.0
     - gatsby-source-graphql@4.8.0-next.0
     - gatsby-source-hacker-news@4.8.0-next.0
     - gatsby-source-lever@4.8.0-next.0
     - gatsby-source-medium@4.8.0-next.0
     - gatsby-source-mongodb@4.8.0-next.0
     - gatsby-source-npm-package-search@4.8.0-next.0
     - gatsby-source-shopify@6.8.0-next.0
     - gatsby-source-wikipedia@4.8.0-next.0
     - gatsby-source-wordpress@6.8.0-next.0
     - gatsby-telemetry@3.8.0-next.0
     - gatsby-transformer-asciidoc@3.8.0-next.0
     - gatsby-transformer-csv@4.8.0-next.0
     - gatsby-transformer-documentationjs@6.8.0-next.0
     - gatsby-transformer-excel@4.8.0-next.0
     - gatsby-transformer-hjson@4.8.0-next.0
     - gatsby-transformer-javascript-frontmatter@4.8.0-next.0
     - gatsby-transformer-javascript-static-exports@4.8.0-next.0
     - gatsby-transformer-json@4.8.0-next.0
     - gatsby-transformer-pdf@3.8.0-next.0
     - gatsby-transformer-react-docgen@7.8.0-next.0
     - gatsby-transformer-remark@5.8.0-next.0
     - gatsby-transformer-screenshot@4.8.0-next.0
     - gatsby-transformer-sharp@4.8.0-next.0
     - gatsby-transformer-sqip@4.8.0-next.0
     - gatsby-transformer-toml@4.8.0-next.0
     - gatsby-transformer-xml@4.8.0-next.0
     - gatsby-transformer-yaml@4.8.0-next.0
     - gatsby-worker@1.8.0-next.0
     - gatsby@4.8.0-next.0
    imjoshin committed Feb 7, 2022
    Copy the full SHA
    459d61e View commit details
  2. Copy the full SHA
    540dfdf View commit details
  3. Copy the full SHA
    c38cb1f View commit details

Commits on Feb 8, 2022

  1. Copy the full SHA
    a11317d View commit details
  2. Copy the full SHA
    040603f View commit details
  3. Copy the full SHA
    a545a41 View commit details
  4. Typo fix (#34749)

    kyleslie2 authored Feb 8, 2022
    Copy the full SHA
    ede8b30 View commit details
  5. Copy the full SHA
    01adaff View commit details
  6. feat(create-gatsby): TypeScript option (#34611)

    Co-authored-by: Lennart <lekoarts@gmail.com>
    Co-authored-by: Jude Agboola <marvinjudehk@gmail.com>
    3 people authored Feb 8, 2022
    Copy the full SHA
    a78ef94 View commit details
  7. chore(release): Publish next

     - create-gatsby@2.8.0-next.1
     - gatsby-cli@4.8.0-next.1
     - gatsby-plugin-gatsby-cloud@4.8.0-next.1
     - gatsby@4.8.0-next.1
    LekoArts committed Feb 8, 2022
    Copy the full SHA
    76b9f5a View commit details
  8. chore(docs): Update "building a theme" tutorial (#34732)

    Co-authored-by: Lennart <lekoarts@gmail.com>
    paulduszak and LekoArts authored Feb 8, 2022
    Copy the full SHA
    9516f85 View commit details
  9. chore(docs): Release Notes for 4.7 (#34745)

    * Templated 4.7 release notes
    
    * Update index.md
    
    * move speed improvements to high level
    
    * Update index.md
    
    * Update index.md
    
    * Update index.md
    
    * typo
    
    * Add contributors
    
    * Update index.md
    
    * Lint fix
    
    * Lint fix
    
    Co-authored-by: Ward Peeters <ward@coding-tech.com>
    Co-authored-by: Lennart <lekoarts@gmail.com>
    3 people authored Feb 8, 2022
    Copy the full SHA
    31dcfb6 View commit details
  10. Copy the full SHA
    d3f2f5e View commit details
  11. chore(docs): Updated release notes for trailing slash (#34768)

    * Updated release notes for trailing slash
    
    Currently in public beta - we don't want to set the wrong expectation with our users. Thanks!
    
    * Lint fix
    
    Co-authored-by: Josh <jcjohnson77@gmail.com>
    pragmaticpat and imjoshin authored Feb 8, 2022
    Copy the full SHA
    e63e934 View commit details
  12. Copy the full SHA
    93a2071 View commit details

Commits on Feb 9, 2022

  1. Copy the full SHA
    f720571 View commit details
  2. Copy the full SHA
    f29ffb0 View commit details
  3. chore(changelogs): update changelogs (#34770)

    Co-authored-by: LekoArts <lekoarts@gmail.com>
    gatsbybot and LekoArts authored Feb 9, 2022
    Copy the full SHA
    f71b8a3 View commit details
  4. fix(deps): update starters and examples - gatsby (#34759)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Feb 9, 2022
    Copy the full SHA
    ec20301 View commit details
  5. fix(gatsby-source-wordpress): patch safari bug in source-wordpress' g…

    …atsby-browser (#34727)
    
    * patch safari bug
    
    * match all IOS safari clones
    TylerBarnes authored Feb 9, 2022
    Copy the full SHA
    b0e5ee4 View commit details

Commits on Feb 10, 2022

  1. chore: Add GatsbyConf 2022 banner to README (#34782)

    Co-authored-by: Lennart <lekoarts@gmail.com>
    loranallensmith and LekoArts authored Feb 10, 2022
    Copy the full SHA
    d846f89 View commit details

Commits on Feb 11, 2022

  1. feat(gatsby): Match node manifest pages by page context slug (#34790)

    * Match node manifest pages by page context slug
    
    * add docs link
    TylerBarnes authored Feb 11, 2022
    Copy the full SHA
    ba8e21c View commit details

Commits on Feb 13, 2022

  1. Copy the full SHA
    7b958f9 View commit details

Commits on Feb 14, 2022

  1. fix(deps): update dependency sharp to ^0.30.1 (#34755)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Feb 14, 2022
    Copy the full SHA
    326a483 View commit details
  2. Copy the full SHA
    bfd04d3 View commit details

Commits on Feb 15, 2022

  1. Copy the full SHA
    3d74584 View commit details
  2. refactor(core): Make load plugins modular, prepare for TS (#34813)

    * Refactor load plugins modules
    
    * Break loadConfigAndPlugins into two functions
    
    * Extract out local plugin check
    
    * Revert async back to original sync funcs
    
    * Adjust load config interface
    
    * Missed awaits
    tyhopp authored Feb 15, 2022
    Copy the full SHA
    3c3362b View commit details
  3. fix(core): Make filter/sort query only hold onto node properties it n…

    …eeds (#34747)
    
    Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
    imjoshin and pieh authored Feb 15, 2022
    Copy the full SHA
    3df8583 View commit details
  4. chore(gatsby): upgrade from lmdb-store to lmdb (#34576)

    * optimistic bump
    
    * .clear -> clearSync
    
    * tmp: patch lmdb so we can bundle it for engines
    
    * adjust cache-resilience to import from lmdb
    
    * bump lmdb to latest
    
    * use clearKeptObjects()
    
    * fix mocking os.platform() in tests causing loading of wrong lmdb binary
    
    * ensure single instance of lmdb in a process - for gatsby serve case mostly
    
    * add comment about lmdb webpack loader patch
    pieh authored Feb 15, 2022
    Copy the full SHA
    54d29c4 View commit details
  5. chore(release): Publish next

     - create-gatsby@2.8.0-next.2
     - gatsby-cli@4.8.0-next.2
     - gatsby-link@4.8.0-next.1
     - gatsby-plugin-cxs@4.8.0-next.1
     - gatsby-plugin-feed@4.8.0-next.1
     - gatsby-plugin-flow@3.8.0-next.1
     - gatsby-plugin-gatsby-cloud@4.8.0-next.2
     - gatsby-plugin-google-tagmanager@4.8.0-next.1
     - gatsby-plugin-manifest@4.8.0-next.1
     - gatsby-plugin-mdx@3.8.0-next.1
     - gatsby-plugin-offline@5.8.0-next.1
     - gatsby-plugin-page-creator@4.8.0-next.1
     - gatsby-plugin-sass@5.8.0-next.1
     - gatsby-plugin-sharp@4.8.0-next.1
     - gatsby-plugin-sitemap@5.8.0-next.1
     - gatsby-plugin-twitter@4.8.0-next.1
     - gatsby-plugin-utils@3.2.0-next.1
     - gatsby-remark-autolink-headers@5.8.0-next.1
     - gatsby-remark-images-contentful@5.8.0-next.1
     - gatsby-remark-images@6.8.0-next.1
     - gatsby-sharp@0.2.0-next.1
     - gatsby-source-contentful@7.6.0-next.1
     - gatsby-source-shopify@6.8.0-next.1
     - gatsby-source-wordpress@6.8.0-next.1
     - gatsby-transformer-remark@5.8.0-next.1
     - gatsby-transformer-sharp@4.8.0-next.1
     - gatsby-transformer-sqip@4.8.0-next.1
     - gatsby@4.8.0-next.2
    pieh committed Feb 15, 2022
    Copy the full SHA
    76c89d8 View commit details

Commits on Feb 16, 2022

  1. fix(deps): update starters and examples gatsby packages to ^4.7.2 (#3…

    …4822)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Feb 16, 2022
    Copy the full SHA
    a2f99af View commit details
  2. chore(changelogs): update changelogs (#34826)

    Co-authored-by: Lennart <lekoarts@gmail.com>
    gatsbybot and LekoArts authored Feb 16, 2022
    Copy the full SHA
    21ef185 View commit details
  3. Copy the full SHA
    f2d4830 View commit details
  4. chore(gatsby): cache shouldn't reference nodes strongly (#34821)

    * chore: cache shouldn't reference nodes strongly
    
    * Update lmdb-datastore.ts
    pieh authored Feb 16, 2022
    Copy the full SHA
    9f23dec View commit details
  5. Copy the full SHA
    4c832bf View commit details
  6. chore(release): Publish next

     - babel-plugin-remove-graphql-queries@4.8.0-next.1
     - babel-preset-gatsby@2.8.0-next.1
     - gatsby-cli@4.8.0-next.3
     - gatsby-core-utils@3.8.0-next.1
     - gatsby-link@4.8.0-next.2
     - gatsby-page-utils@2.8.0-next.1
     - gatsby-plugin-benchmark-reporting@2.8.0-next.1
     - gatsby-plugin-gatsby-cloud@4.8.0-next.3
     - gatsby-plugin-image@2.8.0-next.1
     - gatsby-plugin-manifest@4.8.0-next.2
     - gatsby-plugin-mdx@3.8.0-next.2
     - gatsby-plugin-offline@5.8.0-next.2
     - gatsby-plugin-page-creator@4.8.0-next.2
     - gatsby-plugin-preload-fonts@3.8.0-next.1
     - gatsby-plugin-sharp@4.8.0-next.2
     - gatsby-plugin-typescript@4.8.0-next.1
     - gatsby-remark-images@6.8.0-next.2
     - gatsby-source-contentful@7.6.0-next.2
     - gatsby-source-drupal@5.8.0-next.1
     - gatsby-source-filesystem@4.8.0-next.1
     - gatsby-source-graphql@4.8.0-next.1
     - gatsby-source-shopify@6.8.0-next.2
     - gatsby-source-wordpress@6.8.0-next.2
     - gatsby-telemetry@3.8.0-next.1
     - gatsby-transformer-remark@5.8.0-next.2
     - gatsby-transformer-sqip@4.8.0-next.2
     - gatsby@4.8.0-next.3
    pieh committed Feb 16, 2022
    Copy the full SHA
    45cb1f1 View commit details
  7. test(gatsby): Add a memory test suite command to the memory benchmark (

    …#34810)
    
    * Create memory test suite for measuring multiple runs
    
    * Minor updates
    
    * Add inc suite
    
    * Increase node's heap limit
    
    * Add memory tracking
    
    * Revert "Add memory tracking"
    
    This reverts commit 539291c.
    
    * Add docker rebuild command
    
    * Rework what/how results are given
    
    * Actually use path var
    
    * Revert "Revert "Add memory tracking""
    
    This reverts commit f28ba4a.
    
    * Use faster method for grabbing memory usage
    
    * Output fixes
    
    * Update output dir and add comments
    
    * Update readme
    
    * Update readme again
    
    * Add ability to conditionally set jemalloc as the memory allocator
    imjoshin authored Feb 16, 2022
    Copy the full SHA
    056b48e View commit details

Commits on Feb 17, 2022

  1. Copy the full SHA
    ee8c874 View commit details
  2. fix(gatsby-source-contentful): avoid confusion of Gatsby node and Con…

    …tentful node count in logs (#34830)
    axe312ger authored Feb 17, 2022
    Copy the full SHA
    ac1d777 View commit details
  3. feat(gatsby-core-utils): improve fetch-remote-file (#34758)

    * feat(gatsby-core-utils): improve fetch-remote-file
    
    * feat: use cacheKey in fetch-remote-file
    
    * use async file operations
    
    * Improve tests + low hanging fruit
    
    * revert wordpress
    
    * feat: make sure 304 works
    
    * fix jest config wordpress
    
    * add integration test
    
    * update tests
    wardpeet authored Feb 17, 2022
    Copy the full SHA
    19b0304 View commit details

Commits on Feb 21, 2022

  1. fix(gatsby): Remove double enhanced-resolve dep (#34854) (#34889)

    * initial
    
    * use 5.8.3 to not have multiple versions
    
    (cherry picked from commit 2c141b8)
    
    Co-authored-by: Lennart <lekoarts@gmail.com>
    gatsbybot and LekoArts authored Feb 21, 2022
    Copy the full SHA
    148d016 View commit details
  2. fix(gatsby-core-utils): fix 304 when file does not exists (#34842) (#…

    …34888)
    
    (cherry picked from commit 1f3eee0)
    
    Co-authored-by: Ward Peeters <ward@coding-tech.com>
    gatsbybot and wardpeet authored Feb 21, 2022
    Copy the full SHA
    9a579f1 View commit details

Commits on Feb 22, 2022

  1. fix(create-gatsby): Add required deps for theme-ui option (#34885) (#…

    …34897)
    
    * fix(create-gatsby): Add required deps for theme-ui option
    
    * Update styles.json
    
    Co-authored-by: Lennart <lekoarts@gmail.com>
    (cherry picked from commit b2c1092)
    
    Co-authored-by: Ty Hopp <tyhopp@users.noreply.github.com>
    gatsbybot and tyhopp authored Feb 22, 2022
    Copy the full SHA
    f5705b9 View commit details
  2. fix(gatsby): wait for LMDB upserts to finish before emitting ENGINES_…

    …READY (#34853) (#34896)
    
    (cherry picked from commit b4637c0)
    
    Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
    gatsbybot and pieh authored Feb 22, 2022
    Copy the full SHA
    9a616c0 View commit details
  3. chore(release): Publish

     - babel-plugin-remove-graphql-queries@4.8.0
     - babel-preset-gatsby-package@2.8.0
     - babel-preset-gatsby@2.8.0
     - create-gatsby@2.8.0
     - gatsby-cli@4.8.0
     - gatsby-codemods@3.8.0
     - gatsby-core-utils@3.8.0
     - gatsby-cypress@2.8.0
     - gatsby-design-tokens@4.8.0
     - gatsby-dev-cli@4.8.0
     - gatsby-graphiql-explorer@2.8.0
     - gatsby-legacy-polyfills@2.8.0
     - gatsby-link@4.8.0
     - gatsby-page-utils@2.8.0
     - gatsby-plugin-benchmark-reporting@2.8.0
     - gatsby-plugin-canonical-urls@4.8.0
     - gatsby-plugin-catch-links@4.8.0
     - gatsby-plugin-coffeescript@4.8.0
     - gatsby-plugin-create-client-paths@4.8.0
     - gatsby-plugin-cxs@4.8.0
     - gatsby-plugin-emotion@7.8.0
     - gatsby-plugin-facebook-analytics@4.8.0
     - gatsby-plugin-feed@4.8.0
     - gatsby-plugin-flow@3.8.0
     - gatsby-plugin-fullstory@4.8.0
     - gatsby-plugin-gatsby-cloud@4.8.0
     - gatsby-plugin-google-analytics@4.8.0
     - gatsby-plugin-google-gtag@4.8.0
     - gatsby-plugin-google-tagmanager@4.8.0
     - gatsby-plugin-graphql-config@1.8.0
     - gatsby-plugin-image@2.8.0
     - gatsby-plugin-jss@4.8.0
     - gatsby-plugin-layout@3.8.0
     - gatsby-plugin-less@6.8.0
     - gatsby-plugin-lodash@5.8.0
     - gatsby-plugin-manifest@4.8.0
     - gatsby-plugin-mdx@3.8.0
     - gatsby-plugin-netlify-cms@6.8.0
     - gatsby-plugin-no-sourcemaps@4.8.0
     - gatsby-plugin-nprogress@4.8.0
     - gatsby-plugin-offline@5.8.0
     - gatsby-plugin-page-creator@4.8.0
     - gatsby-plugin-postcss@5.8.0
     - gatsby-plugin-preact@6.8.0
     - gatsby-plugin-preload-fonts@3.8.0
     - gatsby-plugin-react-css-modules@4.8.0
     - gatsby-plugin-react-helmet@5.8.0
     - gatsby-plugin-remove-trailing-slashes@4.8.0
     - gatsby-plugin-sass@5.8.0
     - gatsby-plugin-schema-snapshot@3.8.0
     - gatsby-plugin-sharp@4.8.0
     - gatsby-plugin-sitemap@5.8.0
     - gatsby-plugin-styled-components@5.8.0
     - gatsby-plugin-styled-jsx@5.8.0
     - gatsby-plugin-styletron@7.8.0
     - gatsby-plugin-stylus@4.8.0
     - gatsby-plugin-subfont@4.8.0
     - gatsby-plugin-twitter@4.8.0
     - gatsby-plugin-typescript@4.8.0
     - gatsby-plugin-typography@4.8.0
     - gatsby-plugin-utils@3.2.0
     - gatsby-react-router-scroll@5.8.0
     - gatsby-remark-autolink-headers@5.8.0
     - gatsby-remark-code-repls@6.8.0
     - gatsby-remark-copy-linked-files@5.8.0
     - gatsby-remark-custom-blocks@4.8.0
     - gatsby-remark-embed-snippet@7.8.0
     - gatsby-remark-graphviz@4.8.0
     - gatsby-remark-images-contentful@5.8.0
     - gatsby-remark-images@6.8.0
     - gatsby-remark-katex@6.8.0
     - gatsby-remark-prismjs@6.8.0
     - gatsby-remark-responsive-iframe@5.8.0
     - gatsby-remark-smartypants@5.8.0
     - gatsby-sharp@0.2.0
     - gatsby-source-contentful@7.6.0
     - gatsby-source-drupal@5.8.0
     - gatsby-source-faker@4.8.0
     - gatsby-source-filesystem@4.8.0
     - gatsby-source-graphql@4.8.0
     - gatsby-source-hacker-news@4.8.0
     - gatsby-source-lever@4.8.0
     - gatsby-source-medium@4.8.0
     - gatsby-source-mongodb@4.8.0
     - gatsby-source-npm-package-search@4.8.0
     - gatsby-source-shopify@6.8.0
     - gatsby-source-wikipedia@4.8.0
     - gatsby-source-wordpress@6.8.0
     - gatsby-telemetry@3.8.0
     - gatsby-transformer-asciidoc@3.8.0
     - gatsby-transformer-csv@4.8.0
     - gatsby-transformer-documentationjs@6.8.0
     - gatsby-transformer-excel@4.8.0
     - gatsby-transformer-hjson@4.8.0
     - gatsby-transformer-javascript-frontmatter@4.8.0
     - gatsby-transformer-javascript-static-exports@4.8.0
     - gatsby-transformer-json@4.8.0
     - gatsby-transformer-pdf@3.8.0
     - gatsby-transformer-react-docgen@7.8.0
     - gatsby-transformer-remark@5.8.0
     - gatsby-transformer-screenshot@4.8.0
     - gatsby-transformer-sharp@4.8.0
     - gatsby-transformer-sqip@4.8.0
     - gatsby-transformer-toml@4.8.0
     - gatsby-transformer-xml@4.8.0
     - gatsby-transformer-yaml@4.8.0
     - gatsby-worker@1.8.0
     - gatsby@4.8.0
    tyhopp committed Feb 22, 2022
    Copy the full SHA
    f6734b9 View commit details
Showing 362 changed files with 8,589 additions and 21,804 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![A dark purple background with hints of stars. On top of that it says "GatsbyConf 2022" and "March 2-3". The letters "2022" are big, playful, light purple, and have illustrations of stars, people in orbs around them.](https://user-images.githubusercontent.com/3477155/153261605-43e1075b-7889-435b-bd34-a5980b629843.jpg)](https://gatsbyconf.com?utm_source=github&utm_medium=readme-banner&utm_campaign=gatsbyconf22-repo-banner)

---

<p align="center">
<a href="https://www.gatsbyjs.com">
<img alt="Gatsby" src="https://www.gatsbyjs.com/Gatsby-Monogram.svg" width="60" />
2 changes: 2 additions & 0 deletions benchmarks/memory/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output
.docker.memusage
16 changes: 15 additions & 1 deletion benchmarks/memory/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
FROM node:14-buster
ARG jemalloc
ENV NODE_ENV=production
ENV CI=1
ENV GATSBY_CPU_COUNT=4
RUN apt-get update -y && apt-get upgrade -y && apt-get install git curl npm -y
RUN npm i -g gatsby-cli gatsby-dev-cli
WORKDIR /usr/src/app

# set heap to 16gb just to catch all test cases
ENV NODE_OPTIONS="--max-old-space-size=16368"

RUN echo "\n\necho \"Welcome to the Gatsby Memory benchmark container!\\n - /usr/src/gatsby : Your local gatsby repo\\n - /usr/src/app : The memory benchmark gatsby site\\n\"" > /root/.bashrc

RUN if [ "$jemalloc" = "1" ]; then \
echo "Using jemalloc for memory allocation" && \
apt-get update && apt-get install -y libjemalloc-dev=5.1.0-3 && \
echo "/usr/lib/x86_64-linux-gnu/libjemalloc.so" >> /etc/ld.so.preload && \
echo "\n\necho \"This container is using jemelloc.\\n\"" >> /root/.bashrc; \
fi


WORKDIR /usr/src/app

# set up gatsby-dev
RUN gatsby-dev --set-path-to-repo /usr/src/gatsby

63 changes: 53 additions & 10 deletions benchmarks/memory/README.md
Original file line number Diff line number Diff line change
@@ -12,15 +12,62 @@ Within the container, two points to your local filesystem are mounted:
- /usr/src/gatsby : Your local gatsby repo
- /usr/src/site : The memory benchmark gatsby site

If you'd like to configure `jemalloc` to run within the container, set the `JEMALLOC=1` env var when building the docker container.

## Commands

### Tests

#### yarn test --memory X --num-nodes Y --node-size Z

Runs a test build within a docker container with the given memory allotment.
Within our gatsby-node, we'll create X nodes with a string property of size Y.

Example: running a build with 1000 nodes of 1mb each, in a docker container with 8gb of memory.

```
$ yarn test --memory 8g --num-nodes 500 --node-size 1m
```

#### yarn test-suite --name some-name --suite [incremental|exhaustive]

Runs through test suites defined in `scripts/test-suite.js` and outputs results to `output/some-name`.
Output includes a `results.csv` with a summary of all builds, as well as breakdowns for each memory configuration.

##### incremental

Incremental tests run builds with a `node-size` of 1m. For each memory allotment, it will start with 100
nodes in the build and increment by 100 on each success. The test will stop when all builds in a given
configuration fail.
See `incrementalConfig` in `scripts/test-suite.js` to customize test sets.

##### exhaustive

Exhaustive tests are just that, exhaustive. It will measure the time/success of every combination given.
See `exhaustiveConfig` in `scripts/test-suite.js` to customize test sets.

### Docker

These commands are used for interfacing with docker and have built-in utilities for managing the docker container.

#### yarn docker:build

Builds the container used for testing.
If you'd like to configure `jemalloc` to run within the container, set the `JEMALLOC=1` env var.

Example:

```
$ JEMALLOC=1 yarn docker:build
```

#### yarn docker:remove

Removes the docker image.

#### yarn docker:rebuild

Shorthand for remove + build.

#### yarn docker:start

@@ -38,6 +85,10 @@ A shorthand for start + connect.

Stop the container used for testing.

#### yarn docker:stats

Show a polling display of the container's docker stats.

### Gatsby

These commands are used for interfacing with gatsby.
@@ -81,17 +132,9 @@ When starting working with this benchmark:

- start `yarn watch` (possibly with `--scope`) in monorepo
- start `gatsby-dev` outside of docker in benchmark directory (just like with regular site)
- `yarn docker:connect` to get inside docker
- `npm rebuild` to rebuild binaries inside docker
- `yarn test --memory 8g --num-nodes 1000 --node-size 1m`

And repeat as many times as you want:

- make changes to `gatsby` source code as you normally would
- run `yarn gatsby:build` inside docker

## Testing

TODO

- How to configure memory limits
- Where to look
- run your `yarn test` command again
17 changes: 14 additions & 3 deletions benchmarks/memory/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
const { cpuCoreCount } = require(`gatsby-core-utils`)

const NUM_NODES = parseInt(process.env.NUM_NODES || 300, 10)
const NUM_KEYS_IN_LARGE_SIZE_OBJ = parseInt(process.env.BUILD_LARGE_OBJECT_COUNT || 1024, 10)
const NUM_NODES = parseInt(process.env.BUILD_NUM_NODES || 300, 10)
const LARGE_FIELD_SIZE_RAW = process.env.BUILD_STRING_NODE_SIZE || '1m'

// convert raw size to number
const regexpSize = /([0-9]+)([kmg])?/;
const match = LARGE_FIELD_SIZE_RAW.match(regexpSize);
const suffixSizes = ['k', 'm', 'g'];
let bytesMultiplier = 1;
if (match.length > 2 && suffixSizes.indexOf(match[2]) >= 0) {
bytesMultiplier = 2 ** ((suffixSizes.indexOf(match[2]) + 1) * 10)
}
const LARGE_FIELD_SIZE = parseInt(match[1], 10) * bytesMultiplier;

const NUM_KEYS_IN_LARGE_SIZE_OBJ = 1024

exports.sourceNodes = async ({ actions, reporter }) => {
const contentDigest = Date.now().toString() // make each sourcing mark everything as dirty
@@ -25,7 +36,7 @@ exports.sourceNodes = async ({ actions, reporter }) => {
number2: NUM_NODES - i,
number3: i % 20,
largeSizeObj,
largeSizeString: `x`.repeat(1024 * 1024),
largeSizeString: `x`.repeat(LARGE_FIELD_SIZE),
internal: {
contentDigest,
type: `Test`,
8 changes: 6 additions & 2 deletions benchmarks/memory/package.json
Original file line number Diff line number Diff line change
@@ -10,12 +10,16 @@
"gatsby:develop": "NODE_ENV=development yarn gatsby develop -H 0.0.0.0 -p 9000",
"gatsby:build:debug": "node --nolazy --inspect-brk=0.0.0.0:9229 node_modules/.bin/gatsby build",
"gatsby:develop:debug": "NODE_ENV=development node --nolazy --inspect-brk=0.0.0.0:9229 node_modules/.bin/gatsby develop -H 0.0.0.0 -p 9000",
"docker:build": "docker build -t gatsby-memory .",
"docker:build": "docker build -t gatsby-memory . --build-arg jemalloc=$JEMALLOC",
"docker:remove": "docker image rm -f gatsby-memory",
"docker:rebuild": "yarn docker:stop; yarn docker:remove && yarn docker:build",
"docker:start": "./scripts/docker-start",
"docker:connect": "./scripts/docker-connect",
"docker:start-and-connect": "./scripts/docker-start && sleep 1 && ./scripts/docker-connect",
"docker:stop": "./scripts/docker-stop",
"docker:stats": "./scripts/docker-stats"
"docker:stats": "./scripts/docker-stats",
"test": "node scripts/test.js",
"test-suite": "node scripts/test-suite.js"
},
"repository": {
"type": "git",
11 changes: 8 additions & 3 deletions benchmarks/memory/scripts/docker-start
Original file line number Diff line number Diff line change
@@ -5,16 +5,21 @@ if [ -n "$DOCKER_ID" ]; then
return 1
fi

MEMORY_LIMIT="${DOCKER_MEMORY_LIMIT:-2g}"

DOCKER_ID=$(\
docker run -td \
--mount type=bind,source="$(pwd)/../..",target=/usr/src/gatsby \
--mount type=bind,source="$(pwd)",target=/usr/src/app \
--publish 9229:9229 \
--publish 9000:9000 \
--memory="2g" \
--memory-swap="2g" \
--memory="${MEMORY_LIMIT}" \
--memory-swap="${MEMORY_LIMIT}" \
gatsby-memory \
| head -c 12 \
)

echo "\nStarted container id ${DOCKER_ID}! Run \`yarn docker:connect\` to connect to the container.\n"
sleep 1
docker exec $DOCKER_ID bash -c "/usr/src/app/scripts/docker-write-memory &"

echo "\nStarted container id ${DOCKER_ID} with ${MEMORY_LIMIT} of memory! Run \`yarn docker:connect\` to connect to the container.\n"
13 changes: 13 additions & 0 deletions benchmarks/memory/scripts/docker-write-memory
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
while true; do
PROCESS="node"

# find all node processes
PROCESS_USAGES=$(ps -eo rss,pid,euser,args:100 --sort %mem | grep -v grep | grep -i "${PROCESS}" | awk '{print $1}')

# sum the usage
SUM_USAGE=$(echo "$PROCESS_USAGES" | awk '{s+=$1} END {printf "%.0f\n", s}')

# write to file
echo -e "$SUM_USAGE" > /usr/src/app/.docker.memusage
sleep .25
done
Loading