chore(deps): bump pdfjs-dist to 6.0.227#1666
Merged
Merged
Conversation
pdfjs-dist 4.x declared canvas in dependencies, which forced npm consumers to compile native bindings via node-pre-gyp. That fails on Apple Silicon Macs and CI agents without Python and a C++ toolchain, blocking installation of this package by downstream consumers. pdfjs-dist 5.x and later moved canvas to optionalDependencies, so install no longer attempts the native build. Bump to 6.0.227 (latest) and bump the engines.node minimum to match pdfjs's requirement. The full doc viewer test suite (631 tests) passes against the new version with no source changes — the API surfaces we use (getDocument, PDFViewer, PDFLinkService, PDFFindController, EventBus, GlobalWorkerOptions) are unchanged across the v4 → v6 jump. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
jackiejou
approved these changes
Jun 3, 2026
This was referenced Jul 6, 2026
mrscobbler
added a commit
that referenced
this pull request
Jul 9, 2026
Revert the pdfjs-dist 6.0.227 bump (#1666) while v6 regressions are investigated. Restores engines.node >=20.0.0 (the bump only existed to satisfy pdfjs 6) and removes the annotationLayer z-index workaround from #1694, which compensated for v6's earlier page-layer insertion and is unnecessary on v4. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Sophia <1317004+mrscobbler@users.noreply.github.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.
Summary
Bumps
pdfjs-distfrom4.3.136to6.0.227(latest) and bumps the package'sengines.nodeminimum to>=22.13.0to match pdfjs's requirement.Why
pdfjs-dist@4.xdeclarescanvasindependencies, which forces npm consumers (any downstream that installs this package) to compile native bindings vianode-pre-gyp. That fails on Apple Silicon Macs and CI agents without Python and a C++ toolchain, blocking installation by downstream consumers entirely.pdfjs-dist@5.xand later movedcanvastooptionalDependencies, so install no longer attempts the native build. Bumping to the latest 6.x cleanly fixes this.What's verified
yarn installsucceeds without invoking node-pre-gyp / canvas native buildyarn build:libsucceedsuseNpmPdfjs=true): PDF rendered correctly,window.pdfjsLib.versionreports 6.xThe pdfjs API surfaces we use (
getDocument,PDFViewer,PDFLinkService,PDFFindController,EventBus,GlobalWorkerOptions) are unchanged across the 4.x → 6.x breaking-change list. The api-major changes in 5.x/6.x affect editor functionality andgetDocumentno-args calling, neither of which we touch.Test plan
yarn installfrom a clean checkoutyarn build:libyarn test src/lib/viewers/doc/useNpmPdfjs=true🤖 Generated with Claude Code