Skip to content

feat(live-preview): expose preview status helper [SPA-5289] - #170

Merged
Maxim Cheremisin (maxcheremisin) merged 2 commits into
feat/SPA-5161-live-preview-adaptersfrom
feat/SPA-5161-live-preview-status
Sep 11, 2026
Merged

feat(live-preview): expose preview status helper [SPA-5289]#170
Maxim Cheremisin (maxcheremisin) merged 2 commits into
feat/SPA-5161-live-preview-adaptersfrom
feat/SPA-5161-live-preview-status

Conversation

@maxcheremisin

@maxcheremisin Maxim Cheremisin (maxcheremisin) commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Expose Preview Session transport status to the containing preview host and wire it into the React, Svelte, and Angular live-preview adapters.

Description

The shared live-preview client exposes subscribeStatus. The exported sendPreviewStatus helper publishes this message:

{
  source: 'experiences/live-preview',
  type: 'status',
  status: 'live' | 'static',
}

Each raw live-preview adapter subscribes to the shared client status:

  • packages/adapter-react/src/use-live-preview-experience.ts
  • packages/adapter-svelte/src/use-live-preview-experience.svelte.ts
  • packages/adapter-angular/src/inject-live-preview-experience.ts

The combined hooks inherit the behavior through their raw-data hooks. Adapters send static when Preview Session options are absent or incomplete, live after the WebSocket opens, and keep live during reconnects. Status subscriptions are cleaned up with the data subscriptions.

The generic package owns the message format and transport status. The framework adapters only connect that status to the host-message helper.

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 across direct package users and all framework adapters.

Validation

  • npx nx test live-preview
  • npx nx test adapter-react
  • npx nx test adapter-svelte
  • npx nx test adapter-angular
  • npm ci --dry-run --ignore-scripts --no-audit --no-fund

PR Checklist

  • I have read the CONTRIBUTING.md file
  • All commits follow conventional commits
  • Documentation is updated (if necessary)
  • PR doesn't contain any sensitive information
  • There are no breaking changes

Note: This PR was created with the contentful-github-create-pull-request skill, powered by Agents Kit. To follow or use this workflow, see the Agents Kit CLI skill docs.

@wiz-inc-38d59fb8d7

wiz-inc-38d59fb8d7 Bot commented Sep 4, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

@maxcheremisin Maxim Cheremisin (maxcheremisin) changed the title feat(live-preview): expose preview status helper [SPA-5161] feat(live-preview): expose preview status helper [SPA-5289] Sep 8, 2026
@maxcheremisin
Maxim Cheremisin (maxcheremisin) marked this pull request as ready for review September 8, 2026 07:19
@maxcheremisin
Maxim Cheremisin (maxcheremisin) force-pushed the feat/SPA-5161-live-preview-status branch 2 times, most recently from 53e2814 to a9950fa Compare September 11, 2026 09:58
@maxcheremisin
Maxim Cheremisin (maxcheremisin) merged commit 88e6dcd into main Sep 11, 2026
13 checks passed
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.

4 participants