Skip to content

Conversation

@faraazb
Copy link
Contributor

@faraazb faraazb commented Jan 12, 2024

As of 5.1.2, for live preview, we determine all possible reference paths and JSON RTE paths at runtime by fetching content types and recursively iterating over them. For very complex content types, this process results in a lot of reference paths caching which becomes impossible.

This change adds a new custom field cslp__meta to each content type node, which resolves with the value of reference paths and JSON RTE paths. This leads to a significant improvement in speed, as no expensive runtime calculation has to be done.

To resolve cslp__meta, we iterate over the content types and the Gatsby query (using the info argument of the resolver - info.operation) and collect the reference and RTE paths.

@faraazb faraazb requested a review from a team as a code owner January 12, 2024 10:52
@faraazb faraazb requested a review from Deepak-Kharah January 12, 2024 10:53
Deepak-Kharah
Deepak-Kharah previously approved these changes Jan 12, 2024
Copy link
Contributor

@Deepak-Kharah Deepak-Kharah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Deepak-Kharah
Deepak-Kharah previously approved these changes Jan 12, 2024
Copy link
Contributor

@Deepak-Kharah Deepak-Kharah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good!

Copy link
Contributor

@Deepak-Kharah Deepak-Kharah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@faraazb faraazb changed the base branch from master to staging January 16, 2024 12:44
@faraazb faraazb merged commit d68a18a into staging Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants