Update to BentoPDF v2.8.8; bundle the text editor's fallback fonts - #3
Merged
Merged
Conversation
Bump upstream bentopdf-simple v2.8.4 → v2.8.8 (the interim v2.8.7 bump never published — its tag was removed — so this supersedes it). v2.8.8 includes the v2.8.7 security fixes (three advisories affecting all versions ≤ v2.8.6), adds in-place PDF text editing, fixes string rendering on the -simple image (#833), WASM init timeouts (#324) and PDF→TIFF memory use, and adds duplex sort, non-Latin editor text, and removes analytics. Kura / Hyper Compress are not integrated in v2.8.8. The three WASM libraries and their URL shapes are unchanged — only the FROM tag moves. New CDN dependency, bundled: the text editor fetches seven Noto fallback fonts (@embedpdf/fonts-*@1.0.0) from jsdelivr on demand, from a base URL baked into three hash-suffixed chunks by both editor-fonts.ts and the @embedpdf engine (whose ${version} resolves to 1.0.0). The Dockerfile now vendors only the single Regular-weight file per package that upstream references (22.8 MB, not the packages' 150 MB of unused weights), laid out as <pkg>@1.0.0/fonts/<file> under /usr/share/nginx/html/fonts/embedpdf/, and the rewrite-wasm-urls oneshot rewrites the @embedpdf base URL to /fonts/embedpdf in every chunk that carries it (matched by content, so it survives chunk-hash changes) and deletes those chunks' .br copies. Package version 2.8.4:1 → 2.8.8:0; the release notes lead with the security fixes users are actually receiving. SDK stays 2.0.9. README, instructions, CONTRIBUTING and AGENTS updated; the AGENTS bump rule now covers editor-fonts.ts alongside wasm-provider.ts. Found while scanning the built bundle for any other CDN URL: OCR (tesseract.js) still loads its worker, core WASM and language data from public CDNs — its only configured workerPath is the library's jsdelivr default, BentoPDF overrides it only via build-time VITE_TESSERACT_*_URL (unset in the -simple image), and no local worker.min.js ships. Pre-existing since 2.8.4:1, not a regression; now documented as a limitation, with bundling tracked as a follow-up issue. Verified: tsc + SDK lint clean; both arches pack (version 2.8.8:0, sdkVersion 2.0.9; x86_64 grew 168 → 191 MB = the fonts). Against the built v2.8.8 image, running the exact oneshot logic: zero jsdelivr WASM URLs survive; all seven font files present at the expected local paths (22 MB); the @embedpdf prefix rewritten in all three chunks with none surviving; rewritten chunks' .br copies removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates BentoPDF v2.8.4 → v2.8.8, and bundles the new text editor's fallback fonts so the package keeps its "no CDN at runtime" guarantee. (The last shipped release is
2.8.4:1; the interim v2.8.7 bump never published — its tag was removed — so this supersedes it.)Upstream — v2.8.8
GHSA-wh78-rcw2-hhg9,GHSA-5xjf-rr5x-pcfj,GHSA-cx8x-7rrr-r9x8, affecting all versions ≤ v2.8.6) — the main reason to ship this.-simpleimage we use (#833), a WASM-init-timeout fix (#324), a PDF→TIFF OOM fix, duplex sort, non-Latin editor text, analytics removed.FROMtag moves.The one new CDN dependency — and why it's bundled
v2.8.8's text editor fetches seven Noto fallback fonts (
@embedpdf/fonts-{latin,arabic,hebrew,jp,kr,sc,tc}@1.0.0, one Regular-weight file each) from jsdelivr on demand. The base URL is baked into three hash-suffixed chunks (edit-pdf-*,embedpdf-*,worker-engine-*) — both by BentoPDF'seditor-fonts.tsand by the@embedpdfengine's own loader. Left alone, that silently breaks this package's core promise for its headline new feature. So:<pkg>@1.0.0/fonts/<file>under/usr/share/nginx/html/fonts/embedpdf/so the rewritten base URL resolves unchanged.rewrite-wasm-urlsoneshot now also rewrites the@embedpdfbase URL →/fonts/embedpdfin every chunk that carries it (found by content, so it survives chunk-hash changes), and deletes those chunks'.brcopies. The engine's${version}resolves to1.0.0, so both font-loading paths land on the bundled files.Package version
2.8.4:1→2.8.8:0. SDK stays 2.0.9. README, instructions, CONTRIBUTING and AGENTS updated; the AGENTS bump rule now says to readeditor-fonts.tsalongsidewasm-provider.ts.Verification
tsc+ SDK lint clean.version 2.8.8:0,sdkVersion 2.0.9; the x86_64 package grew 168 → 191 MB (= the fonts).@embedpdfprefix rewritten in all 3 chunks with none surviving; rewritten chunks'.brremoved. The scan for any other jsdelivr URL turned up one, pre-existing and out of scope here: the OCR tool (tesseract.js) still loads its worker/core/language data from public CDNs — its only configuredworkerPathis the library's jsdelivr default, BentoPDF overrides it only via build-timeVITE_TESSERACT_*_URL(unset in the-simpleimage), and no localworker.min.jsships. Present since2.8.4:1;README.md/instructions.mdnow state the exception, and bundling it is a follow-up issue.🤖 Generated with Claude Code