feat(exo): example apps opt into editor preview via enablePreview [SPA-4692]#29
Draft
Thomas Kellermeier (Chaoste) wants to merge 1 commit into
Conversation
Thomas Kellermeier (Chaoste)
force-pushed
the
spike/spa-4692-component-preview--example-integration
branch
from
July 10, 2026 14:45
fbf937a to
0cbfa4c
Compare
Both the Next.js and SvelteKit examples call `ExperienceRenderer` — the hybrid renderer from `@contentful/experiences-react` / `-svelte` — directly from their server component / server load and pass `enablePreview` on. No client-boundary shell needed; picking the right renderer at the import site is the whole customer-side change. - Server render (via `ServerExperienceRenderer` internally) emits static first-paint HTML. - After hydration, `ExperienceRenderer` hands off to `ClientExperienceRenderer`, which owns the preview wire. Outside the Contentful editor the wire is a no-op — ancestorOrigins check refuses to connect. Bundle-size impact: `/[slug]` route stays at 119 B; First Load JS 107 kB — the renderer was already client-side via hydration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Thomas Kellermeier (Chaoste)
force-pushed
the
spike/spa-4692-component-preview--example-integration
branch
from
July 10, 2026 17:05
0cbfa4c to
5463f95
Compare
6 tasks
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.
Stacked on #28. Demonstrates the minimum diff a customer applies to consume the new preview capabilities.
Summary
ExperienceRenderer— the hybrid renderer — directly from their server component / server load, and passenablePreviewon. No client-boundary shell needed; picking the right renderer at the import site is the whole customer-side change.ServerExperienceRendererinternally) emits static first-paint HTML — SEO-friendly, no blank flash for slow devices.ExperienceRendererhands off toClientExperienceRenderer, which owns the preview wire. Outside the Contentful editor the wire is a no-op — the SDK'sancestorOriginscheck refuses to connect.The three-renderer split, at the call site
Changes
app/[slug]/page.tsx+app/advanced/[slug]/page.tsx— swapServerExperienceRendererforExperienceRenderer+enablePreview. That's the entire customer-side diff.src/routes/[slug]/+page.svelte— same swap.Bundle-size impact (
next build)/[slug]route: 119 B (unchanged)