node-poppler icon indicating copy to clipboard operation
node-poppler copied to clipboard

Put windows poppler binaries in a separate package

Open dumbasPL opened this issue 3 years ago • 6 comments

Prerequisites

  • [X] I have written a descriptive title
  • [X] I have searched existing feature requests to ensure it has not already been proposed
  • [X] I agree to follow the Code of Conduct that this project adheres to

Description

Hello, I've noticed that this package bundles all the windows binaries regardless of what platform it's being installed on.

I suggest putting all the windows binaries into a separate package and adding

  "os": [
    "win32"
  ]

to that packages package.json.

You can then include that package using optionalDependencies which will only install the package if we are on windows and ignore it on any other platform.

Doing this will remove over 99% of the unpacked package size.

Having to include almost 50MB of unused files in a docker image is not great (especially since you need to install the Linux binaries on top of that anyway).

Also might as well include

  "cpu": [
    "x64",
  ]

while you're at it since the binaries won't work on x86 or arm builds of windows.

dumbasPL avatar Feb 09 '22 13:02 dumbasPL

Thanks @dumbasPL, I had considered just having a duplicate separate package without the windows binaries, however had never thought about using an optionalDependency!

I'll take a look (though I won't be able to until next week).

Fdawgs avatar Feb 09 '22 13:02 Fdawgs

Any progress on this?

dumbasPL avatar Mar 29 '22 13:03 dumbasPL

Hiya, unfortunately not, been a bit swamped with other projects.

Fdawgs avatar Apr 03 '22 11:04 Fdawgs

Hi, I've noticed you added the help wanted label. What kind of help is needed?

Essentially things that need to be done are:

  • [ ] Create a new npm package with "os":["win32"] and "cpu":["x64"] that only contains the windows binaries
  • [ ] (optional) create any additional packages with binaries for other operating systems/architectures
  • [ ] Remove binaries from this package
  • [ ] add the new package(s) as optionalDependencies in the current package
  • [ ] Update paths to search for binaries in the new location

dumbasPL avatar Dec 25 '22 18:12 dumbasPL

Thanks @dumbasPL, yes I put the tag on because I was struggling to find the time to sort this.

Should hopefully be able to sort it some time this year!

Fdawgs avatar Jan 31 '23 17:01 Fdawgs