Skip to content

Add the fact that the return value of getEntry is always nullable to upgrade guide#10142

Merged
ascorbic merged 1 commit into
mainfrom
nullable-getentry
Dec 3, 2024
Merged

Add the fact that the return value of getEntry is always nullable to upgrade guide#10142
ascorbic merged 1 commit into
mainfrom
nullable-getentry

Conversation

@ascorbic
Copy link
Copy Markdown
Contributor

@ascorbic ascorbic commented Dec 3, 2024

Description (required)

One of the side effectys of the way we generate types with the content layer is that the return type for getEntry always includes undefined. This can cause type errors if you pass a static string key and assume the result is always defined. This PR adds this to the upgrade guide.

Related issues & labels (optional)

  • Closes #
  • Suggested label:

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 3, 2024

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 5880256
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/674f3c8085d0bc000833cb32
😎 Deploy Preview https://deploy-preview-10142--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/upgrade-to/v5.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

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.

3 participants