Skip to content

Fix TypeScript samples that use APIs missing from @temporalio 1.24.0 - #5411

Merged
Duncanma merged 2 commits into
mainfrom
duncan/compassionate-shaw-52aa33
Oct 5, 2026
Merged

Duncanma merged 2 commits into
mainfrom
duncan/compassionate-shaw-52aa33

Conversation

@Duncanma

@Duncanma Duncanma commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Fixes hand-written TypeScript samples that call APIs the latest @temporalio packages (1.24.0) don't have. Each was confirmed against the published .d.ts files.

Changes

  • docs/design-patterns/fixed-count-retries.mdx: wf.RetryState doesn't exist because @temporalio/workflow doesn't re-export it. The sample now imports RetryState from @temporalio/common.
  • docs/design-patterns/fixed-wall-time-retries.mdx: TimeoutFailure has timeoutType, not type, and wf.TimeoutType isn't exported. The sample now uses cause.timeoutType and imports TimeoutType from @temporalio/common.
  • docs/develop/typescript/best-practices/testing-suite.mdx: Fixed the heatbeat import typo, which is now heartbeat.
  • docs/develop/typescript/client/temporal-client.mdx: client.getHandle() came from the old WorkflowClient API, so the two result samples now use client.workflow.getHandle(). The "Start a Workflow Execution" sample declared const handle twice. It already gets a handle from client.workflow.start(), so I removed the second declaration.
  • docs/develop/typescript/workflows/workflow-streams.mdx: The TypeScript SDK has no executeActivity. The LLM streaming Workflow now calls the Activity through proxyActivities<typeof activities>(), like the rest of the TypeScript docs.

Not in this PR

The code comment on temporal-client.mdx that points to /typescript/security#encryption-in-transit-with-mtls is in the Worker sample that #5407 moves to Snipsync, and that change removes the comment. I left the block alone to avoid a conflict. #5407's commit rebases cleanly onto this branch.

Checks

  • vale --config .vale-ci.ini on the five pages: 0 errors and 0 warnings. Three suggestions remain on lines 611–625 of temporal-client.mdx, which this PR doesn't change.
  • I ran the in-progress TypeScript sample checker (bin/check-typescript-samples.js --sdk-version 1.24.0) on the five pages. It's not on main yet. It checked 55 samples. Of its 9 findings on main, only the comment link that Source TypeScript Task Queue samples from samples-typescript via Snipsync #5407 handles remains.

- fixed-count-retries: import RetryState from @temporalio/common; the
  workflow package doesn't re-export it.
- fixed-wall-time-retries: TimeoutFailure has timeoutType, not type; import
  TimeoutType from @temporalio/common.
- testing-suite: fix the heatbeat import typo.
- temporal-client: client.getHandle() was the old WorkflowClient API; use
  client.workflow.getHandle(). Drop the redundant second handle declaration
  in the start sample.
- workflow-streams: the TypeScript SDK has no executeActivity; call the
  Activity through proxyActivities.
@Duncanma
Duncanma requested a review from a team as a code owner October 5, 2026 18:59
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Oct 5, 2026 8:22pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

@Duncanma
Duncanma merged commit 4803fcd into main Oct 5, 2026
8 of 14 checks passed
@Duncanma
Duncanma deleted the duncan/compassionate-shaw-52aa33 branch October 5, 2026 20:32

This branch was successfully deployed

1 active deployment
Preview — 29fd06aa Deployed Oct 5, 2026 by vercel[bot]
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.

2 participants