🔥 feat(cda): Add managed entry fetching#350
Draft
Charles Hudson (phobetron) wants to merge 1 commit into
Draft
Conversation
Add Core `contentful` configuration, cached `fetchContentfulEntry()`, and `fetchOptimizedEntry()` APIs for stateful and request-bound stateless SDK flows. Introduce shared entry-source lifecycle support and optimized-entry metadata so Web Components, React Web, React Native, and Next.js helpers can resolve entries from `entryId`/`entryQuery` while preserving the manual `baselineEntry` path. Update tests, package docs, integration guides, and reference-implementation guidance for the new managed fetching surface. [[NT-3558](https://contentful.atlassian.net/browse/NT-3558)]
caa9c27 to
d8c5c38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Proposal. This PR is not final API approval.
Summary
Adds SDK-managed Contentful entry fetching across the Optimization SDK suite, allowing consumers to pass an
entryIdinstead of manually fetching a baseline entry before optimization resolution.Changes
contentfulSDK configuration for a Contentful client, default query options, per-instance caching, and cache clearing.fetchContentfulEntry()andfetchOptimizedEntry()APIs, including stateless request locale fallback and selected-optimization reuse.OptimizedEntryAPIs to support eitherbaselineEntryor SDK-managedentryIdfetching.entry-idsupport,entryQuery, loading/error events, and metadata in resolved events.ServerOptimizedEntrycan consume a managed fetch result directly.Breaking changes
No runtime breaking changes are expected for standard SDK consumers. Existing
baselineEntryusage remains supported.Potential TypeScript-only impacts for advanced/custom integrations:
fetchContentfulEntry().OptimizedEntryPropsmay need adjustment because the props now model eitherbaselineEntryorentryId.UseOptimizedEntryResultmay need to handle managed-fetch loading/error states whereentrycan be temporarily undefined.[NT-3558]