Closed angeloashmore closed 1 year ago
Path | Size |
---|---|
dist/index.js | 0 B (-100% 🔽) |
dist/index.cjs | 0 B (-100% 🔽) |
./dist/index.cjs | 7.89 KB (+100% 🔺) |
./dist/index.js | 5.45 KB (+100% 🔺) |
./dist/react-server.cjs | 7 KB (+100% 🔺) |
./dist/react-server.js | 4.95 KB (+100% 🔺) |
Merging #178 (2e5ffac) into master (e6e05a3) will decrease coverage by
0.06%
. The diff coverage is99.48%
.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@ Coverage Diff @@
## master #178 +/- ##
==========================================
- Coverage 99.29% 99.23% -0.06%
==========================================
Files 18 21 +3
Lines 2426 2367 -59
Branches 133 125 -8
==========================================
- Hits 2409 2349 -60
- Misses 17 18 +1
Impacted Files | Coverage Δ | |
---|---|---|
src/PrismicRichText.tsx | 94.73% <92.85%> (-4.65%) |
:arrow_down: |
src/react-server/PrismicRichText.tsx | 99.25% <99.25%> (ø) |
|
src/PrismicImage.tsx | 100.00% <100.00%> (ø) |
|
src/PrismicLink.tsx | 100.00% <100.00%> (ø) |
|
src/PrismicProvider.tsx | 100.00% <100.00%> (ø) |
|
src/PrismicText.tsx | 100.00% <100.00%> (ø) |
|
src/PrismicToolbar.tsx | 100.00% <100.00%> (ø) |
|
src/SliceZone.tsx | 97.60% <100.00%> (-0.88%) |
:arrow_down: |
src/index.ts | 100.00% <100.00%> (ø) |
|
src/react-server/PrismicLink.tsx | 100.00% <100.00%> (ø) |
|
... and 2 more |
Types of changes
Description
This PR adds support for React Server Components (RSC).
RSC-compatible versions of components are provided automatically when used in Server Components.
This PR makes use of
@prismicio/client
v7. It is marked as a dependency, not a peer dependency, to be compatible with apps that have not updated to v7.APIs modified for Server Components
<PrismicLink>
: No longer supports global configuration forinternalLinkComponent
,externalLinkComponent
, andlinkResolver
.<PrismicRichText>
: No longer supports global configuration forrichTextComponents
.APIs provided unmodified
<PrismicImage>
<PrismicText>
<PrismicToolbar>
<SliceZone>
APIs not supported in Server Components
<PrismicProvider>
: Global configuration is no longer possible; React Context is not supported in RSCs.async
/await
and@prismicio/client
directly.How to use
This PR is a work in progress. Once the API matures, a guide on using
@prismicio/react
with React Server Components will be provided.Until the PR is merged, all APIs and names are unstable and may change.
Checklist:
🐱