Skip to content

Commit 4e97097

Browse files
authored
docs: add AI-agent migration guide for v8 → v9 (#3557)
## 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 - [x] Verified every v9 symbol in the guide resolves in `package/src/` - [x] Verified every `node_modules/` path referenced exists under `package/src/` - [x] Verified every `rg` pattern is syntactically valid (no exit-2 from ripgrep) - [x] 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.
1 parent e8d80bd commit 4e97097

File tree

1 file changed

+708
-0
lines changed

1 file changed

+708
-0
lines changed

0 commit comments

Comments
 (0)