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

Add Contentful objects #37

Merged
merged 2 commits into from
Jun 7, 2020
Merged

Add Contentful objects #37

merged 2 commits into from
Jun 7, 2020

Conversation

replygirl
Copy link
Contributor

@replygirl replygirl commented Jun 4, 2020

Demo page

  • Add a generic ContentfulObject class abstracting away Contentful boilerplate
  • Add generated declarations for Contentful data: yarn contentful-typescript-codegen
  • Add importable ContentfulObject instances for each class in our data model

Closes #9

Issues resulting from this PR:

@vercel
Copy link

vercel bot commented Jun 4, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/blacksocialists/world-of-jackson/a808580js
✅ Preview: https://world-of-jackson-git-feature-contentful-utils.blacksocialists.now.sh

@odbol
Copy link
Contributor

odbol commented Jun 5, 2020

This is great, thanks Imogen!

One thing I noticed with the Demo page is that the JSON seems to have a lot of duplicate objects (e.g. every child object also contains the full JSON for the parent object containing it.) Is there a way we can reduce that duplication to save on bandwidth and RAM?

Maybe one way is to only include an id pointing to the parent object instead of the entire parent object?

@odbol
Copy link
Contributor

odbol commented Jun 7, 2020

I realize now that the JSON is only representing the in memory objects, which I assume have references to the parent objects instead of duplicate objects. That seems fine to me if that's the case; please ignore my earlier comment.

@replygirl
Copy link
Contributor Author

@GrigoryGraborenko GrigoryGraborenko merged commit c25769a into dev Jun 7, 2020
@GrigoryGraborenko GrigoryGraborenko deleted the feature/contentful-utils branch June 7, 2020 22:10
Copy link
Collaborator

@sorcerix sorcerix left a comment

Choose a reason for hiding this comment

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

retroactively approved XD

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