fix: concurrent animation across streaming blocks - #581
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
@sleitor, @aradhyacp, @isaacwasserman I would appreciate it if you could verify the behavior. |
…gs` rehype plugin instead of the actual preprocessing-based implementation This commit fixes the issue reported at .changeset/fix-custom-tags-markdown.md:6 ## Bug The changeset `.changeset/fix-custom-tags-markdown.md` (which becomes the public `streamdown` CHANGELOG entry) claims: > Adds a new rehype plugin (rehypeMarkdownInCustomTags) that re-parses raw text content of custom tag elements as Markdown. No such plugin exists. - `grep -r rehypeMarkdownInCustomTags` → **no matches** anywhere in the repo. - The real mechanism is preprocessing: `preprocessCustomTags` (`packages/streamdown/lib/preprocess-custom-tags.ts`) rewrites multi-line custom tags into a blank-line-sandwiched HTML block so CommonMark interrupts the raw-HTML block and parses nested Markdown, and `parseMarkdownIntoBlocks` (`parse-blocks.tsx`) re-merges the interrupted open/content/close tokens. It is wired via `preprocessCustomTags(...)` in `packages/streamdown/index.tsx`, not added to any rehype plugin list. ## Impact Users and maintainers reading the changelog will look for a nonexistent `rehypeMarkdownInCustomTags` plugin/export — misleading documentation of a public release note. ## Fix Rewrote the changeset body to describe the actual preprocessing-based approach (`preprocessCustomTags` normalizing multiline tags into blank-line-sandwiched HTML blocks, with `parseMarkdownIntoBlocks` re-merging tokens). The accurate user-facing summary and `literalTagContent` exclusion note were preserved. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: farnabaz <farnabaz@gmail.com>
This was referenced Aug 19, 2026
Closed
Contributor
|
@farnabaz Tested it locally and everything looks clean from my side. The behavior looks good with no issues noticed. Thanks :) |
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.
Streaming animation was fighting itself: sibling blocks faded in at the same time, spans stuck around after settle, un-animated streams could freeze next to busy siblings, and underlined links flashed early.
This takes the useful bits from earlier attempts — wall-clock stagger chaining from #493, the “don’t let the queue run away” idea from #531, and whitespace handling from #536 — and keeps the existing model instead of rewriting it.
Stagger now shares one timeline across blocks, compresses under a fast stream instead of stacking forever, tears spans down cleanly when
isAnimatinggoes false, and glues trailing spaces into word spans so underlines don’t paint ahead.No public API changes.
staggerstill works as usual; under heavy load the cascade compresses instead of overlapping or stalling.Inspired by #493, #531, and #536.
Resolves #482
Resolves #535
Resolves #550
Resolves #570