Skip to content
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 the page data factory pipeline #631

Merged
merged 25 commits into from
Oct 30, 2022

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Oct 30, 2022

Since the factories, by design, work on a limited known set of verbose data, we have to pass a lot of parameters around. This PR experiments with adding a type of DTO called the CoreDataObject which is not a great name, but once I or someone else comes up with a better one it's easy to refactor.

Anyhow, this immutable DTO contains only data known at the earliest point in construction solving the problem of factories needing to depend on data that might not be generated yet which is the reason for having the scoped private data as it is now.

In summary, this PR doesn't change the fundamental design of the page factory data pipeline, it just aims to reduce boilerplate by having a single well defined data object that can be passed around to subfactories more easily.

@caendesilva
Copy link
Member Author

FeaturedImageFactory doesn't need to use the CDO as it only needs to know about the front matter.

@caendesilva caendesilva marked this pull request as ready for review October 30, 2022 21:29
@caendesilva caendesilva merged commit 7852f48 into upcoming Oct 30, 2022
@caendesilva caendesilva deleted the refactor-to-use-factories branch October 30, 2022 21:31
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.

2 participants