Skip to content

SCAL-325540 Events typings support TS - #623

Open
yinstardev wants to merge 9 commits into
mainfrom
SCAL-325540-events
Open

SCAL-325540 Events typings support TS#623
yinstardev wants to merge 9 commits into
mainfrom
SCAL-325540-events

Conversation

@yinstardev

@yinstardev yinstardev commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

SCAL-325540: Typed trigger() payloads with autocomplete, advance notice for strict typing in 1.54

What

trigger(event, data) now types data against the event's contract via DeepPartial<HostEventRequest> — every field optional at every depth, no index signature. Void events accept {}.

Why

Payload fields now autocomplete inside trigger(HostEvent.X, { … }), and typos / unknown fields / wrong types are caught at compile time with an error that names the field and lists valid ones. Previously the PayloadT | … union let TS infer "anything", which killed autocomplete.

Customer impact (TS only, tsc only — no runtime change)
✅ Omitting fields, {}, correct payloads, and all untyped events — unchanged.
⚠️ A TS build newly fails only on a field the contract doesn't have (typo or wrong shape), or a wrong type on a known field. Fix is one line.
📣 trigger() JSDoc announces strict HostEventRequest (required fields enforced) for SDK 1.54.0 / 26.11.0.cl — two releases of notice. That lands in a separate PR.
Changes
host-event-contracts.ts — DeepPartial, conditional TriggerData
ts-embed.ts, liveboard.ts — apply TriggerData, add notice
contracts.spec.ts — guardrail test pins accept/reject behaviour
events.spec.ts — Search payload made on-contract (the one in-repo break)

@yinstardev
yinstardev requested a review from a team as a code owner August 13, 2026 05:13
@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: bff1b5d

sastaachar
sastaachar previously approved these changes Sep 3, 2026
Comment thread src/embed/hostEventClient/host-event-client.ts
sastaachar
sastaachar previously approved these changes Sep 8, 2026
Comment thread src/contracts/host-event-contracts.ts Outdated
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.

3 participants