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

feat!: v5 #74

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

feat!: v5 #74

wants to merge 24 commits into from

Conversation

lihbr
Copy link
Member

@lihbr lihbr commented Dec 4, 2024

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Breaking changes:

  • Plugin
    • Removed isomorphic-unfetch fallback when globalThis.fetch is not available
    • Removed deprecated htmlSerializer option, use richTextSerializer instead
    • Removed imageComponent component option
    • Removed blankTargetRelAttribute component option
  • <SliceZone />
    • Removed resolver prop
  • <PrismicImage />
    • Removed imageComponent prop
    • Removed usePrismicImage composable
  • <PrismicLink />
    • Removed target prop
    • Removed blankTargetRelAttribute prop
    • Changed the default rel attribute for external links from noopener noreferrer to norefferer
      • This attribute is now applied on all external links (previously only on target="_blank" ones)
    • Dropped document rendering support on the field prop, use the new dedicated document prop to render documents as links
  • <PrismicText />
    • Removed usePrismicText composable
    • Removed default wrapper, text will be unwrapped by default
  • <PrismicRichText />
    • Removed deprecated htmlSerializer prop, use serializer instead
    • Removed usePrismicRichText composable
    • Removed default wrapper, text will be unwrapped by default unless you keep using the now-deprecated serializer prop
  • Composables
    • Removed all query-related composables
  • Exports
    • DefineComponentSliceComponentProps type is not exported anymore

Features:

  • Plugin
    • Added linkRel option as a replacement of blankTargetRelAttribute
  • <PrismicImage />
    • Added alt and fallbackAlt props
    • Now renders srcSet by default
  • <PrismicImage />
    • rel prop now supports a function value to resolve the desired rel attribute value
  • <PrismicRichText />
    • Introduced a new component-based serializer

Documentation:

  • Updated CONTRIBUTING.md guide

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

@lihbr lihbr marked this pull request as ready for review December 11, 2024 18:10
Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

It looks good to me, although my Vue knowledge is limited. I left a few small suggestions.

messages/alt-must-be-an-empty-string.md Outdated Show resolved Hide resolved
src/PrismicLink.vue Show resolved Hide resolved
Comment on lines -48 to -65
useAllPrismicDocumentsByIDs,
useAllPrismicDocumentsByUIDs,
useAllPrismicDocumentsByTag,
useAllPrismicDocumentsByEveryTag,
useAllPrismicDocumentsBySomeTags,
useAllPrismicDocumentsByType,
useFirstPrismicDocument,
usePrismicDocumentByID,
usePrismicDocumentByUID,
usePrismicDocuments,
usePrismicDocumentsByIDs,
usePrismicDocumentsByUIDs,
usePrismicDocumentsByTag,
usePrismicDocumentsByEveryTag,
usePrismicDocumentsBySomeTags,
usePrismicDocumentsByType,
useSinglePrismicDocument,
dangerouslyUseAllPrismicDocuments,
Copy link
Member

Choose a reason for hiding this comment

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

❓ #ask: Do you have an idea of how often these composables are used? Do Nuxt projects use them?

In @prismicio/react, I plan to provide a section in the migration guide to convert them to TanStack Query in usercode. I wonder if we need to do the same for Vue.

Copy link
Member Author

@lihbr lihbr Dec 12, 2024

Choose a reason for hiding this comment

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

I believe they were never used, especially with Nuxt because they don't integrate with Nuxt's data fetching mechanism.

I was thinking about just explaining how to create your own composable should you need to, but since TanStack Query is available in Vue also (didn't know about it), I might suggest going down the same way :)

On the Nuxt's side, Nuxt's useAsyncData is basically the TanStack equivalent.

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