-
Notifications
You must be signed in to change notification settings - Fork 465
Suggestion: separate packages for prebuilt binaries. #6133
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
Comments
CC @cknitt |
@cometkim Interesting, did not know about this. Thanks for the suggestion! (Note that even though ReScript 11 has prebuilt binaries for more platforms than ReScript 10.1, the package size is still a lot smaller - 29.2 MB vs. 47.1 MB.) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this as it duplicates #6183 |
The
rescript
package provides prebuilt binaries for major platforms.Not relying on the postinstall hook is good, but it significantly increases package installation time. An additional 20-30MB of bandwidth per platform is required for it.
Installing binaries for not matched platforms is obviously unnecessary work, so users can skip close to 100MB of downloading by omitting 4 out of 5 supported platforms.
Thankfully Yarn & pnpm support feature for this (I'm not sure npm also does). They can skip installation if the
os
andcpu
entries specified in thepackage.json
do not match (and this behavior can be customized)Packages using prebuilt bins like esbuild provide it separately in the form of
@esbuild/{os}-{cpu}
for this purpose.So
@esbuild/linux-x64
'spackage.json
:And
esbuild
's:It is specified as
optionalDependencies
because it can be omitted depending on the environment.As the result, when I run
yarn add esbuild
on my env, I can see yarn only install@esbuild/linux-x64
additionallyThe downside of this approach is that it makes the release workflow more complex.
The text was updated successfully, but these errors were encountered: