Skip to content

Commit

Permalink
Merge branch 'master' into v3/upgrade-react
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet authored Feb 24, 2021
2 parents 35275c7 + 98afb2f commit 7202f85
Show file tree
Hide file tree
Showing 394 changed files with 16,570 additions and 3,642 deletions.
30 changes: 9 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ jobs:
- <<: *install_node_modules
- <<: *persist_cache
- run: yarn bootstrap -- concurrency=2
- run: git status yarn.lock -s | grep "M yarn.lock" && echo "yarn.lock is dirty. Please ensure changes have been committed" && exit 1
# Persist the workspace again with all packages already built
- persist_to_workspace:
root: ./
Expand Down Expand Up @@ -221,6 +222,12 @@ jobs:
image: "14"
<<: *test_template

integration_tests_gatsby_source_wordpress:
executor: node
steps:
- e2e-test:
test_path: integration-tests/gatsby-source-wordpress

integration_tests_long_term_caching:
executor: node
steps:
Expand Down Expand Up @@ -258,15 +265,6 @@ jobs:
- e2e-test:
test_path: integration-tests/artifacts

# temporary
integration_tests_artifacts_conditional_page_builds:
executor: node
steps:
- e2e-test:
test_path: integration-tests/artifacts
environment:
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: 1

integration_tests_ssr:
executor: node
steps:
Expand Down Expand Up @@ -334,14 +332,6 @@ jobs:
e2e_tests_development_runtime:
<<: *e2e_tests_development_runtime_alias

e2e_tests_development_runtime_fast_refresh:
<<: *e2e_tests_development_runtime_alias
environment:
GATSBY_HOT_LOADER: fast-refresh
CYPRESS_HOT_LOADER: fast-refresh
CYPRESS_PROJECT_ID: 917bea
CYPRESS_RECORD_KEY: 4750fb36-4576-4638-a617-d243a381acef

e2e_tests_development_runtime_with_experimental_react:
<<: *e2e_tests_development_runtime_alias

Expand Down Expand Up @@ -596,6 +586,8 @@ workflows:
- lint
- typecheck
- bootstrap
- integration_tests_gatsby_source_wordpress:
<<: *e2e-test-workflow
- integration_tests_long_term_caching:
<<: *e2e-test-workflow
- integration_tests_cache_resilience:
Expand All @@ -606,8 +598,6 @@ workflows:
<<: *e2e-test-workflow
- integration_tests_artifacts:
<<: *e2e-test-workflow
- integration_tests_artifacts_conditional_page_builds:
<<: *e2e-test-workflow
- integration_tests_ssr:
<<: *e2e-test-workflow
- integration_tests_images:
Expand All @@ -627,8 +617,6 @@ workflows:
<<: *e2e-test-workflow
- e2e_tests_development_runtime:
<<: *e2e-test-workflow
- e2e_tests_development_runtime_fast_refresh:
<<: *e2e-test-workflow
- e2e_tests_production_runtime:
<<: *e2e-test-workflow
- themes_e2e_tests_production_runtime:
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ packages/gatsby-image/withIEPolyfill/index.js
packages/gatsby/cache-dir/commonjs/**/*
packages/gatsby-admin/public
packages/gatsby/gatsby-admin-public
packages/gatsby-codemods/transforms

packages/gatsby-source-wordpress/test-site/**
!packages/gatsby-source-wordpress/test-site/__tests__
Expand Down
59 changes: 43 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ module.exports = {
before: true,
after: true,
spyOn: true,
// These should be in scope but for some reason eslint can't see them
NodeJS: true,
JSX: true,
NodeRequire: true,
TimerHandler: true,
__PATH_PREFIX__: true,
__BASE_PATH__: true,
__ASSET_PREFIX__: true,
Expand All @@ -49,6 +54,8 @@ module.exports = {
"warn",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"consistent-return": ["error"],
Expand Down Expand Up @@ -93,7 +100,9 @@ module.exports = {
...TSEslint.configs.recommended.rules,
// We should absolutely avoid using ts-ignore, but it's not always possible.
// particular when a dependencies types are incorrect.
"@typescript-eslint/ban-ts-ignore": "warn",
"@typescript-eslint/ban-ts-comment": {
"ts-ignore": "allow-with-description",
},
// This rule is great. It helps us not throw on types for areas that are
// easily inferrable. However we have a desire to have all function inputs
// and outputs declaratively typed. So this let's us ignore the parameters
Expand All @@ -102,16 +111,40 @@ module.exports = {
"error",
{ ignoreParameters: true },
],
"@typescript-eslint/camelcase": [
"@typescript-eslint/ban-types": [
"error",
{
// This rule tries to ensure we use camelCase for all variables, properties
// functions, etc. However, it is not always possible to ensure properties
// are camelCase. Specifically we have `node.__gatsby_resolve` which breaks
// this rule. This allows properties to be whatever they need to be.
properties: "never",
// Allow unstable api's to use `unstable_`, which is easier to grep
allow: ["^unstable_"],
extendDefaults: true,
types: {
"{}": {
fixWith: "Record<string, unknown>",
},
object: {
fixWith: "Record<string, unknown>",
},
},
},
],
"@typescript-eslint/naming-convention": [
{
selector: "default",
format: ["camelCase"],
},
{ selector: "variable", format: ["camelCase", "UPPER_CASE"] },
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
prefix: ["unstable_", ""],
},
{
selector: "typeLike",
format: ["PascalCase"],
},
{
selector: "interface",
format: ["PascalCase"],
prefix: ["I"],
},
],
// This rule tries to prevent using `require()`. However in node code,
Expand All @@ -127,6 +160,7 @@ module.exports = {
// - baz: string;
// + baz: string
// }
"@typescript-eslint/no-extra-semi": false,
"@typescript-eslint/member-delimiter-style": [
"error",
{
Expand All @@ -135,13 +169,6 @@ module.exports = {
},
},
],
// This ensures all interfaces are named with an I as a prefix
// e.g.,
// interface IFoo {}
"@typescript-eslint/interface-name-prefix": [
"error",
{ prefixWithI: "always" },
],
"@typescript-eslint/no-empty-function": "off",
// This ensures that we always type the return type of functions
// a high level focus of our TS setup is typing fn inputs and outputs.
Expand Down
3 changes: 1 addition & 2 deletions docs/contributing/docs-writing-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Here are some tips for gathering information on a given topic within Gatsby:

3. You can also search the web for additional examples outside of the Gatsby GitHub org or docs site. Be sure to check Gatsby versions and only reference the most current examples unless for a specific purpose.

4. In the event there is no information available to write a greenfield doc after trying all the above steps, such as for a new integration, try interviewing Gatsby core team members to help to produce an outline and content tips. See [Pair Programming program](/contributing/pair-programming/).
4. In the event there is no information available to write a greenfield doc after trying all the above steps, such as for a new integration, try asking Gatsby core team members to help to produce an outline and content tips. Please open a [documentation issue](https://github.com/gatsbyjs/gatsby/issues/new/choose) for this then.

5. **For Gatsby inkteam members:** You can also search in the Gatsby Slack internally for related information. It’s possible other team members have discussed the issue, or even compiled trouble points into a doc. Look and ask around as part of your discovery work.

Expand Down Expand Up @@ -90,7 +90,6 @@ Apply feedback from pull request reviews in order for them to be accepted. Furth
- [How to File an Issue](/contributing/how-to-file-an-issue/)
- [Gatsby Style Guide](/contributing/gatsby-style-guide/)
- [Markdown Syntax Doc](/docs/how-to/routing/mdx/markdown-syntax/)
- [Pair Programming](/contributing/pair-programming/) for interviewing the core team only
- [Blog Post Guidelines](/contributing/blog-contributions/)
- [Docs site setup instructions](/contributing/docs-contributions/#docs-site-setup-instructions)
- [How to Open a Pull Request](/contributing/how-to-open-a-pull-request/)
1 change: 0 additions & 1 deletion docs/contributing/gatsby-governance-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Here are some relevant docs and resources for contributors:
- [How to file an issue](/contributing/how-to-file-an-issue/)
- [Request-for-comment (RFC) process](/contributing/rfc-process/)
- [Community Maintainers Meeting](/contributing/community/#community-maintainers-meeting)
- [Pair programming sessions](/contributing/pair-programming/)

## Engage with the Gatsby team

Expand Down
4 changes: 0 additions & 4 deletions docs/contributing/how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ We want contributing to Gatsby to be fun, enjoyable, and educational for anyone

If you are worried or don't know where to start, check out our [where to participate](/contributing/where-to-participate/) page. You can reach out with questions to [@AskGatsbyJS](https://twitter.com/askgatsbyjs) on Twitter, and anyone from the Gatsby team on [Discord](https://gatsby.dev/discord). You can also [submit an issue](/contributing/how-to-file-an-issue/) and a maintainer can give you guidance!

## Pair programming

Gatsby.js offers free [pair programming sessions](/contributing/pair-programming/) to the community, if there's something you'd like to work on together. Get in touch with us if you have a question about contributing or an idea for something to pair on!

<GuideList slug={props.slug} />
5 changes: 0 additions & 5 deletions docs/contributing/how-to-write-a-stub.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ pull request gets accepted.

If you have any questions about titles or other details related to creating stubs, feel free to ask us on a relevant GitHub issue.

## Community Pair Programming Sessions

If you create a stub or see an existing one on the Gatsby.js site and feel interested in filling out the content, check out the Gatsby.js
[Pair Programming program](/contributing/pair-programming/). We would love to work with you in your open source contributing journey!

## Converting a Stub to a Doc

To change a stub into a living-breathing document, remove the `issue` entry from a stub's frontmatter (a fancy name for Markdown metadata) and replace the boilerplate content with
Expand Down
37 changes: 0 additions & 37 deletions docs/contributing/pair-programming.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/contributing/why-contribute-to-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ There are many reasons to contribute to Gatsby.js and open source software in ge

- **Growing your community.** Working with Gatsby.js in open source can connect you with people working on similar things. You can get help or give help, and you might even make an IRL acquaintance! It has happened.

- **Improving your skills.** When you work on a Gatsby issue or pull request, inevitably you'll learn more about how something works in the project; either by asking questions and gathering info or by digging deeper into the code yourself. Gatsby.js also offers free [pair programming sessions](/contributing/pair-programming/) to the community, if there's something you'd like to work on together. There's a skill-building benefit to contributing to OSS!
- **Improving your skills.** When you work on a Gatsby issue or pull request, inevitably you'll learn more about how something works in the project; either by asking questions and gathering info or by digging deeper into the code yourself. There's a skill-building benefit to contributing to OSS!

- **Getting free swag!** By participating in the repo on GitHub, you can become eligible for free swag that the Gatsby team offers as a way to say thank you. With 5 contributions, you can advance to a second level with even more swag options! Learn more about this [sweet swag deal](/contributing/contributor-swag/).

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The only exception to this is the file `/sw.js`, which needs to be revalidated u

## Setting up caching on different hosts

How you setup your caching depends on how you host your site. We encourage people to create Gatsby plugins per host to automate the creation of caching headers.
How you set up your caching depends on how you host your site. We encourage people to create Gatsby plugins per host to automate the creation of caching headers.

The following plugins have been created:

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/conceptual/choosing-a-cms.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In terms of popularity, you can see [top integrations listed by monthly download

- **five general-purpose headless CMSs:** Contentful, DatoCMS, Prismic, Sanity and Strapi

- **two general-purpose full-stack CMSs** running in "headless" mode: Drupal and Wordpress
- **two general-purpose full-stack CMSs** running in "headless" mode: Drupal and WordPress

- **one specialized CMS**: Shopify

Expand All @@ -28,7 +28,7 @@ In terms of popularity, you can see [top integrations listed by monthly download

- If you're working on a personal project or prototype, a few of these have a generous free tier (Contentful, DatoCMS, Prismic, Sanity, Strapi).

- If you're looking more at "Team", "Pro", or "Business" price points (eg $29, $99, or \$299 per month), the above CMSs are all good options, plus Drupal and Wordpress.
- If you're looking more at "Team", "Pro", or "Business" price points (eg $29, $99, or \$299 per month), the above CMSs are all good options, plus Drupal and WordPress.

- If you're looking more at an "enterprise" project in the four digits per month and up, your main options are Contentful, Contentstack, Sanity, and Strapi.

Expand All @@ -45,7 +45,7 @@ Users choosing other CMSs typically have a specific reason for their choice. Som
- **Drupal** if open-source, configurability, or custom code are important.
- **Prismic** if they like the content editing UI
- **Sanity** or **Strapi** for the developer-friendliness or if they need something on-premise. In addition, Sanity tends to have significantly better build times, which can be a key usability consideration, especially for larger sites (we [benchmark build times by CMS here](https://willit.build/)).
- **Wordpress** when the client or content team is already familiar with the Wordpress UI
- **WordPress** when the client or content team is already familiar with the WordPress UI

## Using multiple CMS systems together

Expand All @@ -65,13 +65,13 @@ Typically, teams that use multiple CMSs use a specialized CMS for part of the we

### Considerations when using multiple CMSs

One of the key considerations when using content in multiple systems is that - at some point - one content system often needs to "know about" another system. For example, a landing page with content in Contentful may need to embed information about a specific product SKU from Shopify or blog post in Wordpress.
One of the key considerations when using content in multiple systems is that - at some point - one content system often needs to "know about" another system. For example, a landing page with content in Contentful may need to embed information about a specific product SKU from Shopify or blog post in WordPress.

The easiest way to create relationship references across CMSs is through one CMS storing unique IDs of content living in another CMS.

In this case, you'd store an array of Wordpress blog post IDs as a field of the relevant model in Contentful, then pull in the correct data via the appropriate queries in `gatsby-node.js.`
In this case, you'd store an array of WordPress blog post IDs as a field of the relevant model in Contentful, then pull in the correct data via the appropriate queries in `gatsby-node.js.`

To make that a bit more concrete, here's a screenshot of what this looks like currently (January 2020) in the Gatsbyjs.com Contentful setup for the [e-commerce use case page](https://www.gatsbyjs.com/use-cases/e-commerce); the model is called `Use Case Landing Page`, the field is called `Blog Posts`, and the items in the array are unique blog post IDs from Wordpress:
To make that a bit more concrete, here's a screenshot of what this looks like currently (January 2020) in the Gatsbyjs.com Contentful setup for the [e-commerce use case page](https://www.gatsbyjs.com/use-cases/e-commerce); the model is called `Use Case Landing Page`, the field is called `Blog Posts`, and the items in the array are unique blog post IDs from WordPress:

![Screenshot of Gatsbyjs.com Contentful setup](../images/use-case-landing-page-screenshot.jpg)

Expand Down
1 change: 0 additions & 1 deletion docs/docs/conceptual/gatsby-core-philosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ Some things we do in order to create an inclusive, welcoming community include:
- Friendlier robots
- Implicit trust
- Active gratitude
- [Active mentorship](/contributing/pair-programming/)

We’ve built an active community with thousands of contributors, and we want to live the example of what a great open source community can be.

Expand Down
Loading

0 comments on commit 7202f85

Please sign in to comment.