-
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
perf(gatsby): add a way to skip tracking inline objects #38805
perf(gatsby): add a way to skip tracking inline objects #38805
Conversation
packages/gatsby/index.d.ts
Outdated
@@ -34,6 +34,8 @@ export { | |||
|
|||
export * from "gatsby-script" | |||
|
|||
export { IGatsbyResolverContext } from "./src/schema/type-definitions" |
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.
I would guess we can skip this and I overlooked an already exported type for https://github.com/gatsbyjs/gatsby/pull/38805/files#diff-2a342b3e927ced0bfb4d19fe7f56ef73e0f08094f83526aaccc252d29af11870R44
🤔
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 don't really have good types for schema customization - most of it is ... any
🙈 so this is fine
Minor NIT is we probably shouldn't use EDIT: this can stay as-is for now, while I gather feedback from other folks (just to avoid busy work with unnecessary renames in case we would have to drop this idea alltogether) - so this can wait before being addressed (and just in case I can do that as well later on) |
id: CODES.GatsbyPluginMissing, | ||
context: { | ||
// TODO update message to reflect the actual version with track-inline-object-opt-out support | ||
sourceMessage: `Used gatsby version is too old and doesn't support required features. Please update to gatsby@>=5.X.0`, |
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 will need to be updated before the release once it's clear that Gatsby Version that will contain the addition.
For now it will mean that users will have to use gatsby@ctf-next
(once new wave of canary is released that include this change) - so maybe temporarily we can use that version there whatever that will end up being?
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.
Thanks for the new toggle!
1ce2026
into
feat/contentful-schema-generation
Description
While upgrading gatsby-source-contentful to its new version, we figured out that Gatsby is parsing JSON and Rich Text fields for references, while the plugin does handle these on its own.
In discussion with @pieh, we decided to implement a flag into Gatsby, which prevents nodes from being parsed for trackable inline objects. This is a huge performance improvement for the new gatsby-source-contentful version, while potentially providing a performance improvement to all other plugins that implement external data and/or handle references on their own.
Documentation
Nodes will get an additional, optional internal boolean property:
node.internal.dontTrackInlineObjects
.By default, none of Gatsbys behavior will change. Plugin developers and users implementing their own node types have to opt into this features manually.
Tests
@todo this PR still lacks tests
Related Issues
#30855