Skip to content

⬆️(dependencies) upgrade BlockNote to 0.56.0 and export PDFs with Typst - #2936

Merged
AntoLC merged 3 commits into
mainfrom
chore/upgrade-blocknote-0-56
Oct 29, 2026
Merged

AntoLC merged 3 commits into
mainfrom
chore/upgrade-blocknote-0-56

Conversation

@AntoLC

@AntoLC AntoLC commented Oct 28, 2026

Copy link
Copy Markdown
Member

Purpose

Upgrade BlockNote to 0.56.0. Its PDF exporter moves from react-pdf to the Typst engine, so the PDF export of Docs has to be migrated in the same step: the exported PDFs are now tagged, and declared PDF/UA-1 when the document conforms.

Proposal

  • Bump every @blocknote/* package to 0.56.0 (impress and y-provider), align tiptap on 3.32.0 and keep a single copy of prosemirror-transform
  • Handle the breaking changes: blockTypeSelectItems takes the editor, menus need a portal element, block mappings can be { withChildren }
  • Rewrite the PDF mappings (callout, image, upload loader, interlink, user mention) as Typst markup, drop @react-pdf/*, @ag-media/react-pdf-table, emoji-datasource-apple and the emoji prebuild script
  • DocsPDFExporter overrides the BlockNote preamble so that headings and links look like in the editor
  • Replace an image that cannot be fetched (e.g. refused by the cors-proxy) by a short message in the PDF, Docx and ODT exports, instead of dropping it or failing the Docx export

@AntoLC AntoLC added dependencies Pull requests that update a dependency file frontend editor export labels Oct 28, 2026
@AntoLC AntoLC self-assigned this Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: -370 kB (-9.05%) ✅

Total Size: 3.72 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/8c114208/_buildManifest.js 0 B -737 B (removed) 🏆
apps/impress/out/_next/static/9e80d579/_buildManifest.js 738 B +738 B (new file) 🆕
apps/impress/out/_next/static/chunks/1f708b62.js 76.4 kB +76.4 kB (new file) 🆕
apps/impress/out/_next/static/chunks/2f14fd75.js 45.8 kB -32.2 kB (-41.26%) 🎉
apps/impress/out/_next/static/chunks/3a18ceaa.js 0 B -47.9 kB (removed) 🏆
apps/impress/out/_next/static/chunks/5eae7a46.js 28.1 kB +1.19 kB (+4.42%)
apps/impress/out/_next/static/chunks/8d7c1fad.js 0 B -29.4 kB (removed) 🏆
apps/impress/out/_next/static/chunks/631.js 0 B -4.83 kB (removed) 🏆
apps/impress/out/_next/static/chunks/692ffdca.js 0 B -68.6 kB (removed) 🏆
apps/impress/out/_next/static/chunks/1831.js 320 kB +320 kB (new file) 🆕
apps/impress/out/_next/static/chunks/2869.js 74.7 kB +74.7 kB (new file) 🆕
apps/impress/out/_next/static/chunks/3646.js 4.62 kB +4.62 kB (new file) 🆕
apps/impress/out/_next/static/chunks/4562.js 0 B -51.9 kB (removed) 🏆
apps/impress/out/_next/static/chunks/6770.js 0 B -70.2 kB (removed) 🏆
apps/impress/out/_next/static/chunks/6913.js 0 B -285 kB (removed) 🏆
apps/impress/out/_next/static/chunks/7425.js 95.9 kB +95.9 kB (new file) 🆕
apps/impress/out/_next/static/chunks/7963.js 0 B -362 kB (removed) 🏆
apps/impress/out/_next/static/chunks/8556.js 58.3 kB +58.3 kB (new file) 🆕
apps/impress/out/_next/static/chunks/75519b8b.js 0 B -28.1 kB (removed) 🏆
apps/impress/out/_next/static/chunks/9246647c.js 49.7 kB +7.28 kB (+17.16%) ⚠️
apps/impress/out/_next/static/chunks/a498f5e2.js 0 B -30.4 kB (removed) 🏆
apps/impress/out/_next/static/css/0ed65dbb12a1cb63.css 13.2 kB +13.2 kB (new file) 🆕
apps/impress/out/_next/static/css/1db20c57e6a3a5a2.css 0 B -12.4 kB (removed) 🏆
apps/impress/out/_next/static/css/1fc2647c4c8056f4.css 13.7 kB +13.7 kB (new file) 🆕
apps/impress/out/_next/static/css/6b86d2cd23ca68de.css 0 B -13.4 kB (removed) 🏆
apps/impress/out/_next/static/css/53ba036daba15dd9.css 0 B -3.9 kB (removed) 🏆
apps/impress/out/_next/static/css/b5ae3f1b821bee19.css 13.6 kB +13.6 kB (new file) 🆕
apps/impress/out/_next/static/css/f048233e311d9df4.css 0 B -13.2 kB (removed) 🏆
apps/impress/out/_next/static/css/fa3bd7e119d6c51c.css 3.95 kB +3.95 kB (new file) 🆕

compressed-size-action

@AntoLC AntoLC linked an issue Oct 28, 2026 that may be closed by this pull request
BlockNote 0.56.0 brings layout blocks, a rebuilt side menu hover
and many fixes. It also moves the PDF export from @react-pdf/renderer
to the Typst engine: the math and diagram blocks no longer ship a
react-pdf mapping, so the bump cannot build without migrating the PDF
export, which is why both are done in this commit.

The PDF mappings now return Typst markup: the exported PDF is tagged,
and declared PDF/UA-1 when the document conforms. The avatar of a
user mention is exported as an artifact. The react-pdf dependencies,
the emoji copy script and the png assets it needed are removed.

The other breaking changes are handled: blockTypeSelectItems takes the
editor, the menus need a portal element, `null` is no longer a portal
target, the render of a block spec is optional, and a block mapping
can be a `{ withChildren }` mapping. jszip is declared, docx no longer
brings it, and the tiptap and prosemirror-transform resolutions keep a
single copy of each package.

Signed-off-by: Anthony LC <[email protected]>
An image the export cannot fetch, e.g. one the cors-proxy refuses
because its URL redirects, was silently left out of the PDF and ODT,
and made the whole Docx export fail. The proxy is meant to be removed,
so such images are not going to be supported: the export now shows a
short message in their place, in the three formats.

Signed-off-by: Anthony LC <[email protected]>
@AntoLC
AntoLC force-pushed the chore/upgrade-blocknote-0-56 branch from e9fb290 to c2a7052 Compare October 28, 2026 17:12
BlockNote has Mermaid lay a diagram out with Mermaid's default font
(Trebuchet MS, else Verdana, Arial...), then only renames the font of
the labels to the one Typst draws them with. The boxes were sized for
a font that depends on the OS: the labels could overflow them, and the
PDF regression test failed on the Linux CI with a fixture made on
Windows.

The diagram mapping now gives Mermaid the font of the export through
an init directive, and the exporter registers this font in the browser
with the very bytes Typst embeds, so that the layout no longer depends
on the fonts installed on the OS. The PDF regression fixtures are
regenerated accordingly.

Signed-off-by: Anthony LC <[email protected]>
@AntoLC
AntoLC requested a review from Ovgodd October 29, 2026 10:51

@Ovgodd Ovgodd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice ! look like the pdfs are accessible !

Image

@AntoLC
AntoLC merged commit e9a7dca into main Oct 29, 2026
50 checks passed
@AntoLC
AntoLC deleted the chore/upgrade-blocknote-0-56 branch October 29, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file editor export frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛(Bug) Math formulas render badly in PDF export PDF export : image ratio not kept Images missing when exporting to ODT format

2 participants