-
-
Notifications
You must be signed in to change notification settings - Fork 898
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
Upgrade pdfjs-dist to 2.4.456 #550
Conversation
This updates to the latest version of pdfjs-dist. The previous versions had a bug that caused cross site loading issues for some webpack builds.
With the newer version of pdfjs-dist, using the default EventBus has been deprectated. This sends in our own eventBus to manage the event messages.
I'm still working on getting the build/test going, but wanted to put this out there to start the work/collaboration on this |
The ES6 version requires support of ReadableStream causing issues. Rather than using a polyfill or mocking this, we should just assume that it has been compiled to a working syntax, which for the tests is ES5.
The updated pdfjs-dist library added an unscore to the location of the pageIndex. This happens in real time, but since we are mocking it in the tests, we need to make sure to mock it correctly.
I haven't tested all the different usages, but the ones I have tested, this works 👍. |
5c4504d
to
c582df6
Compare
This is done to match the need to manually set the eventBus on a LinkService
c582df6
to
62e83e3
Compare
Hi, |
Hi! 2.4.456 is marked as stable, so I'm gonna go ahead and upgrade pdfjs-dist. Two questions:
|
@wojtekmaj Great news! To answer your questions:
|
Thanks for your answers! It seems like indeed the ES6 version of pdfjs-dist does not use ReadableStream anymore. It used to work fine. So, we can't use ES6 version by default just yet, because it's a breaking change. Not something you would expect when jumping from 2.3 to 24, but Mozilla can't really use semver, unfortunately. Based on the insight you kindly shared, I've decided to raise another PR upgrading pdfjs-dist to 2.4.456, but keeping ES5 version for ALL entry files to avoid potential compatibility issues. I added you as a co-author there - hope you don't mind me crediting you this way. |
#280
Due to issues caused with cross site loading of the pdf service worker, it is needed for us to upgrade the version of the
pdfjs-dist
package.There was one deprecation that was raised in this upgrade that is addressed regarding the EventBus. The default global event bus was deprecated, so you have to manually manage it.