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

fix(astro:content): add deprecated to getEntryBySlug & getDataEntryById #11600

Merged

Conversation

ArmandPhilippot
Copy link
Contributor

@ArmandPhilippot ArmandPhilippot commented Aug 2, 2024

Changes

As noted in the documentation, getEntryBySlug is deprecated in favor of getEntry. @delucis confirmed to me that this also applied to getDataEntryById.

  • Adds a @deprecated warning on these two functions to help consumers migrate to getEntry.

Testing

Locally, the JSDoc comment is correctly displayed when hovering the functions so I don't think another test is needed.

Docs

Docs is needed for getDataEntryById but this is already covered up by withastro/docs#8943

As noted in the documentation, `getEntryBySlug` is deprecated in favor
of `getEntry`. The same applies to `getDataEntryById`.
Copy link

changeset-bot bot commented Aug 2, 2024

🦋 Changeset detected

Latest commit: 6b96ffc

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Aug 2, 2024
@ArmandPhilippot ArmandPhilippot changed the title fix(astro:content): add deprecated to getEntryBySlug & getDataByEntry fix(astro:content): add deprecated to getEntryBySlug & getDataEntryById Aug 2, 2024
@bluwy bluwy requested a review from a team August 2, 2024 13:08
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

+1 on your changeset suggestion. Otherwise LGTM!

.changeset/dull-taxis-warn.md Outdated Show resolved Hide resolved
@delucis delucis merged commit 09ec2ca into withastro:main Aug 2, 2024
13 checks passed
@ArmandPhilippot ArmandPhilippot deleted the fix/astro-content-deprecated-functions branch August 2, 2024 14:32
This was referenced Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants