fix(website,stream-adapter): the streaming examples render nothing in dev - #463
Merged
Conversation
… dev Both streaming examples held their row model in `useMemo` and disposed it from a `useEffect` cleanup. StrictMode rehearses an unmount in dev, the memo hands the same instance back to the remount, and the grid throws `A disposed row-layout controller cannot change its columns` and renders nothing. That is the #382 blank-grid failure, shipped on three docs pages — element-streams, parsers and api-reference all embed the chat grid, and index and partial-streams embed the partial-row grid. `useDisposeOnUnmount` exists for exactly this and five other files in the repo already use it; these two were missed. The repo's dev-mode Playwright gate loads the homepage and `/docs/grid/grouping` only, so it never reached a streaming page. Each example's existing `demo.test.tsx` renders without StrictMode, which is the blind spot — a production build does not rehearse effects. Added a StrictMode twin for each, both mutation-tested: reverting the fix makes each fail with the exact disposed-controller error. Claims corrected in the same pass, each checked against the source: - streaming/index.mdx said a partial stream "never adds a row at all", then described `createRow` adding one ten lines later. It adds exactly one, and only when given a factory. - partial-streams.mdx's `createRow` snippet targeted `rowId: "msg-1"` while claiming to show what `msg-2` does. msg-1 is the seeded row, so the snippet demonstrated a path that can never fire. - The same page framed `onIssue` as the without-`createRow` case. `onIssue` fires either way; the connector reports, then builds. - api-reference.mdx's `TransactionBatcher` row omitted `subscribeError`, a public member. That table leads with a `Type` header, which is exactly the shape the docs guard's member-table detector cannot see. - `parsePartialStream`'s JSDoc claimed it fills out "each top-level array element". Its implementation throws unless the root is an object. Documented two behaviors that were load-bearing but unstated: batched calls are appended rather than merged, and `createRow` receives the changes accumulated across the frame. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove
enabled auto-merge (squash)
August 17, 2026 03:50
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Vercel preview readyPreview: https://pretable-hu86wbmkr-cacheplane.vercel.app Updated automatically by the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A claims-verification pass over
docs/streaming/— the least-verified section in the corpus (zero entries in the docs-guard roster, against 42 forgrid). It turned up a live rendering bug and five false or misleading claims.The bug: both streaming examples are blank in dev
ChatGridandPartialRowGrideach held their row model inuseMemoand disposed it from auseEffectcleanup. StrictMode rehearses an unmount in dev, the memo hands the same instance back to the remount, and the grid throws and renders nothing:That is the #382 blank-grid failure, shipped on three docs pages —
element-streams,parsersandapi-referenceembed the chat grid;indexandpartial-streamsembed the partial-row grid.useDisposeOnUnmountexists for exactly this, and five other files in the repo already use it. These two were missed.Why nothing caught it
/docs/grid/groupingonly. It never reaches a streaming page.demo.test.tsxrenders without StrictMode. A production build does not rehearse effects, so the bug is invisible there.Added a StrictMode twin for each example. Both were mutation-tested: reverting the fix makes each fail with the exact disposed-controller error, and I restored the fix afterward.
Claims corrected, each checked against the source
index.mdxcreateRow— as the same page described ten lines laterpartial-streams.mdxcreateRowsnippet targetsrowId: "msg-1"while claiming to showmsg-2partial-streams.mdxonIssueframed as the without-createRowcaseapi-reference.mdxTransactionBatcherrow lists its methodssubscribeError, a public memberparse-partial-stream.tsJSDocThat
TransactionBatchertable leads with aTypeheader — precisely the shape the docs guard's member-table detector cannot see, which is how the omission survived.Also documented two load-bearing but unstated behaviors: batched calls are appended, not merged (two updates for one row become two entries in one transaction), and
createRowreceives the changes accumulated across the frame.Not changed
index.mdxteachescreateLocalRowModel({ rows: [], columns })while both examples passgetRowId. I probed it — the taught form compiles,getRowIdis genuinely optional under theidconvention. No defect.Verification
Rebased onto
origin/mainafter #462 merged.pnpm typecheck,pnpm lint(1 pre-existing unrelated warning) andapi:checkclean; website 556 tests + stream-adapter 48 tests pass.Note for reviewers: a bare
npx vitest run --root packages/stream-adaptershows 2 failures — that is the known stale-disttrap. The package's ownpnpm test, which builds deps first, is green.🤖 Generated with Claude Code