contentful-labs / starter-gatsby-blog

Gatsby starter for a Contentful project from the community.
https://contentful.github.io/starter-gatsby-blog/
MIT License
195 stars 199 forks source link

Protect against undefined content in Preview #146

Open ax-vasquez opened 3 years ago

ax-vasquez commented 3 years ago

In Gatsby Cloud's Preview, all content changes are picked up by the extension. This means that newly-created posts will be sent to Gatsby before the user has had a chance to add all required fields. Repositories for sites meant to be in use with Gatsby Preview should protect all references to required fields so that the site can handle missing elements gracefully.

Changelog

axe312ger commented 3 years ago

I'd like to have the userland version and this one aligned, at least on dependency/codestyle level.

Feel free to contact me in #gatsby-contentful in your Slack :)

(Talking about https://github.com/contentful-userland/gatsby-contentful-starter/pull/90 which happened in parallel)

ax-vasquez commented 3 years ago

I'd like to have the userland version and this one aligned, at least on dependency/codestyle level.

Feel free to contact me in #gatsby-contentful in your Slack :)

(Talking about contentful-userland/gatsby-contentful-starter#90 which happened in parallel)

@axe312ger I believe I addressed all of your feedback with the exception of the environment variable question (though, I did revert the change - I'm simply trying to make sure our understanding is in alignment with how you intend for us to use them :+1: )

With that said, I've since implemented:

ax-vasquez commented 3 years ago

@axe312ger , could I get another review on this? :slightly_smiling_face:

I believe I addressed all of the feedback, but will certainly be happy to make changes as necessary :+1:

axe312ger commented 3 years ago

So if we remove the formatting of unrelated files and you settle the env variable question, lets merge this.

Feel free to contact me in slack via #gatsby-contentful channel

ax-vasquez commented 3 years ago

If you reduce your PR to the actually purpose of protecting from rendering undefined content, I happily give

But please avoid adding extra unrelated stuff to a PR. Makes it hard to read, review and maintian.

Sorry, misunderstood what you meant when you asked for us to align this PR with the codestyle of the userland repo. I simply used the settings for that project. I'll go through this soon and get it fixed.

This is the comment I am referring to:

"I'd like to have the userland version and this one aligned, at least on dependency/codestyle level."