fix: update streamed code block content - #583
Conversation
|
@Kinfe123 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
There is an adjacent half to this that content comparison alone will not reach: And once it is forwarded, I opened #585 for those two, with a test that fails with only the forwarding half applied, so each is pinned separately. It is independent of this PR — happy to rebuild it on top if this lands first. Worth noting that #584 (comparators generally) makes the in-place content case here fall out too, since a re-parsed block hands its |
Summary
Why
MemoCodepreviously compared onlyclassNameand source position. Replacing a streamed code block without moving it in the document, such as changingfirsttosecond, kept the same source position and caused React to retain the stale rendered code. Comparing the extracted code text preserves the existing optimization for unchanged blocks while allowing changed blocks to update.Validation
pnpm build:packagespnpm --filter streamdown test(73 files, 1,019 tests)pnpm checkpnpm --filter streamdown build