Skip to content

feat(typescript): add a client target with @nexus.poll - #101

Draft
moetemp wants to merge 4 commits into
moe/up/stream-sample-workflow-writesfrom
moe/up/typescript-client-target
Draft

moetemp wants to merge 4 commits into
moe/up/stream-sample-workflow-writesfrom
moe/up/typescript-client-target

Conversation

@moetemp

@moetemp moetemp commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds a client target to the TypeScript generator, on par with the Python one.

  • --targets workflow,client adds a client/ package with a client mixin per service, client resources and a get<Resource> factory.
  • @nexus.poll gives iter<Name> for the pages and iter<Name>Items for the items with a resume point. The sample WIT gets typescript-resume="resumeReadRequest".
  • A client resource closes at the end of await using.

@nexus.varargs and per-call RPC options stay out. A TypeScript rest parameter must come last, and startOperation takes no RPC options.

Why?

The Python client target has no TypeScript half.

How did you test it?

stream-client.test.ts checks a create, an Activity writer, a rebuilt handle, the page loop and the item iterator with a fake client. The stream output doesn't type-check on main yet, so the test loads it at run time. cargo validate passes.

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

@moetemp
moetemp force-pushed the moe/up/upstream-combined branch from 1e36335 to 7293e5b Compare November 3, 2026 15:22
@moetemp
moetemp force-pushed the moe/up/typescript-client-target branch 2 times, most recently from 5e2ddc6 to cf55965 Compare November 4, 2026 09:34
@moetemp
moetemp changed the base branch from moe/up/upstream-combined to moe/up/workflow-sync-start November 4, 2026 09:35
@moetemp
moetemp force-pushed the moe/up/workflow-sync-start branch from c392d48 to fdf9097 Compare November 5, 2026 05:19
@moetemp
moetemp force-pushed the moe/up/typescript-client-target branch 3 times, most recently from a386d04 to e314cbb Compare November 5, 2026 22:22
@moetemp
moetemp changed the base branch from moe/up/workflow-sync-start to moe/up/stream-writer-sync November 6, 2026 08:01
@moetemp
moetemp force-pushed the moe/up/typescript-client-target branch from e314cbb to a983f84 Compare November 6, 2026 08:01
@moetemp
moetemp force-pushed the moe/up/stream-writer-sync branch from 6828fe6 to a384208 Compare November 6, 2026 09:08
@moetemp
moetemp force-pushed the moe/up/typescript-client-target branch 2 times, most recently from e6111ad to 23c26b2 Compare November 9, 2026 07:57
@moetemp
moetemp changed the base branch from moe/up/stream-writer-sync to moe/up/stream-writer-sync-1106 November 9, 2026 07:57
The stream sample gets the TypeScript client API and read iterator that Python has. A client resource takes a service-bound Nexus client, as in Python.
Python yields the items of a polled page and resumes after one with its resume helper. TypeScript gets the same `iter<Name>Items` and `PollIterator`.
Python closes a resource at the end of `async with`. A TypeScript client resource with `@nexus.close` gets `Symbol.asyncDispose` for the same use.
@moetemp
moetemp force-pushed the moe/up/typescript-client-target branch from 23c26b2 to a61ab4c Compare November 13, 2026 22:22
@moetemp
moetemp changed the base branch from moe/up/stream-writer-sync-1106 to main November 13, 2026 22:22
The TypeScript client target moved the stream files to `both`, so the tests take that path. The
generated files are what this branch's generator writes from the merged WIT.
@moetemp
moetemp changed the base branch from main to moe/up/stream-sample-workflow-writes November 14, 2026 06:38
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