Skip to content

docs: add AI-agent migration guide for v8 → v9#3557

Merged
isekovanic merged 2 commits intodevelopfrom
docs/ai-migration-guide
Apr 17, 2026
Merged

docs: add AI-agent migration guide for v8 → v9#3557
isekovanic merged 2 commits intodevelopfrom
docs/ai-migration-guide

Conversation

@oliverlaz
Copy link
Copy Markdown
Member

Summary

Adds ai-docs/ai-migration.md — a compact, machine-friendly v8 → v9 migration reference built for AI coding agents (Claude Code, Cursor, Copilot, etc.).

The human-oriented v8 → v9 guide at https://getstream.io/chat/docs/sdk/react-native/basics/upgrading-from-v8/ is ~40k tokens. Loading it wholesale eats most of an agent's context window before any code work begins. This sibling doc is ~4k tokens (5× smaller) — prose rationale stripped, rename tables/decision rules/source pointers kept.

Customers point their agent at the raw GitHub URL. It is not shipped in the npm package.

Key agent-oriented features

  • §0 primer tells agents not to trust training data for v9 symbols (their cutoff predates v9) and names the correct node_modules path — the installed package is stream-chat-react-native-core, not stream-chat-react-native (which is the bare-RN wrapper).
  • §1 detection greps let agents scope the work with a single rg pass and skip sections whose patterns don't match the customer codebase.
  • §3 big-3 structural migrations enforce ordering: WithComponents, 5 component renames, inverted audio semantics — done first because many leaf renames evaporate after the big moves.
  • §6 behavior changes captures runtime-semantic shifts that aren't pure renames (messageContentOrder default swap, deletedMessagesVisibilityType removal, swipe-to-reply boundary, MessageActionType.type field, etc.).
  • §7 JSON rename block is the full v8 → v9 symbol map in a single parseable block for programmatic find/replace.
  • §9 verification workflow gives agents a hard gate: rg + tsc commands that must come back clean before the agent declares done.

Stacked on #3556

This PR targets refactor/v9-finish-message-menu-and-audio-hook so the guide can accurately claim useAudioPlayer is the v9 hook name and MessageMenu is removed. GitHub will auto-retarget to develop when #3556 merges.

Test plan

  • Verified every v9 symbol in the guide resolves in package/src/
  • Verified every node_modules/ path referenced exists under package/src/
  • Verified every rg pattern is syntactically valid (no exit-2 from ripgrep)
  • Confirmed all "removed" claims in the JSON block are genuinely absent from v9 source (only i18n translation keys and stale JSDoc comments mention them)
  • Dogfood check: paste the raw URL into Claude Code on a fresh v8 example app and have it migrate

Related docs updates

Human migration guide edits (correcting the MessageMenu and AudioAttachment claims that this agent guide is also correcting) are a separate PR in the docs-content repo.

… rename

MessageMenu was left in the v9 public surface even though the overlay path
no longer renders it; the source file carried a `// TODO: V9: Either remove
this or refactor it` note. Delete the component, its DEFAULT_COMPONENTS
entry, and its barrel re-export. The surrounding MessageMenu folder stays —
MessageActionList, MessageActionListItem, MessageReactionPicker, and
MessageUserReactions are the live replacements and remain overridable via
WithComponents.

Also finish the useAudioPlayerControl -> useAudioPlayer rename. The
byte-identical `useAudioPlayer.ts` was already being imported directly by
the internal callers (AudioAttachment, AudioRecordingPreview); only the
barrel still pointed at the old name. Flip the barrel and delete the dead
duplicate file.
Adds ai-docs/ai-migration.md — a compact (~4k token), machine-friendly
migration reference for AI coding agents like Claude Code and Cursor.

The human-oriented v8→v9 guide at
https://getstream.io/chat/docs/sdk/react-native/basics/upgrading-from-v8/
is ~40k tokens and eats most of an agent's context window before work
begins. This sibling doc strips rationale prose and keeps what agents
actually need: rename bullets, detection/verification greps, decision
rules for ambiguous cases, a machine-readable JSON rename block, and
pointers into the installed SDK source under
node_modules/stream-chat-react-native-core/src/.

Key agent-oriented features:

- §0 primer explicitly tells agents not to trust training data for v9
  symbols (which predate v9) and names the correct node_modules path,
  since the installed package is `stream-chat-react-native-core`, not
  `stream-chat-react-native` (which is the bare-RN wrapper).
- §1 detection greps let agents scope work by running a single rg pass
  and skipping sections whose patterns don't match.
- §3 forces the three structural migrations first (WithComponents, 5
  component renames, inverted audio semantics) because many leaf renames
  evaporate after the big moves.
- §6 covers behavior changes that aren't pure renames (messageContentOrder
  default swap, deleted-message visibility, swipe-to-reply boundary, etc.)
- §7 ships the full rename map as JSON for programmatic find/replace.
- §9 gives agents a gate: rg + tsc commands that must come back clean
  before declaring done.

Distribution: GitHub raw URL only — customers paste the link into their
agent. Not added to the npm package's files array.
Base automatically changed from refactor/v9-finish-message-menu-and-audio-hook to develop April 17, 2026 11:23
@isekovanic isekovanic merged commit 4e97097 into develop Apr 17, 2026
2 checks passed
@isekovanic isekovanic deleted the docs/ai-migration-guide branch April 17, 2026 11:23
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