Skip to content

Commit

Permalink
Drop stuff that flew under the radar
Browse files Browse the repository at this point in the history
This time I did a `grep -r --exclude-dir=node_modules --exclude-dir=.git loki`
  • Loading branch information
pvdz committed May 8, 2020
1 parent 71a932c commit 164e25b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
19 changes: 0 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ aliases:
- <<: *attach_to_bootstrap
- run: yarn list react
- run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
# - run: GATSBY_DB_NODES=loki node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci

e2e-test-workflow: &e2e-test-workflow
filters:
Expand Down Expand Up @@ -153,9 +152,6 @@ commands:
test_command:
type: string
default: "yarn test"
run_loki:
type: boolean
default: false
steps:
- checkout
# In case of failure, add these steps again. Cache probably got deleted
Expand All @@ -172,14 +168,6 @@ commands:
name: Run tests (using defaults)
command: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"

- when:
condition: << parameters.run_loki >>
steps:
- run:
command: GATSBY_DB_NODES=loki << parameters.test_command >>
name: Run tests (using Loki)
working_directory: << parameters.test_path >>

version: 2.1

jobs:
Expand Down Expand Up @@ -249,13 +237,6 @@ jobs:
- e2e-test:
test_path: integration-tests/long-term-caching

# integration_tests_cache_resilience:
# executor: node
# steps:
# - e2e-test:
# test_path: integration-tests/cache-resilience
# run_loki: true

integration_tests_gatsby_pipeline:
executor: node
steps:
Expand Down
17 changes: 0 additions & 17 deletions docs/docs/scaling-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ It's difficult to pin down exactly _how_ to fix a scaling issue. We have some re

Note: the application of these techniques should be considered analogous to applying a bandage. A bandage solves the underlying issue, but at some indeterminate point in the future the underlying issue may be healed! In much the same way--treat these techniques as temporary and re-visit in the future if underlying scaling issues in Gatsby have since been resolved.

### `GATSBY_DB_NODES`

In preparation for future versions of Gatsby, we've enabled **experimental** support for a different mechanism for the persistence of nodes: [Loki](https://www.npmjs.com/package/lokijs). It's challenging to assess whether this could lead to unforeseen issues without breaking changes, so we've exposed it behind a flag while we continue to assess the impact to Gatsby applications.

Loki allows us to opt-in to possibly more performant internal operations and it _may_ resolve your scaling issues. If it does--please let us know! To opt-in to this experimental feature:

```json
{
"devDependencies": {
"cross-env": "^5.2.0"
},
"scripts": {
"build": "cross-env GATSBY_DB_NODES=loki gatsby build"
}
}
```

### Switch off type inference for `SitePage.context`

When using the `createPages` API to pass large amounts of data to pages via `context` (which is generally not recommended), Gatsby's type inference can become slow. In most cases, it is not actually necessary to include the `SitePage.context` field in the GraphQL schema, so switching off type inference for the `SitePage` type should be safe:
Expand Down
3 changes: 1 addition & 2 deletions packages/gatsby/src/redux/run-sift.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,7 @@ const filterWithSift = (filters, firstOnly, nodeTypeNames, resolvedFields) => {
* @param {boolean} firstOnly
* @param {Array<string>} nodeTypeNames
* @param resolvedFields
* @param {function(id: string): IGatsbyNode | undefined} getNode Note: this is
* different for loki
* @param {function(id: string): IGatsbyNode | undefined} getNode
* @returns {Array<IGatsbyNode> | undefined | null} Collection of results.
* Collection will be limited to 1 if `firstOnly` is true
*/
Expand Down

0 comments on commit 164e25b

Please sign in to comment.