Skip to content

SCAL-325540 Expose host event payload/response contracts - #600

Open
yinstardev wants to merge 1 commit into
mainfrom
SCAL-325540
Open

SCAL-325540 Expose host event payload/response contracts#600
yinstardev wants to merge 1 commit into
mainfrom
SCAL-325540

Conversation

@yinstardev

Copy link
Copy Markdown
Contributor

Typed request/response contracts existed for 9 host events in hostEventClient/contracts.ts, but src/index.ts re-exported only UIPassthroughEvent from that file. Since package.json "exports" limits entry points to "." and "./react", and both typedoc configs use entryPoints: ["src/index.ts"], those types were neither importable by consumers nor rendered in the SDK reference.

  • Export the contract types from src/index.ts and mirror them on the React surface: UIPassthroughContractBase, UIPassthrough{Request, Response,ArrayResponse}, HostEvent{Request,Response}, Trigger{Payload, Response}, LiveboardTab, Applicability, ApplicabilityLevel, FilterUpdate, LiveboardFilter, LiveboardParameter.
  • Document what trigger() resolves with for the 9 mapped host events via @returns, transcribed from the response types in contracts.ts. This extends the @returns convention already used ~46x on EmbedEvent members; HostEvent previously had none.
  • Add all-types-export.parity.spec.ts: src/react/all-types-export.ts is a hand-maintained duplicate export list, and the existing spec cannot catch omissions because type-only exports are erased at runtime. The new spec compares the two files as text. It surfaced 47 pre-existing gaps (ContextType, CustomActionPayload, VizPoint, the Spotter view configs, ...) which are recorded in a KNOWN_REACT_GAPS ratchet that may only shrink, so new drift fails CI without widening this change.

Types only - no runtime or behaviour change.

@yinstardev
yinstardev requested a review from a team as a code owner July 27, 2026 10:36
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@600

commit: 81a086b

Typed request/response contracts existed for 9 host events in
hostEventClient/contracts.ts, but src/index.ts re-exported only
UIPassthroughEvent from that file. Since package.json "exports" limits
entry points to "." and "./react", and both typedoc configs use
entryPoints: ["src/index.ts"], those types were neither importable by
consumers nor rendered in the SDK reference.

- Export the contract types from src/index.ts and mirror them on the
  React surface: UIPassthroughContractBase, UIPassthrough{Request,
  Response,ArrayResponse}, HostEvent{Request,Response}, Trigger{Payload,
  Response}, LiveboardTab, Applicability, ApplicabilityLevel,
  FilterUpdate, LiveboardFilter, LiveboardParameter.
- Document what trigger() resolves with for the 9 mapped host events via
  @returns, transcribed from the response types in contracts.ts. This
  extends the @returns convention already used ~46x on EmbedEvent
  members; HostEvent previously had none.
- Add all-types-export.parity.spec.ts: src/react/all-types-export.ts is
  a hand-maintained duplicate export list, and the existing spec cannot
  catch omissions because type-only exports are erased at runtime. The
  new spec compares the two files as text. It surfaced 47 pre-existing
  gaps (ContextType, CustomActionPayload, VizPoint, the Spotter view
  configs, ...) which are recorded in a KNOWN_REACT_GAPS ratchet that
  may only shrink, so new drift fails CI without widening this change.

Types only - no runtime or behaviour change.
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