[ANN] ReScript v10 released

Hey everyone,

We are pleased to announce that ReScript v10 is now live and ready to install via npm:

npm install rescript@10

(Please note that rescript@latest will be set to v10 in a few days)

The release blog post with all important highlights can be found here. The full list of changes (including breaking ones) can be found in our Changelog. The ReScript Playground is now using v10 by default as well.

Besides the changes on the software itself, we made some great progress behind the scenes:

  • Way improved OCaml development experience within the compiler project (dune / modern OCaml versions for development)
  • Repositories / READMEs got cleaned up and lots of stale information removed.
  • Most releases are now CI-automated.
  • Important (but detached) compiler changes such as the ReScript playground are now upstreamed to the compiler.
  • More community members got access to our infrastructure (GitHub, npm) to help us maintain all the different projects and repositories.

This is huge! A big thanks to everyone involved to help us make the release cycle way more efficient.

As this is a major release, there are quite a few breaking changes, but we made sure that those changes are no show-stoppers for 95% of our ReScript users.

Check out the Changelog for proposed migration paths and let us know if there’s anything missing when migrating your project to v10.

We hope you enjoy the new improvements as much as we do. Feel free to send us feedback and report your bugs / issues on our bug trackers.

Happy hacking!

43 Likes

Woo! How exciting :tada::tada:

Doc comments /** ... */ are now supported.

When talking about Doc comments, what exactly does that mean? Does that mean intellisense will pick it up when you hover over a function?

Yeah. In previous versions /** */ had no special semantic meaning. In v10, the parser will interpret those comments as doc headers which allows the editor to show its text on hover.

7 Likes

this thing is getting pretty nice

2 Likes

Hi

We are facing an compilation issue on windows 10 with rescript@10, we are not facing it with rescript@9.1.4

Error: EPERM: operation not permitted, open 'C:\projects\frontend\js\.bsb.lock'
at Object.openSync (node:fs:585:3)
at acquireBuild (C:\projects\frontend\js\node_modules\rescript\rescript:207:10)
at build (C:\projects\frontend\js\node_modules\rescript\rescript:516:11)
at in_watch_mode (C:\projects\frontend\js\node_modules\rescript\rescript:587:5)
at ChildProcess.<anonymous> (C:\projects\frontend\js\node_modules\rescript\rescript:317:9)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
errno: -4048,
syscall: 'open',
code: 'EPERM',
path: 'C:\\projects\\frontend\\js\\.bsb.lock'
}

Looks like there is an issue already in github https://github.com/rescript-lang/rescript-compiler/issues/5617

I am on Windows 10 and on upgrade to rescript@10 I observed the same issue with “rescript build -w”
but not with either “rescript build” or “rescript build -with-deps”. Seems like this problem is limited to the watch mode.

1 Like

Same error with me on Windows10 when running yarn rescript build -w.

I opened an issue about this build error. here
Just closing the lock file after opening it, the build process works normally.
This error already existed a long time, hoping our team will fix it soon.

From:

function acquireBuild() {
  if (is_building) {
    return false;
  } else {
    try {
      fs.openSync(lockFileName, "wx", 0o664);
      is_building = true;
    } catch (err) {
      if (err.code === "EEXIST") {
        console.warn(lockFileName, "already exists, try later");
      } else console.log(err);
    }
    return is_building;
  }
}

To:

function acquireBuild() {
  if (is_building) {
    return false;
  } else {
    try {
      const fid = fs.openSync(lockFileName, "wx", 0o664);
      fs.closeSync(fid);
      is_building = true;
    } catch (err) {
      if (err.code === "EEXIST") {
        console.warn(lockFileName, "already exists, try later");
      } else console.log(err);
    }
    return is_building;
  }
}

image

3 Likes

For Windows users: try release 10.0.1 with the fix.

6 Likes

This version works fine on Windows.:+1::+1::+1:
image

4 Likes

10.0.1 Works on windows!

In v10, the parser will interpret those comments as doc headers which allows the editor to show its text on hover.

Hmm is there a certain way it should be formatted? Tried a couple different ways and am not getting anything (windows)

docs-jsdoc
docs-ocaml

this is one of the features I’m most excited about

Support for doc-comments in the extension is not released yet.

2 Likes

Is there a way to inspect the new AST?

1 Like