@rescript/std size

Browsing through the public repos and found GitHub - rescript-lang/std: Light weight runtime for ReScript It claims to be light weight, and it probably is, but there are no specifics about what “light” might be. I tried using bundlephobia to see what it might be but am getting an error: @rescript/std | BundlePhobia

It’s the exact same JavaScript that’s included with the compiler. It’s “light” because it doesn’t come with the compiler itself. The rescript package is about 200MB, but @rescript/std is about 2MB.

This is useful for distributing packages built with ReScript and that don’t want to pull in a 200MB dependency. Otherwise, you’ll likely never need to use it. Here is the docs page about it.

1 Like

Thanks for the reply. 2MB is certainly lighter than 200MB. I’ll see what it looks like after passing it through esbuild for my apps.

Here are two demos I made in case you are interested
bobzhang/rescript-react-demo: A demo to show ReScript with React under 1K (github.com)

bobzhang/zero-cost-rescript: A demo project showing close to zero cost when adopting ReScript since version 9 (github.com)


Note that if you’re comparing the bundled output of the rescript stdlib with @rescript/std, then they should be exactly the same. @rescript/std is all of the same JavaScript files that are already included in rescript.