microsoft / microsoft/SwiftStreamingMarkdown

[Feature Request]: Make RenderableDocument codable

Open
#154 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need_more_info
Dominant language
Swift
Stars
364
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Why?

MarkdownView requires markdown parsing when using in a list (using as a single view is fine). Markdown parsing is called every time when the cell/row is reused and it's heavy. This is a perf issue.

Workaround

Current workaround to mitigate is to use a in-memory cache for RenderableDocument.

Suggestions

We can move a step forward and make RenderableDocument conform to Codable protocol. In that way, we can parse ahead and store it wherever we want (e.g. database).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate RenderableDocument and MarkdownView, then read how documents are created and consumed during list cell or row reuse. Add Codable support so a parsed RenderableDocument can be encoded and decoded for storage, and verify that the decoded document remains usable by MarkdownView without requiring parsing again.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop-dev, mobile-dev, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.