Feature Description
Add an optional bounded cache for parsed markdown state/results, so repeated identical markdown content can reuse an already parsed MarkdownState or parsed AST instead of reparsing every time it re-enters composition.
Problem Statement
rememberMarkdownState(...) improves performance within a composable instance, but it does not share parsed markdown results across list items, screens, or later compositions. In feed-style UIs, the same markdown content can be shown repeatedly as items leave/re-enter lazy lists or appear in multiple places, causing avoidable reparsing.
Proposed Solution
Expose a cache API that can be passed to rememberMarkdownState(...), or provide a built-in rememberMarkdownStateCache(...). Maybe provide Lru cache using LocalMarkdownCache static composition local. This would help apps that render large scrolling feeds, timelines, chats, documentation lists, or any UI where the same markdown content can be rendered repeatedly across compositions/screens, while still letting memory-sensitive apps opt out or configure strict bounds.
Checklist
Feature Description
Add an optional bounded cache for parsed markdown state/results, so repeated identical markdown content can reuse an already parsed
MarkdownStateor parsed AST instead of reparsing every time it re-enters composition.Problem Statement
rememberMarkdownState(...)improves performance within a composable instance, but it does not share parsed markdown results across list items, screens, or later compositions. In feed-style UIs, the same markdown content can be shown repeatedly as items leave/re-enter lazy lists or appear in multiple places, causing avoidable reparsing.Proposed Solution
Expose a cache API that can be passed to
rememberMarkdownState(...), or provide a built-inrememberMarkdownStateCache(...). Maybe provide Lru cache usingLocalMarkdownCachestatic composition local. This would help apps that render large scrolling feeds, timelines, chats, documentation lists, or any UI where the same markdown content can be rendered repeatedly across compositions/screens, while still letting memory-sensitive apps opt out or configure strict bounds.Checklist