[ANN] ReScript 9.0.1 is released (bug fix release)

Hi all,
This is a bug fix release for 9.0. @rescript/std is also scheduled a release for 9.0.1.
Following the feedback from release 9.0, we did some research and make some changes to make both NodeJS and React Native users happy.

The standard library is still shipped with .js instead of .mjs extesion, but it is added with a separate package.json to annotate that it is es6 modules, so Node can resolve it happily. For NodeJS es6 module users, you don’t need transpiling. Hopefully this should not break ReactNative metro bundle users.

Happy Lunar New Year – Hongbo


@Hongbo: Thanks for fixing this so quickly. I hope you had (or are having) a great lunar NY break.

1 Like

Cool, I’ll give it a go next week and let you know if this works for me!

if my setup supports .mjs should I use them?
Is it now a manual opt-in in the config?

I’m seeing this from v9 to v9.0.1

my bsconfig

  "package-specs": [
      "module": "es6",
      "in-source": true

v8 -> v9.0.0
We changed the suffix of es6 inside stdlib from .js into .mjs, so that Node can run it natively without transpiling, this turns out to break some existing tooling.
v9.0.0 -> v9.0.1
We reverted such changes, and found another solution (by adding lib/es6/package.json with module : type) to make it run natively under Node without transpiling, so we achieved our goal without breaking existing toolings.
In that case, v9.0.0 is a temporary release (deprecated using npm deprecate)

So for the js suffix inside bs-platform, we will stick the .js extension for a while until most tools in the js community is ready.

About the suffix on user land, it is up to your preference. Personally, I like .mjs which is explicit while .js you have to do some random guess or look up external files


This change still allows me to use my .mjs files with ES6 nodes tooling, so I’m happy!

1 Like