-
Notifications
You must be signed in to change notification settings - Fork 10.3k
feat(gatsby): use V8.serialize instead of JSON.stringify if available #10732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+308
−84
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
74bcb3e
Add serialization with v8
stefanprobst af7bdb1
Change filename
stefanprobst 04938eb
Add back json fallback
stefanprobst 7c60f6c
Don't use non-serializeable function in pluginOptions
stefanprobst 5b93218
Merge remote-tracking branch 'origin/master' into v8-serialize
pieh 2cc2036
revert plugin changes
pieh b87c8df
remove pluginOptions from `sitePlugin` node - this cause trouble with…
pieh 62a991c
keep `redux-state.json` path for json-stringify
pieh c7f145e
Merge remote-tracking branch 'origin/master' into v8-serialize
pieh 82099df
sanitize node data
pieh db6740f
Revert "remove pluginOptions from `sitePlugin` node - this cause trou…
pieh 6d3acc5
sanitize nodes
pieh a4eea40
Merge remote-tracking branch 'origin/master' into v8-serialize
pieh 35c84e9
split redux persistance into separate file and adjust tests
pieh fba9b53
some more persisting tests confidence
pieh 45f654c
don't track itself
pieh 1c20610
will this work on windows?
pieh 0d9bf43
oh loki
pieh bb739bd
handle case when nodes state is null (loki) and v8.serialize is not a…
pieh 12a58c4
Merge remote-tracking branch 'origin/master' into v8-serialize
pieh 1905f2e
refactor into omitUndefined
wardpeet 843497e
refactor into isTypeSupported
wardpeet 95dc28f
don't strip `null` from nodes
pieh 0641283
readCache can be pure, thanks @wardpeet
pieh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/gatsby/src/db/__tests__/__snapshots__/node-tracking-test.js.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`track root nodes Node sanitization Remove not supported fields / values 1`] = ` | ||
| Object { | ||
| "children": Array [], | ||
| "id": "id1", | ||
| "inlineArray": Array [ | ||
| 1, | ||
| 2, | ||
| 3, | ||
| ], | ||
| "inlineObject": Object { | ||
| "field": "fieldOfFirstNode", | ||
| }, | ||
| "internal": Object { | ||
| "contentDigest": "digest1", | ||
| "owner": "test", | ||
| "type": "Test", | ||
| }, | ||
| "parent": null, | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/gatsby/src/redux/__tests__/__snapshots__/index.js.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`redux db should write cache to disk 1`] = ` | ||
| Object { | ||
| "componentDataDependencies": Object { | ||
| "connections": Object {}, | ||
| "nodes": Object {}, | ||
| }, | ||
| "components": Map { | ||
| "/Users/username/dev/site/src/templates/my-sweet-new-page.js" => Object { | ||
| "componentPath": "/Users/username/dev/site/src/templates/my-sweet-new-page.js", | ||
| "isInBootstrap": true, | ||
| "pages": Array [ | ||
| "/my-sweet-new-page/", | ||
| ], | ||
| "query": "", | ||
| }, | ||
| }, | ||
| "jsonDataPaths": Object {}, | ||
| "staticQueryComponents": Map {}, | ||
| "status": Object { | ||
| "plugins": Object {}, | ||
| }, | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.