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

Update pako dependency to version ^2.0.2 for better tree shaking #24

Open
andreaslarssen opened this issue May 23, 2023 · 10 comments
Open
Labels
help wanted Extra attention is needed

Comments

@andreaslarssen
Copy link

Describe your idea

From Hopding#689:

Angular11 generates warnings for pdf-lib because of the old module format of pako

Warning: C:\Users*****\node_modules\pdf-lib\es\core\PDFContext.js depends on 'pako'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: C:\Users*****\node_modules@pdf-lib\upng\UPNG.js depends on 'pako'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Recently pako switched with version 2.0.0 to es6. Would it be possible to update the dependency?
Thank you!

How could this be implemented?

See above

What problem are you trying to solve?

See above

Why does this matter to you?

Optimization bailouts, and prevents us from upgrading to Angular 16 (?)

Would others find this helpful?

Yes

Are you interested in implementing your proposal?

No

Why are you submitting a proposal?

To keep the lib alive

Additional Notes

No response

@Sharcoux
Copy link
Collaborator

Hey there!

We can do that, but pdf-lib relies on:

  • "@pdf-lib/standard-fonts": "^1.0.0",
  • "@pdf-lib/upng": "^1.0.1",

Both of them rely on pako 1...

@andreaslarssen
Copy link
Author

Right... and both Hopding/standard-fonts#2 and Hopding/upng#1 are dead in the water...

How about forking the dependencies as well?

@Sharcoux
Copy link
Collaborator

Ok, let's do that:

  • upng is a forked from photopea /
    UPNG.js which, apparently, is still active. We can try to switch to that lib. Can you open a PR there to include the index.d.ts file from Hopding lib in the project and in the package.json?
  • standard-fonts seems dead in both the original and Hopding trees. Can you fork it and try to release it? We can switch to your tree

@andreaslarssen
Copy link
Author

andreaslarssen commented May 23, 2023

I'm currently working for a client that uses this package, so I would have to ask them about spending my time on the upng-package. As for the standard-fonts package, I would not be able to maintain this over time, so it seems like a bad idea for me to fork it. Maybe someone who's more invested in the package could do it?

@Sharcoux
Copy link
Collaborator

Would your client be able to maintain it?

@andreaslarssen
Copy link
Author

I really doubt that's going to happen

@DineshSolanki
Copy link

I just published a standard-fonts package with updated dependency, mind trying it out
https://www.npmjs.com/package/@dineshsolanki/standard-fonts

@Sharcoux
Copy link
Collaborator

@andreaslarssen @DineshSolanki Can someone open a PR on UPNG.js to upgrade pako, or at least open an issue explaining the problem? This way we don't need to open and maintain yet another fork.

@Sharcoux Sharcoux added help wanted Extra attention is needed and removed needs-triage labels Feb 3, 2024
@Sharcoux Sharcoux mentioned this issue Dec 3, 2024
2 tasks
@sameer-roofr
Copy link

@andreaslarssen @DineshSolanki Can someone open a PR on UPNG.js to upgrade pako, or at least open an issue explaining the problem? This way we don't need to open and maintain yet another fork.

Will this PR solve it?

@Sharcoux
Copy link
Collaborator

Sharcoux commented Jan 17, 2025

I don't know. We need pako 2 I believe, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants