-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
refactor(contentful): migrate to schema customization API #32351
refactor(contentful): migrate to schema customization API #32351
Conversation
…g dominat color or tracing svg
@@ -1,30 +1,19 @@ | |||
const path = require(`path`) | |||
const isOnline = require(`is-online`) | |||
// @todo import syntax! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder to myself: time to finally get all files to es-module syntax
@@ -1,30 +1,19 @@ | |||
const path = require(`path`) | |||
const isOnline = require(`is-online`) | |||
// @todo import syntax! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder to myself: time to finally get all files to es-module syntax
|
||
// If the cache has data, use it. Otherwise do a remote fetch anyways and prime the cache now. | ||
// If present, do NOT contact contentful, skip the round trips entirely | ||
if (forceCache) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This experimental flag adds some complexity to this code we could avoid.
I can't find any documentation to it as well
} | ||
}) | ||
|
||
// @todo based on the sys metadata we should be able to differentiate new and updated entities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be low effort, also pretty low impact on the whole build time
} | ||
}) | ||
|
||
// @todo based on the sys metadata we should be able to differentiate new and updated entities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be low effort, also pretty low impact on the whole build time
// Remove deleted entries & assets | ||
reporter.verbose(`Removing deleted Contentful entries & assets`) | ||
|
||
// @todo this should happen when sourcing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO any interaction with actual nodes should happen in source-nodes. WDYT?
} | ||
}) | ||
|
||
const creationActivity = reporter.activityTimer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@todo consider including all the map creation and loops in the creation activity.
|
||
// A contentType can hold lots of entries which create nodes | ||
// We wait until all nodes are created and processed until we handle the next one | ||
// TODO add batching in gatsby-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wardpeet do we have any kind of new API that could help here? That comment is for sure very old
|
||
creationActivity.end() | ||
|
||
// @todo add own activity! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@todo do it
e01c0f0
to
e955764
Compare
2ae4698
to
3f686a0
Compare
f441cb3
to
8bda979
Compare
The plugin filled up
sourceNodes
with a bunch of things. This PR cleans this up, moves large chunks of the code in separate files and their correct GatsbyJS API hooks.Current status:
gatsby-node.js
still need to be refactored. This might be a great time to restructure these huge fixture json files?