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: stable mapSliceZone (previously unstable_mapSliceZone) #336

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

angeloashmore
Copy link
Member

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 promotes mapSliceZone to a stable helper. unstable_mapSliceZone should no longer be used.

It also fixes some types for better autocompletion and type checking.

Migration guide

Replace all unstable_mapSliceZone imports and uses with mapSliceZone.

- import { createClient, unstable_mapSliceZone } from "@prismicio/client";
+ import { createClient, mapSliceZone } from "@prismicio/client";

  const client = createClient("example-prismic-repo");
  const page = await client.getByUID("page", "home");

- const mappedSliceZone = unstable_mapSliceZone(
+ const mappedSliceZone = mapSliceZone(
    page.data.slices,
    {
      image: ({ slice }) => ({ url: slice.primary.image.url }),
    }
  )

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 Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.97%. Comparing base (bd55071) to head (b54f393).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #336   +/-   ##
=======================================
  Coverage   99.97%   99.97%           
=======================================
  Files          61       61           
  Lines        6885     6905   +20     
  Branches      381      381           
=======================================
+ Hits         6883     6903   +20     
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@angeloashmore angeloashmore marked this pull request as ready for review March 26, 2024 22:15
@angeloashmore angeloashmore changed the title feat: stable mapSliceZone feat: stable mapSliceZone (previously unstable_mapSliceZone) Mar 27, 2024
@angeloashmore angeloashmore merged commit b6852a4 into master Mar 27, 2024
12 checks passed
@angeloashmore angeloashmore deleted the aa/stable-mapSliceZone branch March 27, 2024 00:46
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.

None yet

2 participants