Skip to content

v1.2.0

Latest

Choose a tag to compare

@onshinpei onshinpei released this 07 May 15:14
· 6 commits to main since this release

add experimentalIncrementalRender mode for stable/tail split rendering

What
Add experimentalIncrementalRender prop that splits rendered content into a stable part (rendered once) and a tail part (updated as characters are typed), reducing full markdown re-parses on every keystroke.

Changes

  • experimentalIncrementalRender prop — opt-in incremental rendering
  • incrementalFlushThreshold prop — controls tail buffer flush size (default 1200)
  • setContent() ref method — replace content instantly without typing animation
  • Block-boundary tracking (IncrementalContext) for fenced code, math, tables, blockquotes, setext headings — flushes tail only at safe boundaries
  • LCP optimization: when content diverges mid-string, reuses the common prefix and only types the diff

Notes

  • Off by default, no breaking changes
  • experimental prefix signals API may change in future releases

What
添加 experimentalIncrementalRender 属性,将渲染内容拆分为稳定部分(只渲染一次)和尾部(随字符打出持续更新),减少每次打字时对 Markdown 的全量重新解析。

Changes

  • experimentalIncrementalRender 属性 —— 按需开启增量渲染
  • incrementalFlushThreshold 属性 —— 控制尾部缓冲区的刷新大小(默认 1200)
  • setContent() ref 方法 —— 不经过打字动画,直接替换当前内容
  • 块边界追踪(IncrementalContext)—— 覆盖围栏代码块、数学公式、表格、引用块、setext 标题,仅在安全边界处刷新尾部
  • LCP 优化:当内容在字符串中途发生分歧时,复用公共前缀,仅对差异部分进行打字

Notes

  • 默认关闭,无破坏性变更
  • experimental 前缀表明该 API 在后续版本中可能发生变化