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!: refresh components #11

Merged
merged 23 commits into from
Aug 25, 2023
Merged

feat!: refresh components #11

merged 23 commits into from
Aug 25, 2023

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Aug 24, 2023

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

This PR refreshes @prismicio/svelte and its components.

Breaking changes

<PrismicRichText>: Custom components do not need to be wrapped in a function.

<!-- Before -->
<PrismicRichText
  field={document.data.richTextField}
  components={{
    heading1: () => Heading1
  }}
/>

<!-- After -->
<PrismicRichText
  field={document.data.richTextField}
  components={{
    heading1: Heading1
  }}
/>

<PrismicRichText>: Function-based components prop is no longer supported.

Use a map-based components prop instead.

<!-- Before -->
<PrismicRichText
  field={document.data.richTextField}
  components={(type) => {
    if (type === "heading1") {
      return Heading1
    }
  }}
/>

<!-- After -->
<PrismicRichText
  field={document.data.richTextField}
  components={{
    heading1: Heading1
  }}
/>

<PrismicLink>: Link resolvers are not longer supported.

Use a route resolver configured in @prismicio/client instead.

<!-- Before -->
<PrismicLink
  field={document.data.linkField}
  linkResolver={linkResolver}
>
  Click me!
</PrismicLink>

<!-- after -->
<PrismicLink field={document.data.linkField}>
  Click me!
</PrismicLink>

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.

🐿️

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2023

Codecov Report

Merging #11 (070b975) into master (93a1b59) will increase coverage by 41.87%.
Report is 76 commits behind head on master.
The diff coverage is 91.87%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##           master      #11       +/-   ##
===========================================
+ Coverage   50.00%   91.87%   +41.87%     
===========================================
  Files           1       11       +10     
  Lines           2      603      +601     
===========================================
+ Hits            1      554      +553     
- Misses          1       49       +48     
Files Changed Coverage Δ
src/PrismicRichText/DefaultComponent.svelte 42.85% <42.85%> (ø)
src/PrismicRichText/Serialize.svelte 77.77% <77.77%> (ø)
src/PrismicText.svelte 87.93% <87.93%> (ø)
src/lib/devMsg.ts 90.00% <90.00%> (ø)
src/PrismicEmbed.svelte 100.00% <100.00%> (ø)
src/PrismicImage.svelte 100.00% <100.00%> (ø)
src/PrismicLink.svelte 100.00% <100.00%> (ø)
src/PrismicRichText/PrismicRichText.svelte 100.00% <100.00%> (ø)
src/SliceZone/SliceZone.svelte 100.00% <100.00%> (ø)
src/SliceZone/TodoComponent.svelte 100.00% <100.00%> (ø)
... and 1 more

@angeloashmore angeloashmore marked this pull request as ready for review August 25, 2023 03:46
@angeloashmore angeloashmore changed the title feat: refresh components feat!: refresh components Aug 25, 2023
@angeloashmore angeloashmore merged commit 5fd5d3e into master Aug 25, 2023
12 checks passed
@angeloashmore angeloashmore deleted the aa/infra branch August 25, 2023 05:31
@haroldao
Copy link

@angeloashmore I think it would be great to update the doc and mention that we don't need to add a custom linkResolver function to have eveything running correctly :)

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