[ANN] ReScript 12 beta release / call for testing

Hello ReScripters!

We are happy to announce that we finally released the first beta of :sparkle: ReScript 12 :sparkle: .

This comes with the new build system (codename rewatch) enabled by default.

Please try it out in your projects and report any issues you find.

Installation

  1. npm create rescript-app@next
  2. Select 12.0.0-beta.1 and proceed the installation process
    (this works in existing projects as well, package.json required)

or, for purists:

npm install rescript@next

Opt-out to legacy build system

ReScript 12 still comes with the old, ninja-based build system (bsb). To use it, simply add legacy before the command.

E.g. rescript buildrescript legacy build

This can also be useful to test if something does not work anymore with the newer build system that worked fine with the older one (or vice versa).

Outlook

Please share and test as much as you can. Our new goal is to release v12 in September, but there will be release candidate versions still in July or August.

Happy hacking!

18 Likes

Happy to see v 12 is coming.
Just updated from alpha 12 to beta 1 to try it out.

  1. Unfortunatelly my lsp (1.62.0 in neovim) isn’t working anymore (I think in alpha 13 or 14 I had the same problem). Do I need to use v 1.63.0-next…?
  2. Rewatch doesn’t show warnings. Warnings like missing switch cases etc. Already created an issue some time ago (Log warnings · Issue #163 · rescript-lang/rewatch · GitHub).
2 Likes

Hi, where is the best place to report issues ?

I just tried npm create rescript-app@next using the Vite template and rescript version 12.0.0-beta.1.

  • in package.json there is "res:dev": "rescript -w" which I think should be "res:dev": "rescript watch".

  • when compiling, it complains about Syntax Error when parsing |>

I get the same issues when trying the Next and Basic templates.

in package.json there is "res:dev": "rescript -w" which I think should be "res:dev": "rescript watch".

Just opened a PR this morning (feat: changed watch script in package.json when using rewatch by dkirchhof · Pull Request #93 · rescript-lang/create-rescript-app · GitHub).

  • when compiling, it complains about Syntax Error when parsing |>

The “pipe last” operator was deprecated for a long time and was finally removed (in alpha 14).

2 Likes

Well, rewatch logs warnings. Was an issue while migrating an “old” project. For the other issue, I will try the beta lsp version later on.

1 Like

It’s certainly not the last beta.

Thank you all for testing and fixing stuff, we are getting closer every day.

2 Likes

I can see @rescript/react version 0.13.1 fixes the “pipe last” problem.

When using rescript 12, the dependency should be upgraded from 0.13.0 to 0.13.1 at https://github.com/rescript-lang/create-rescript-app/blob/master/templates/rescript-template-nextjs/package.json#L7 and create-rescript-app/templates/rescript-template-vite/package.json at master · rescript-lang/create-rescript-app · GitHub shouldn’t it ?

1 Like

I’m running beta1 in a production system that runs 24/7 with high-performance parts, lots of system calls, approx 12k lines of code. It’s great and feels like an rc, and has felt like an rc even since it was in alpha.

The one thing that needs to stabilize are certain apis (e.g., rescript-vitest-plugin is broken now because of rewatch).

Also finally, I can’t give this community a big enough thanks. NOTHING comes close to rescript in terms of dx for me in the js universe. my main gripes with rescript: 1) lacking early return 2) some stdlib apis are somewhwt lacking, could be more complete and 3) i don’t like camel case, would prefe rsnake case throughout but yeah, this is a reasonable choice given js universe…

thanks to all of the team and community for having created this absolutely fantastic language/compiler/etc which is ultimately the only sane way to write node apps today. (ok sometimes i have to revert to typescript because i can’t do type magic in rescript which is sometimes helpful, type unions and whatnot)

5 Likes

Language Server v 1.63.0-next does its job :slight_smile:

2 Likes

I’ve been glad to early.
The language server (v 1.63.0-next-e18a3cd.0) doesn’t refresh errors in my code.
When I have an error (neovim shows the error correctly) and I fix it, it still shows me the error (s screenshot).
I have to restart the server or neovim to update the state.
Maybe someone with VSCode or some other IDE can try it out :pray:.

Edit: Same with rescript legacy build -w.

Edit2: Probably the removal of chokidar causes the issue?! So I have to change my neovim config somehow to recognize file changes.

Edit 3: Just for the sake of completeness:
Added the following capabilities to my lsp config and now file changes will be tracked.

capabilities = {
    workspace = {
        didChangeWatchedFiles = {
            dynamicRegistration = true,
        },
    },
}
1 Like

Is that problem already tracked somewhere?
If not, can you provide a sample to reproduce?
We’ve been making some Rewatch fixes this week.

Does Edit 3 fix the problem?

When I removed chokidar, I did do a quick google if neovim is capable of watching files, and the internet said so.

We can add that snippet to the docs if that fixes it.

Yes, edit 3 fixes the problem :slight_smile: Everything looks fine now.

The snippet should also be included in the lsp-config repo of neovim. Maybe I will create a pr there.
Where would you add the snippet? In the docs of the language server? Does VSCode handle it automatically?

Yes, with VS Code you have this out of the box.

I don’t know what the best location is to add the snippet. I suppose it is where neovim users would find some info. I didn’t find anything on the rescript org side.

yeah, just using vite-plugin-rescript (sorry, i misnamed it previously) gives this:

[@jihchi/vite-plugin-rescript] error: unexpected argument '-w' found

  tip: to pass '-w' as a value, use '-- -w'

Usage: rescript.exe build [OPTIONS] [FOLDER]

For more information, try '--help'.
ExecaError: Command failed with exit code 2: rescript build -with-deps -w

error: unexpected argument '-w' found

  tip: to pass '-w' as a value, use '-- -w'

Usage: rescript.exe build [OPTIONS] [FOLDER]

For more information, try '--help'.
1 Like