mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-18 10:48:00 -05:00
[PR #21882] [CLOSED] perf: remove unnecessary {#key id} block in Markdown.svelte #49367
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21882
Author: @Classic298
Created: 2/25/2026
Status: ❌ Closed
Base:
dev← Head:perf/remove-markdown-key📝 Commits (1)
0ef287dperf: remove unnecessary {#key id} block in Markdown.svelte📊 Changes
1 file changed (+17 additions, -18 deletions)
View changed files
📝
src/lib/components/chat/Messages/Markdown.svelte(+17 -18)📄 Description
The {#key id} wrapper around MarkdownTokens forced Svelte to destroy and recreate the entire token component tree whenever id changed. Since id is derived from chatId + messageId and is stable during streaming, this mainly prevented Svelte from reusing components across re-renders and forced all child components like KatexRenderer and CodeBlock to remount. The tokens prop already drives reactivity, making the key block redundant.
this is a completely invisible change - free lunch
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.