-
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
Contentful next cleanup #26238
Contentful next cleanup #26238
Conversation
const normalize = require(`./normalize`) | ||
const fetchData = require(`./fetch`) | ||
const { createPluginConfig, validateOptions } = require(`./plugin-options`) | ||
const { downloadContentfulAssets } = require(`./download-contentful-assets`) | ||
const { createClient } = require(`contentful`) | ||
|
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.
Keep it but I'm curious whether there's a particular reason for moving the import up. It implies it's relevant for side effects and I'm hoping it's not :)
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.
We need it for resolving, so we need it always. Dependencies I need in all cases I do require on top. Would you require "on runtime" down there in line 200 when the client is created? 🤔
* improve comment about contentful-resolve-response usage * test(unit): remove cross test data pollution * further improve loggin by replacing console.time with GatsbyReporter * improve code style * missing file * remove logging verbosity * adjust mocked reporter for tests to pass * remove unused deep-map dependency
* improve comment about contentful-resolve-response usage * test(unit): remove cross test data pollution * further improve loggin by replacing console.time with GatsbyReporter * improve code style * missing file * remove logging verbosity * adjust mocked reporter for tests to pass * remove unused deep-map dependency
…e performance (#27244) * fix(gatsby-source-contentful): fixed id collision in contentful entries (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries * fix(gatsby-source-contentful): properly resolve subsequent sync calls (#15084) * fix(gatsby-source-contentful): fixed id collision in contentful entries (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries * improve logging and clean up code (#26238) * improve comment about contentful-resolve-response usage * test(unit): remove cross test data pollution * further improve loggin by replacing console.time with GatsbyReporter * improve code style * missing file * remove logging verbosity * adjust mocked reporter for tests to pass * remove unused deep-map dependency * fix: use content type id by default to create reference gql types (#26102) * temporary console.time calls for performance measurements * perf(gatsby-source-contentful): use a map and less loops to merge old and latest sync API response * log time Contentful API processing and GraphQL node creation * upgrade dependencies and use faster node 10 versions * remove duplicate logging * allow multiple Contentful sources fixes #26875 * refactor(imports): fix dependency structure and make sharp optional fixes #23904 * align tests to match new multi source cache pattern Co-authored-by: Matthew Miller <mnmiller1@me.com> Co-authored-by: Khaled Garbaya <khaled@contentful.com>
Implements feedback from @pvdz in #26102
Most notably the removal of
console.time()
improves the logging further: