Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pdfjs-dist from 2.0.161 to 4.6.82 #1098

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 2, 2024

Bumps pdfjs-dist from 2.0.161 to 4.6.82.

Release notes

Sourced from pdfjs-dist's releases.

v4.6.82

This release contains improvements for the annotation editor, font rendering, form rendering, performance, text selection and the viewer.

Changes since v4.5.136

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [pdfjs-dist](https://github.com/mozilla/pdf.js) from 2.0.161 to 4.6.82.
- [Release notes](https://github.com/mozilla/pdf.js/releases)
- [Commits](https://github.com/mozilla/pdf.js/commits/v4.6.82)

---
updated-dependencies:
- dependency-name: pdfjs-dist
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 2, 2024
Copy link

vercel bot commented Sep 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
universalviewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 2, 2024 0:16am

@Saira-A Saira-A merged commit c4dcbf7 into dev Sep 2, 2024
3 checks passed
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/dev/pdfjs-dist-4.6.82 branch September 2, 2024 12:00
@demiankatz
Copy link
Contributor

@Saira-A, I think it's potentially misleading to merge this PR -- I think we should probably make some further revisions on top of what was done here.

When UV was converted to use WebPack, @edsilv was unable to get PDF.js to work in a WebPack build, and since that time, the PDF.js included via NPM has not been used. Instead, the library is loaded from a CDN through a hard-coded URL here:

// use pdfjs cdn, it just isn't working with webpack
if (!this._pdfjsLib) {
await loadScripts([
"//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js",
]);
this._pdfjsLib = window["pdfjs-dist/build/pdf"];
this._pdfjsLib.GlobalWorkerOptions.workerSrc =
"//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js";
} else {
this._$progress[0].setAttribute("value", "0");
this._$progress.show();
this._$canvas.hide();
}

As you can see, that's currently using v3.11.174, which doesn't match either of the versions mentioned by this PR.

I think there are a few things we could possibly do:

1.) Figure out a way to solve the Webpack problem, so UV actually uses the PDF.js version advertised in package.json. This would obviously be the ideal solution, but I don't have the expertise necessary to tackle it. My library doesn't even use PDF.js (we prefer PDFObject, because we've found PDF.js to be unstable for many of the PDFs in our collection), so I can't really justify investing time and effort into learning how to fix it.

2.) We could remove pdf.js from package.json entirely. This might be the most honest solution, but it also kind of masks that a potential problem exists.

3.) We could synchronize the versions between package.json and the hard-coded CDN URL so we're at least reporting the right version. My understanding is that the PDF.js integration is somewhat fragile, so I'm not sure whether upgrading from major version 3 to major version 4 will even work -- but it could be tried, and if it fails, we could roll back the number in package.json.

What do you think?

@Saira-A
Copy link
Contributor

Saira-A commented Sep 2, 2024

I agree that the first option sounds the best, but I don't know if were were using PDF.js either. I'll revert this back to how it was for now

@demiankatz
Copy link
Contributor

Thanks, @Saira-A. Does your collection include PDFs? If so, you are probably using PDF.js unless you have specifically switched it off through configuration.

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 javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants