Skip to content

Commit

Permalink
perf(gatsby-plugin-contentful): drop the super expensive fixids cycle (
Browse files Browse the repository at this point in the history
…#27318)

perf(gatsby-plugin-contentful): drop the super expensive fixids cycle

BREAKING CHANGE: 
If you were relying on the `contentful_id` on the `sys` object in your queries 
those are no longer exposed and you can safely change them to the `id` property on that `sys` object.


If you were relying on the `id` property in the `sys` object, you should be aware that it is no longer "normalized". In particular, it will no longer get a 'c' prefixed to the id.
  • Loading branch information
pvdz authored Oct 19, 2020
1 parent 2d6a153 commit b316505
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 540 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c31TNnjHlfaGUoMOwU0M2og`,
id: `31TNnjHlfaGUoMOwU0M2og`,
type: `Entry`,
createdAt: `2020-06-03T14:17:32.667Z`,
updatedAt: `2020-06-03T14:17:32.667Z`,
Expand All @@ -21,7 +21,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand All @@ -43,7 +42,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Asset`,
id: `c4shwYI3POEGkw0Eg6kcyaQ`,
id: `4shwYI3POEGkw0Eg6kcyaQ`,
contentful_id: `4shwYI3POEGkw0Eg6kcyaQ`,
},
},
Expand All @@ -59,7 +58,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Entry`,
id: `c15jwOBqpxqSAOy2eOO4S0m`,
id: `15jwOBqpxqSAOy2eOO4S0m`,
contentful_id: `15jwOBqpxqSAOy2eOO4S0m`,
},
},
Expand All @@ -78,7 +77,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c3K9b0esdy0q0yGqgW2g6Ke`,
id: `3K9b0esdy0q0yGqgW2g6Ke`,
type: `Entry`,
createdAt: `2020-06-03T14:17:32.289Z`,
updatedAt: `2020-06-03T14:17:32.289Z`,
Expand All @@ -87,7 +86,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand All @@ -109,7 +107,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Asset`,
id: `c6Od9v3wzLOysiMum0Wkmme`,
id: `6Od9v3wzLOysiMum0Wkmme`,
contentful_id: `6Od9v3wzLOysiMum0Wkmme`,
},
},
Expand All @@ -125,7 +123,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Entry`,
id: `c15jwOBqpxqSAOy2eOO4S0m`,
id: `15jwOBqpxqSAOy2eOO4S0m`,
contentful_id: `15jwOBqpxqSAOy2eOO4S0m`,
},
},
Expand All @@ -144,7 +142,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c2PtC9h1YqIA6kaUaIsWEQ0`,
id: `2PtC9h1YqIA6kaUaIsWEQ0`,
type: `Entry`,
createdAt: `2020-06-03T14:17:31.852Z`,
updatedAt: `2020-06-03T14:17:31.852Z`,
Expand All @@ -153,7 +151,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand All @@ -175,7 +172,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Asset`,
id: `c4NzwDSDlGECGIiokKomsyI`,
id: `4NzwDSDlGECGIiokKomsyI`,
contentful_id: `4NzwDSDlGECGIiokKomsyI`,
},
},
Expand All @@ -191,7 +188,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Entry`,
id: `c15jwOBqpxqSAOy2eOO4S0m`,
id: `15jwOBqpxqSAOy2eOO4S0m`,
contentful_id: `15jwOBqpxqSAOy2eOO4S0m`,
},
},
Expand All @@ -210,7 +207,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c15jwOBqpxqSAOy2eOO4S0m`,
id: `15jwOBqpxqSAOy2eOO4S0m`,
type: `Entry`,
createdAt: `2020-06-03T14:17:31.246Z`,
updatedAt: `2020-06-03T14:17:31.246Z`,
Expand All @@ -219,7 +216,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -250,7 +246,7 @@ exports.initialSync = () => {
sys: {
type: `Link`,
linkType: `Asset`,
id: `c7orLdboQQowIUs22KAW4U`,
id: `7orLdboQQowIUs22KAW4U`,
contentful_id: `7orLdboQQowIUs22KAW4U`,
},
},
Expand All @@ -269,7 +265,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c6Od9v3wzLOysiMum0Wkmme`,
id: `6Od9v3wzLOysiMum0Wkmme`,
type: `Asset`,
createdAt: `2020-06-03T14:17:27.525Z`,
updatedAt: `2020-06-03T14:17:27.525Z`,
Expand All @@ -278,7 +274,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -310,7 +305,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c4NzwDSDlGECGIiokKomsyI`,
id: `4NzwDSDlGECGIiokKomsyI`,
type: `Asset`,
createdAt: `2020-06-03T14:17:27.247Z`,
updatedAt: `2020-06-03T14:17:27.247Z`,
Expand All @@ -319,7 +314,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -351,7 +345,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c4shwYI3POEGkw0Eg6kcyaQ`,
id: `4shwYI3POEGkw0Eg6kcyaQ`,
type: `Asset`,
createdAt: `2020-06-03T14:17:26.971Z`,
updatedAt: `2020-06-03T14:17:26.971Z`,
Expand All @@ -360,7 +354,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -392,7 +385,7 @@ exports.initialSync = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c7orLdboQQowIUs22KAW4U`,
id: `7orLdboQQowIUs22KAW4U`,
type: `Asset`,
createdAt: `2020-06-03T14:17:26.685Z`,
updatedAt: `2020-06-03T14:17:26.685Z`,
Expand All @@ -401,7 +394,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -448,7 +440,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -570,7 +561,6 @@ exports.initialSync = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -721,7 +711,7 @@ exports.createBlogPost = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c1dHS3UzOqupJZY7AyeDc6s`,
id: `1dHS3UzOqupJZY7AyeDc6s`,
type: `Entry`,
createdAt: `2020-06-03T14:22:37.720Z`,
updatedAt: `2020-06-03T14:22:37.720Z`,
Expand All @@ -730,7 +720,6 @@ exports.createBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand All @@ -752,7 +741,7 @@ exports.createBlogPost = () => {
sys: {
type: `Link`,
linkType: `Asset`,
id: `c1aaRo2sQbdfWnG8iNvnkH3`,
id: `1aaRo2sQbdfWnG8iNvnkH3`,
contentful_id: `1aaRo2sQbdfWnG8iNvnkH3`,
},
},
Expand All @@ -768,7 +757,7 @@ exports.createBlogPost = () => {
sys: {
type: `Link`,
linkType: `Entry`,
id: `c15jwOBqpxqSAOy2eOO4S0m`,
id: `15jwOBqpxqSAOy2eOO4S0m`,
contentful_id: `15jwOBqpxqSAOy2eOO4S0m`,
},
},
Expand All @@ -788,7 +777,7 @@ exports.createBlogPost = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c1aaRo2sQbdfWnG8iNvnkH3`,
id: `1aaRo2sQbdfWnG8iNvnkH3`,
type: `Asset`,
createdAt: `2020-06-03T14:22:35.102Z`,
updatedAt: `2020-06-03T14:22:35.102Z`,
Expand All @@ -797,7 +786,6 @@ exports.createBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -841,7 +829,6 @@ exports.createBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -963,7 +950,6 @@ exports.createBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1114,7 +1100,7 @@ exports.updateBlogPost = () => {
contentful_id: `uzfinxahlog0`,
},
},
id: `c1dHS3UzOqupJZY7AyeDc6s`,
id: `1dHS3UzOqupJZY7AyeDc6s`,
type: `Entry`,
createdAt: `2020-06-03T14:22:37.720Z`,
updatedAt: `2020-06-03T14:27:24.359Z`,
Expand All @@ -1123,7 +1109,6 @@ exports.updateBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 2,
Expand All @@ -1145,7 +1130,7 @@ exports.updateBlogPost = () => {
sys: {
type: `Link`,
linkType: `Asset`,
id: `c1aaRo2sQbdfWnG8iNvnkH3`,
id: `1aaRo2sQbdfWnG8iNvnkH3`,
contentful_id: `1aaRo2sQbdfWnG8iNvnkH3`,
},
},
Expand All @@ -1161,7 +1146,7 @@ exports.updateBlogPost = () => {
sys: {
type: `Link`,
linkType: `Entry`,
id: `c15jwOBqpxqSAOy2eOO4S0m`,
id: `15jwOBqpxqSAOy2eOO4S0m`,
contentful_id: `15jwOBqpxqSAOy2eOO4S0m`,
},
},
Expand Down Expand Up @@ -1195,7 +1180,6 @@ exports.updateBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1317,7 +1301,6 @@ exports.updateBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1463,7 +1446,7 @@ exports.removeBlogPost = () => {
{
sys: {
type: `DeletedEntry`,
id: `c1dHS3UzOqupJZY7AyeDc6s`,
id: `1dHS3UzOqupJZY7AyeDc6s`,
space: {
sys: {
type: `Link`,
Expand All @@ -1477,7 +1460,6 @@ exports.removeBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 2,
Expand Down Expand Up @@ -1511,7 +1493,6 @@ exports.removeBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1633,7 +1614,6 @@ exports.removeBlogPost = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1780,7 +1760,7 @@ exports.removeAsset = () => {
{
sys: {
type: `DeletedAsset`,
id: `c1aaRo2sQbdfWnG8iNvnkH3`,
id: `1aaRo2sQbdfWnG8iNvnkH3`,
space: {
sys: {
type: `Link`,
Expand All @@ -1794,7 +1774,6 @@ exports.removeAsset = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1827,7 +1806,6 @@ exports.removeAsset = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down Expand Up @@ -1949,7 +1927,6 @@ exports.removeAsset = () => {
id: `master`,
type: `Link`,
linkType: `Environment`,
contentful_id: `master`,
},
},
revision: 1,
Expand Down
Loading

0 comments on commit b316505

Please sign in to comment.