feat(live-preview): expose preview status helper [SPA-5289] - #170
Open
Maxim Cheremisin (maxcheremisin) wants to merge 1 commit into
Open
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
Maxim Cheremisin (maxcheremisin)
force-pushed
the
feat/SPA-5161-live-preview-status
branch
from
September 8, 2026 06:59
26da6c6 to
5a05bda
Compare
Maxim Cheremisin (maxcheremisin)
marked this pull request as ready for review
September 8, 2026 07:19
Maxim Cheremisin (maxcheremisin)
requested a review
from a team
as a code owner
September 8, 2026 07:19
Maxim Cheremisin (maxcheremisin)
force-pushed
the
feat/SPA-5161-live-preview-status
branch
from
September 8, 2026 07:22
5a05bda to
fb1ba8f
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.
Summary
Adds a public status signal for the Preview Session transport and wires it into the React live-preview hook.
Description
The shared live-preview client exposes
subscribeStatus. The exportedsendPreviewStatushelper publishes this message to the containing preview host:The React adapter connects the existing client lifecycle to the host-status helper. The generic package owns the message format, while the adapter only wires it into
useLivePreview.Relevant code:
packages/live-preview/src/live-preview-client.ts— status subscription and transport statuspackages/live-preview/src/preview-status.ts— host-message helperpackages/adapter-react/src/use-live-preview.ts— React integrationStatus updates are deduplicated, and reconnecting preserves the live-preview status.
This PR is stacked on #165 (
feat/SPA-5161-live-preview-adapters).Motivation and Context
The containing preview host needs to know whether the SDK is using static preview updates or an active Preview Session connection. A shared helper keeps this protocol consistent for direct package users and framework adapters.
Validation
npx nx test live-preview— 36 testsnpx vitest run src/use-live-preview.test.tsx— 7 testsPR Checklist
CONTRIBUTING.mdfile