Skip to content

Commit 405a3a0

Browse files
committed
chore(release): v1.5.1
Streaming robustness patch: block-memo now invalidates raw-HTML container blocks while rehype-raw swallow is in effect (duplicate footnote section / frozen trailing content fix), and the Mantine mermaid renderer follows an explicit streaming lifecycle (silent mid-stream failures, generation reset on regenerate, single corrective pass at stream end, body-path rendering to survive hidden-host measurement). See docs/release-highlights.md.
1 parent ad3a671 commit 405a3a0

6 files changed

Lines changed: 13 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ Issues and pull requests are welcome. For non-trivial changes, please open an is
672672

673673
Reporting a bug helps most when it includes:
674674

675-
- The package and version (`@ai-react-markdown/core@1.5.0` …)
675+
- The package and version (`@ai-react-markdown/core@1.5.1` …)
676676
- The relevant `<AIMarkdown>` / `<MantineAIMarkdown>` props
677677
- A minimal markdown sample that reproduces the issue
678678
- For streaming-related bugs: the chunk sequence (one string per chunk)

docs/release-highlights.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ A distilled, human-readable summary of what's notable in each version — extrac
88

99
## 1.5.x — Mantine 9
1010

11+
### 1.5.1 — Streaming robustness: raw-HTML swallow and mermaid lifecycle
12+
13+
- Core's block-memo cache no longer freezes stale content when a streaming document contains an unclosed raw-HTML container (`<details>` before its `</details>` arrives — but any container tag qualifies). rehype-raw's HTML parsing reparents every following sibling into the open container, including the synthetic footnote section, while the block's source-level cache identity stays byte-identical; the first swallowed snapshot used to become a permanent cache hit, leaving a duplicated footnote section trapped inside the container and freezing trailing content mid-stream. Raw-HTML blocks now carry a structural digest of their rendered subtree, so the cache invalidates exactly while swallowing is in effect and recovers in one frame once the close tag lands. Markdown-native blocks skip the digest walk entirely — no new per-frame cost on large deterministic subtrees like KaTeX output.
14+
- `@ai-react-markdown/mantine`'s mermaid renderer is now streaming-aware. While `streaming` is true, parse failures on truncated code are silent: the raw source shows as a plain code block until the first prefix parses, then the last good SVG stays up and refreshes on each subsequent success — no more "Mermaid Render Error" flashes mid-stream. When streaming ends, one corrective pass runs on the final code; its failure is the only one allowed to replace a rendered diagram. A `streaming` false→true edge is treated as a new generation (chat "regenerate" reuses the same component instance) and resets the warm-up state, so a new stream never shows the previous generation's stale diagram or error tab. Static (non-streaming) rendering keeps the original conservative rule: a rendered diagram is never clobbered by a later transient failure.
15+
- `mermaid.render` no longer receives the host element: the host is hidden during warm-up, and `display: none` zeroes mermaid's getBBox text measurement — one-shot static renders came out as ~16px SVGs. Rendering through mermaid's own body-temp path decouples measurement from container visibility; `suppressErrorRendering` additionally keeps mermaid's temp nodes from accumulating in `document.body` when a draw-phase error slips past `parse`.
16+
- Storybook gains a `Mantine/MantineAIMarkdown → Streaming` story that streams a mermaid-heavy document token by token; `content` is a control, so arbitrary markdown can be streamed for eyeballing.
17+
1118
### 1.5.0 — `@ai-react-markdown/mantine` moves to Mantine 9
1219

1320
- `@ai-react-markdown/mantine` now requires `@mantine/core` and `@mantine/code-highlight` `^9.0.0` as peers (tested against 9.4.1). No API changes on our side — the package's surface survives every Mantine 9 breaking change untouched. Consumers inherit Mantine 9's defaults: `md` (8px) default radius, solid light-variant colors (Mantine's `v8CssVariablesResolver` restores the 8.x look), and a React 19.2 floor.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-react-markdown",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"private": true,
55
"type": "module",
66
"description": "A React component for rendering AI-generated Markdown with LaTeX math, GFM, syntax highlighting and more.",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ai-react-markdown/core",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Core rendering engine for ai-react-markdown — LaTeX preprocessing, plugin pipeline, and React components.",
55
"publishConfig": {
66
"access": "public"

packages/mantine/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ yarn add @ai-react-markdown/mantine @ai-react-markdown/core
3636
{
3737
"react": ">=19",
3838
"react-dom": ">=19",
39-
"@ai-react-markdown/core": "^1.5.0",
39+
"@ai-react-markdown/core": "^1.5.1",
4040
"@mantine/core": "^9.0.0",
4141
"@mantine/code-highlight": "^9.0.0",
4242
"highlight.js": "^11.11.1"

packages/mantine/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ai-react-markdown/mantine",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Mantine UI integration for ai-react-markdown — themed typography, syntax highlighting via @mantine/code-highlight, Mermaid diagrams, and automatic color scheme detection.",
55
"publishConfig": {
66
"access": "public"
@@ -56,7 +56,7 @@
5656
"typecheck": "tsc --noEmit -p tsconfig.json"
5757
},
5858
"peerDependencies": {
59-
"@ai-react-markdown/core": "^1.5.0",
59+
"@ai-react-markdown/core": "^1.5.1",
6060
"@mantine/code-highlight": "^9.0.0",
6161
"@mantine/core": "^9.0.0",
6262
"highlight.js": "^11.11.1",

0 commit comments

Comments
 (0)