Update dependency pdfjs-dist to v6#10034
Conversation
Greptile SummaryThis PR bumps
Confidence Score: 5/5Safe to merge — the package bump and all pre-built viewer assets are in sync, the documented update-viewer script was run, and Trilium's own code communicates with the viewer exclusively via postMessage so no direct pdfjs API calls are affected. The PR is a well-formed, complete dependency update: the npm version, pnpm lock file, viewer bundle JS/CSS/HTML, source map, and locale files are all regenerated together. Trilium's client code doesn't call the removed pdfjs APIs directly — all interaction goes through iframe postMessage. No files require special attention. Important Files Changed
|
| }, | ||
| "devDependencies": { | ||
| "pdfjs-dist": "5.7.284" | ||
| "pdfjs-dist": "6.0.227" |
There was a problem hiding this comment.
Viewer bundle files not updated after version bump
This PR updates the pdfjs-dist npm package version, but the viewer/viewer.mjs, viewer/viewer.html, viewer/viewer.css, locale files, images, and wasm assets in packages/pdfjs-viewer/viewer/ are still from v5.7.284. The repository's documented PDF.js update process (CLAUDE.md → Updating PDF.js) requires running npx tsx scripts/update-viewer.ts from the packages/pdfjs-viewer directory, then pnpm build, and committing the updated viewer files. Without this, the bundled viewer served to browsers is v5 while the TypeScript sources (and their typings) are compiled against the v6 API — including breaking [api-major] changes such as the removal of PDFDocumentProxy.prototype.destroy and the altered getDocument signature.
Bundle ReportChanges will increase total bundle size by 6.32MB (7.55%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: client-esmAssets Changed:
|
63b55a8 to
25be16e
Compare
Renovate bumped the pdfjs-dist devDependency to 6.0.227 but cannot
regenerate the vendored viewer. Ran scripts/update-viewer.ts to refresh
web/viewer.{html,css,mjs} and locale files for v6.
The v6 viewer.html now ships a Content-Security-Policy. Verified it is
compatible with Trilium's customizations: injected <style> elements are
allowed via style-src-elem 'unsafe-inline', custom.{css,mjs} load under
script-src/style-src-elem 'self', and our code uses CSSOM (not blocked
inline style attributes). No client code uses the removed raw APIs
(getDocument param-less, PDFDocumentProxy.destroy).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This PR contains the following updates:
5.7.284→6.0.227Release Notes
mozilla/pdf.js (pdfjs-dist)
v6.0.227Compare Source
PDF.js 6.0 is a major release that contains a number of API changes, features and bugfixes.
The complete list of changes in this release is shown below. If you're upgrading to PDF.js 6.0 we recommend checking the changes prefixed with
[api-minor]and[api-major]since those might require updates to your code.Changes since v5.7.284
pdfjs.configby @timvandermeij in #21177Catalog.prototype.getPageIndexto an asynchronous method by @Snuffleupagus in #211811942304) by @calixteman in #211752035551) by @calixteman in #21187readBlockmethod in theDecodeStreamclass by @Snuffleupagus in #21190unittestclicoverage collection toci.ymlby @timvandermeij in #21191PDFFindController.prototype.#extractTextmethod by @Snuffleupagus in #21197nextChunkhandling in theDecryptStreamclass by @Snuffleupagus in #21198Intersectorconstructor by @Snuffleupagus in #21200pdfBug: trueflag in the image caching unit test by @timvandermeij in #212032035530) by @calixteman in #211966.0by @Snuffleupagus in #21209JpxStreamby @Snuffleupagus in #21211CompilerOutput.prototype.finalDatagetter, and a few other font improvements (PR 21053 follow-up) by @Snuffleupagus in #21214TypedArray.prototype.set()in thecompileFDSelectmethod by @Snuffleupagus in #21215rawfield from theCFFCharsetclass by @Snuffleupagus in #21216TrueTypeTableBuilderandCompilerOutputwith a single class by @Snuffleupagus in #21220WasmImageclass, thatJBig2CCITTFaxImageandJpxImageinherit from by @Snuffleupagus in #21225getPdfFilenameFromUrlhelper by @Snuffleupagus in #21222external/folder in the coverage report forgulp unittestcliby @Snuffleupagus in #21226WasmImageimplementation a little bit (PR 21225 follow-up) by @Snuffleupagus in #212292034827) by @calixteman in #212232027682) by @calixteman in #212282033095) by @calixteman in #21235PDFDataRangeTransportstreaming unit-tests faster by @Snuffleupagus in #21238Uint8Array.fromHexintest/unit/crypto_spec.jsby @Snuffleupagus in #21246getDocumentwithout a parameter object, and remove thePDFDocumentProxy.prototype.destroymethod by @Snuffleupagus in #21245filenameunconditionally, when passing binary data toPDFViewerApplication.openby @Snuffleupagus in #21249getModificationDatehelper function intosrc/core/core_utils.jsby @Snuffleupagus in #21258deepComparehelper function to handleRefs andNames correctly by @Snuffleupagus in #21257a11yAlertby @Snuffleupagus in #21263pdf.worker.mjsfile by @Snuffleupagus in #21269stringToPDFStringhelper function to the worker-thread by @Snuffleupagus in #21279Util.domMatrixToTransformmethod by @Snuffleupagus in #21281getXfaPageViewporthelper into theXfaLayerclass by @Snuffleupagus in #21283SVG_NSdefinition intosrc/shared/util.jsby @Snuffleupagus in #21284ColorConvertersunit-tests by @Snuffleupagus in #21286Outline._normalizePagePointmethod by @Snuffleupagus in #21287PDFDocumentPropertiesdialog by @Snuffleupagus in #21289contentLengthavailable in thePDFDocumentPropertiesdialog by @Snuffleupagus in #21291must check that an existing highlight is ignored on hoveringintegration test on Windows by @timvandermeij in #212881960363) by @calixteman in #21261Util.scaleMinMaxhelper intosrc/display/canvas_dependency_tracker.jsby @Snuffleupagus in #21294PDFDocumentPropertiesdialog by @Snuffleupagus in #212951879559) by @wooorm in #20981EventBusmethods in the integration-tests by @Snuffleupagus in #21305getPdfFilenameFromUrlhelper function by @Snuffleupagus in #21311PdfTextExtractorclass by @Snuffleupagus in #21304fontFilelookup a tiny bit by @Snuffleupagus in #21322XfaLayerBuilder.prototype.rendermethod by @Snuffleupagus in #21317Uint8Array.fromBase64in thetest/integration/highlight_editor_spec.mjsfile by @Snuffleupagus in #21323src/display/canvas_dependency_tracker.jsby @Snuffleupagus in #21324XRefWrapperimplementation, in thesrc/core/editor/pdf_editor.jsfile by @Snuffleupagus in #21319external/builder/folder is changed by @Snuffleupagus in #213402032967) by @calixteman in #213342036265) by @calixteman in #21308test.mjsby @timvandermeij in #21357Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.