You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Split rescript npm package into multiple subpackages #6183
1.) In #6133, the suggestion was made to provide separate npm packages for compiler binaries for each platform, add them as optional dependencies to the rescript package and leverage built-in functionality of the package manager to automatically install only the matching binaries for the current platform similar to how esbuild does it. This would yield the following packages for the compiler binaries:
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/win32-x64
This change would reduce the amount of disk space used by npm install rescript.
2.) In addition, the runtime / standard libraries could also be extracted from the main rescript package into separate packages:
@rescript/js-compat (for the existing Js namespace)
@rescript/ocaml-compat (for the existing OCaml standard library modules)
Some of these could be installed by default as dependencies of the rescript packages and others could be made optional.
The cmi/cmj caches could then be built only for the relevant installed packages on the first project build, instead of during CI build.
Advantages:
Being able to maintain some of these in separate repos and at a separate release cycle from the compiler repo.
Dependencies would always built with the projects compiler settings (uncurried true/false).
Further reducing the size of a ReScript installation when more compat packages are made optional.
Speeding up CI build by having to build and package less stuff.
Reacted by Cristiano Calcagno, Hyeseong Kim, Florian Hammerschmidt, Pedro Castro, Zheyu Zhang, woonki, Dmitry Zakharov, Paul Tsnobiladzé, Josh Vlk and Florian Verdonck
Activity
cometkim commentedon May 25, 2024
Note that this technique only works for
optionalDependenciesAnd probably wouldn't work for
binwith some package managers as they don't allow installation from transitive dependencySee https://gist.github.com/cometkim/eb2842d67b40e583e4886e9b897a6af0
cknitt commentedon May 5, 2025
Per-platform binary packages implemented in #7395 for v12.
Splitting up runtime/stdlib will be done in a future version.
cknitt commentedon Dec 4, 2025
Created a separate issue for Belt: #8050
Closing this one.