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

fix: use one pdf worker for all documents and for all rerenders #762

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeetiss
Copy link
Contributor

@jeetiss jeetiss commented Apr 9, 2021

react-pdf v5.3 with file-loader creates new worker for all file's change and for all Document instances, so I create a singleton that reuse worker while rerenders and in different documents

@criskell
Copy link

criskell commented Feb 28, 2024

any progress?
what missing?

@wojtekmaj
Copy link
Owner

will this help when handling large pdf?

No. This could help with multiple instances of React PDF initialized at the same time only.

what missing?

There are two main concerns.

First - is this still even needed if file-loader is no longer recommended and instead, we pass worker URL to PDF.js?

Second - the package has been completely rewritten since so this code isn't compatible with the latest head. Although that's a minor issue, it can easily be rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants