Skip to content

feat(LiveProvider): add opt-in server-rendered previews - #414

Open
tujoworker wants to merge 1 commit into
FormidableLabs:masterfrom
tujoworker:feat/ssr
Open

tujoworker wants to merge 1 commit into
FormidableLabs:masterfrom
tujoworker:feat/ssr

Conversation

@tujoworker

@tujoworker tujoworker commented May 18, 2026 •

Copy link
Copy Markdown

Summary

LiveProvider previews are currently client-only. Rendering examples on the server by default would be unsafe because it could unexpectedly execute consumer code, browser-dependent code, or side effects during a server request.

This adds an explicit ssr prop for trusted, deterministic examples. Synchronous previews render in the initial server response without repeating the transform after hydration. Asynchronous transforms stay empty on the server, reuse the client hydration promise, and ignore stale results from older edits. Existing consumers remain client-only by default.

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

@tujoworker is attempting to deploy a commit to the formidable-labs Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 188edc8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-live Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tujoworker tujoworker changed the title Add initial SSR support for LiveProvider previews feat(LiveProvider): add opt-in server-rendered previews Sep 24, 2026
@tujoworker

Copy link
Copy Markdown
Author

Hi @ryan-roemer. This is now rebased onto v5 and reworked as opt-in SSR through an ssr prop, disabled by default. It includes hydration, error, update, and async race coverage, plus a changeset. The full Node 24 build and test matrix passes locally.

GitHub Actions is waiting for maintainer approval because this is an external contribution, and Vercel also needs team authorization. Would you have time to approve CI and review the API direction? Feedback on whether this approach fits the project would also be very helpful.

This branch has not been deployed

No deployments
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