chore(deps): update to latest — pdf.js 6, rtf.js 3, vite 8, dejaview

- pdfjs-dist 4.10 -> 6.0.227. v6 removed PDFDocumentProxy.destroy(); destroy the
  loading task instead (load / extractText / destroy). render() API is unchanged.
- rtf.js 2.3 -> 3.0.9 (npm) and refreshed public/rtfjs/*.bundle.min.js — the
  bundles the renderer loads at runtime (window.RTFJS), not the npm import.
- vite 6.4 -> 8.1 (now Rolldown-based); build config unchanged.
- dejaview pinned to the latest commit (worker open/render/text protocol intact).
- foliate-js, xlsx (SheetJS 0.20.3) and every other dep were already at latest.

Verified: app + embed build; PDF compare (pdf.js 6 text layer), RTF render
(rtf.js 3 bundles), and markdown compare all work. PDF/DjVu *canvas* rendering
can't be exercised in the headless preview — confirm document viewing in a real
browser.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 23:54:13 +02:00
co-authored by Claude Opus 4.8
parent e1ea9e4385
commit fddc552d49
6 changed files with 600 additions and 844 deletions
+584 -832
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -14,7 +14,7 @@
},
"dependencies": {
"chart.js": "^4.5.1",
"dejaview": "github:Alpaq92/dejaview#5a4ef8a81c5efb8942ae8f11a61172bd91a908ff",
"dejaview": "github:Alpaq92/dejaview#4eb5b581464f4814835c7ad55a2d511cca20b40b",
"diff": "^9.0.0",
"exifr": "^7.1.3",
"foliate-js": "github:johnfactotum/foliate-js#78914aef4466eb960965702401634c2cb348e9b1",
@@ -24,13 +24,13 @@
"mammoth": "^1.8.0",
"marked": "^18.0.5",
"papaparse": "^5.5.4",
"pdfjs-dist": "^4.9.155",
"pdfjs-dist": "^6.0.227",
"pptxviewjs": "^1.1.9",
"rtf.js": "^2.2.0",
"rtf.js": "^3.0.9",
"utif": "^3.1.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
},
"devDependencies": {
"vite": "^6.0.7"
"vite": "^8.1.0"
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -5
View File
@@ -10,6 +10,7 @@ export class PDFRenderer extends BaseRenderer {
constructor() {
super()
this.pdfDoc = null
this._task = null
this._pageW = 0
this._pageH = 0
this._observer = null
@@ -19,8 +20,8 @@ export class PDFRenderer extends BaseRenderer {
async load(buffer, container, viewer) {
await super.load(buffer, container, viewer)
const task = pdfjsLib.getDocument({ data: new Uint8Array(buffer) })
this.pdfDoc = await task.promise
this._task = pdfjsLib.getDocument({ data: new Uint8Array(buffer) })
this.pdfDoc = await this._task.promise
this.numPages = this.pdfDoc.numPages
const first = await this.pdfDoc.getPage(1)
@@ -177,7 +178,8 @@ export class PDFRenderer extends BaseRenderer {
// Returns the document text with a form-feed (\f) between pages, so the
// compare view can diff page-by-page.
async extractText(buffer) {
const doc = await pdfjsLib.getDocument({ data: new Uint8Array(buffer) }).promise
const task = pdfjsLib.getDocument({ data: new Uint8Array(buffer) })
const doc = await task.promise
const pages = []
try {
for (let p = 1; p <= doc.numPages; p++) {
@@ -195,15 +197,16 @@ export class PDFRenderer extends BaseRenderer {
pages.push(lines.join('\n'))
}
} finally {
doc.destroy()
await task.destroy() // pdf.js 6: destroy the loading task, not the document proxy
}
return pages.join('\f')
}
destroy() {
this._observer?.disconnect()
this.pdfDoc?.destroy()
this._task?.destroy() // pdf.js 6: destroy the loading task, not the document proxy
this.pdfDoc = null
this._task = null
super.destroy()
}
}