Skip to content

docs(ai-transport): migrate UIMessageCodec to createUIMessageCodec factory#3480

Open
VeskeR wants to merge 1 commit into
mainfrom
AIT-1039/forward-uimessage-types
Open

docs(ai-transport): migrate UIMessageCodec to createUIMessageCodec factory#3480
VeskeR wants to merge 1 commit into
mainfrom
AIT-1039/forward-uimessage-types

Conversation

@VeskeR

@VeskeR VeskeR commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The AI Transport SDK PR ably/ably-ai-transport-js#267 (AIT-1039) removes the UIMessageCodec value export from @ably/ai-transport/vercel in favour of the createUIMessageCodec() factory, now generic over the AI SDK's three UIMessage type parameters (<TMetadata, TDataParts, TTools>). This updates the AI Transport docs to match.

Stacked on #3471 (zak/docs-steering) — this PR is based on that branch, so review/merge #3471 first. #3471 introduces the steering docs and already bumps the documented AIT SDK version to 0.6; this PR migrates every UIMessageCodec usage to the factory, including the steering examples and the new interruption-and-steering page from #3471. GitHub will retarget this PR to main automatically once #3471 merges.

⚠️ Both PRs document SDK 0.6.0, which is not yet published to npm. Merge once 0.6.0 is released.

What changed

  • Symbol migration across the AI Transport pages: UIMessageCodeccreateUIMessageCodec() for imports, codec: options, codec={} provider props, and .createUserMessage() / .steer(...) calls; prose mentions become "the Vercel codec".
  • Codec reference page (api/javascript/vercel/codec.mdx) reframed around the factory — it returns a fresh, stateless codec value per call — with a new "Type parameters" section documenting the generics. The page URL and nav label ("Codec") are unchanged, so no redirect is needed.
  • New "Typed messages" section on frameworks/vercel-ai-sdk-ui.mdx showing how to thread concrete UIMessage types through the imperative path (createClientSession<…> + createChatTransport<…> + useMessageSync<…>).

Conventions

  • React provider props and multi-call snippets hold a stable codec instance; one-off sends and per-request agent handlers call the factory inline — mirroring the SDK repo's own doc migration.
  • Deliberate keeps: UIMessageCodec stays in the codec page's meta_keywords (discoverability of the old name) and the internal <Table id>. The Codec-interface createUserMessage(){} contract method and all UIMessage type references are intentionally untouched.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d3aaa21d-ab3e-4ec1-8be4-bb19e29570ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch AIT-1039/forward-uimessage-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VeskeR
VeskeR requested a review from ttypic July 21, 2026 14:13
@VeskeR
VeskeR force-pushed the AIT-1039/forward-uimessage-types branch from b401c90 to 3265c75 Compare July 21, 2026 14:58
@VeskeR
VeskeR changed the base branch from main to zak/docs-steering July 21, 2026 14:59
@zknill
zknill force-pushed the zak/docs-steering branch from bc97c86 to 8b8ad92 Compare July 21, 2026 15:35
@VeskeR
VeskeR force-pushed the AIT-1039/forward-uimessage-types branch from 3265c75 to 8244a12 Compare July 21, 2026 15:42
Base automatically changed from zak/docs-steering to main July 21, 2026 15:43
ably-ai-transport-js#267 (AIT-1039) removes the UIMessageCodec value export
from @ably/ai-transport/vercel in favour of the createUIMessageCodec() factory,
now generic over the AI SDK's UIMessage <metadata, data-part, tool> parameters.
The change ships in the SDK 0.6.0 release, so the docs move to the factory
across every AI Transport page.

Stacked on #3471 (zak/docs-steering), which introduces the steering docs and
already bumps the documented AIT SDK version to 0.6; this migrates every
UIMessageCodec usage — including the new steering examples and the
interruption-and-steering page — to createUIMessageCodec().

React provider props and multi-call snippets hold a stable codec instance;
one-off sends and per-request agent handlers call the factory inline. The
Vercel codec reference page is reframed around the factory (a fresh, stateless
value per call), and a new "Typed messages" section on the Vercel AI SDK UI
page documents threading concrete UIMessage types through the imperative path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VeskeR
VeskeR force-pushed the AIT-1039/forward-uimessage-types branch from 8244a12 to 86f8213 Compare July 21, 2026 15:52

@ttypic ttypic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants