Hi all,
Based on the user feedback, there are two long standing issues that we want to address:
The problem comes from the fact that the compiler package called bs-platform
is quite large, it cost your disk space and used to take a while to install. If you want to provide your library to regular js users, such dependency is transitive, so your consumer has to install such a large package.
Why the compiler package is so large? It contains a native ocaml compiler, prebuilt compilers for 3 main platform, the js files alone is tiny. (We may add more like IDE binaries in the future)
After we solved the installation time (it now only takes 1 or 2 seconds to install), this issue is mitigated and not a problem any more for learning purpose. However, it still cost a lot of disk space even for casual users.
We want to address such issue, I am proposing a way to allow to customize runtime js library and we are going to release a std package which only contain js files, it is opt-in, so it should not break any existing packages.
Suppose you want to choose such light-weight runtime, in the main
package, bsconfig.json
"runtime" : "rescript-std"
The generated js files would be something like:
var Pervasives = require("rescript-std/lib/js/pervasives.js");
Note the name is not decided yet, so the compiler package is just a dev dependency under such settings, it is no longer transitive.
Caveats:
- It’s the user’s responsibility to make sure the std version match the compiler version, we may add such check during the runtime
Feedback is welcome!