Skip to content

refactor(exporters)!: drop the react-pdf math/diagram mappings - #3022

Open
YousefED wants to merge 6 commits into
playground/typst-editor-parityfrom
playground/remove-react-pdf-math-diagram
Open

refactor(exporters)!: drop the react-pdf math/diagram mappings#3022
YousefED wants to merge 6 commits into
playground/typst-editor-parityfrom
playground/remove-react-pdf-math-diagram

Conversation

@YousefED

@YousefED YousefED commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #3021. Addresses the #2992 review feedback: the react-pdf exporter is deprecated and the math/diagram blocks are new, so there is no installed base for their react-pdf mappings — they are removed before ever shipping. The react-pdf exporter itself is untouched and remains available from @blocknote/xl-pdf-exporter/react-pdf during its deprecation window.

Removed

  • @blocknote/math-block/pdf-exporter and @blocknote/diagram-block/pdf-exporter entry points: mappings, tests, snapshots, package exports, vite build entries.
  • @react-pdf/math and the mapping-only dev/peer deps from math-block, diagram-block, docs, playground and the converting-blocks-to-pdf example (which reverts to plain react-pdf over the shared test document — it contains no math/diagram blocks).
  • The react-pdf e2e visual test and its five baselines: its entire purpose was these mappings. The deprecated exporter keeps its unit snapshot tests in-package.
  • math.mdx's "react-pdf mappings remain available" paragraph (the reviewed spot); diagrams.mdx never advertised the subpath, so it needs no change.

Also

  • Gitignores the Next.js-postinstall-generated docs/AGENTS.md / docs/CLAUDE.md (they are not repo content — addresses the separate review note on docs/AGENTS.md).

Math and diagram export continues through the typst/PDF, docx, odt and email mappings. All unit suites, lint, and the Docker e2e (email + typst + static) are green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes

    • Removed built-in PDF export support for math and diagram blocks.
    • Math and diagram PDF exporter mappings are no longer available.
    • PDF conversion examples no longer include math or diagram content.
  • Documentation

    • Removed deprecated math PDF export guidance.
    • Clarified that MathJax is used for image-based exports.
  • Maintenance

    • Removed obsolete PDF export dependencies, build outputs, and related test coverage.
    • Updated file-upload example documentation to describe local data URL encoding.

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview Aug 28, 2026 1:55pm
blocknote-website Ready Ready Preview Aug 28, 2026 1:55pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 46be58d5-f1ce-4777-a0a4-b3db7847616a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed90ce62-ba4e-4015-b82e-34390af55be1

📥 Commits

Reviewing files that changed from the base of the PR and between 237bc25 and 3343c46.

📒 Files selected for processing (1)
  • playground/src/examples.gen.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • playground/src/examples.gen.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The deprecated React-PDF mappings for diagram and math blocks were removed. Package exports, build entries, dependencies, examples, documentation, and end-to-end test references were updated.

Changes

React-PDF exporter removal

Layer / File(s) Summary
Remove package exporter surfaces
packages/diagram-block/package.json, packages/diagram-block/src/pdf-exporter/*, packages/diagram-block/vite.config.ts, packages/math-block/package.json, packages/math-block/src/pdf-exporter/*, packages/math-block/vite.config.ts, packages/math-block/src/exporterHelpers/renderMathToImage.ts
The diagram and math PDF exporter modules and tests were deleted. Their package exports, build entries, aliases, PDF-related dependencies, and peer dependency metadata were removed.
Update PDF conversion examples
examples/05-interoperability/05-converting-blocks-to-pdf/*, playground/src/examples.gen.tsx, playground/vite.config.ts
The examples no longer register, render, or export diagram and math blocks. Their dependency declarations and build aliases were updated.
Clean documentation and test references
docs/.gitignore, docs/content/docs/features/blocks/math.mdx, docs/package.json, tests/package.json, tests/src/end-to-end/exporters/*, playground/src/examples.gen.tsx
Deprecated math PDF documentation and dependencies were removed. The React-PDF image end-to-end test was deleted, related test descriptions were updated, generated Next.js files are now ignored in docs, and the file-upload example describes local data URL encoding.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 3343c

This change removes unshipped react-pdf math and diagram mappings while preserving the deprecated exporter and other export paths; no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit trims the exporter trail
Math and diagrams leave the file
Packages shed their PDF thread
Tests and docs mark paths ahead
Clean manifests hop onward hale

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: removal of the React-PDF math and diagram mappings.
Description check ✅ Passed The description is detailed and on-topic. It explains the rationale, lists the main changes, describes impact, and reports testing results. The Screenshots/Video section and checklist are not included…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and on-topic. It explains the rationale, lists the main changes, describes impact, and reports testing results. The Screenshots/Video section and checklist are not included, but they are non-critical for this documentation and refactoring change.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch playground/remove-react-pdf-math-diagram

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The react-pdf exporter is deprecated and the math/diagram blocks are new -
there is no installed base for their react-pdf mappings (review feedback
on #2992). The exporter itself remains available unchanged during its
deprecation window; math and diagram export continues through the
typst/PDF, docx, odt and email mappings.

Also removes the react-pdf e2e visual test (its purpose was exactly these
mappings; the deprecated exporter keeps its unit snapshot tests), trims
@react-pdf/math and the mapping-only dev/peer deps from math-block,
diagram-block, docs, playground and the converting-blocks-to-pdf example,
and gitignores the Next.js-postinstall-generated docs/AGENTS.md +
docs/CLAUDE.md.
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3022/

Built to branch gh-pages at 2026-08-28 14:06 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@3022

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@3022

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@3022

@blocknote/diagram-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/diagram-block@3022

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@3022

@blocknote/math-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/math-block@3022

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@3022

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@3022

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@3022

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@3022

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@3022

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-email-exporter@3022

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@3022

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@3022

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@3022

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-typst-exporter@3022

commit: fd7941e

…locks-to-pdf slug

The new exporter's example replaces the react-pdf one at
interoperability/converting-blocks-to-pdf, so existing links show the
current exporter instead of a deprecated one. The react-pdf example moves
to converting-blocks-to-pdf-react-pdf-deprecated (linked from the docs'
deprecated-exporter section). Generated names/titles and the playground
registry regenerated; docs links validated.
…ged" from the title

PDF/UA already implies tagged; as the canonical PDF example its title
should read like what users search for. The deprecated example points to
its successor by title, so its reference follows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant