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!: v3 #214

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

feat!: v3 #214

wants to merge 19 commits into from

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Nov 16, 2024

Resolves: N/A

Description

This PR cleans up and modernizes the package and its codebase. See the New features and Breaking changes sections below for details.

A dedicated upgrade guide will be available on https://prismic.io/docs.

@prismicio/react is now tested against a real Next.js project via Playwright. We'll be able to more accurately catch bugs and test against different kinds of projects.

New features

  • Support ESM environments, including Vercel Edge Runtime and Cloudflare Pages.

Breaking changes

  • Remove <PrismicProvider>. Replace global configuration with directly calling createClient() and defining custom components.
  • Remove usePrismicClient(). Replace with directly calling createClient().
  • Remove usePrismicPreviewResolver() Replace with client.resolvePreviewURL() and your router's redirect function.
  • Remove all query hooks. Replace with createClient() and a query library, like TanStack Query.

The upgrade guide will provide upgrade recommendations and examples.

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

N/A

How to QA 1

Test the alpha in a Vite and Next.js app.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Copy link

github-actions bot commented Nov 28, 2024

size-limit report 📦

Path Size
./dist/index.cjs 0 B (-100% 🔽)
./dist/index.js 0 B (-100% 🔽)
./dist/react-server.cjs 0 B (-100% 🔽)
./dist/react-server.js 0 B (-100% 🔽)
dist/index.js 2.4 KB (+100% 🔺)

@angeloashmore angeloashmore marked this pull request as ready for review January 15, 2025 22:09
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.

1 participant