[ANN] ReScript 10 - First Alpha Release

No, it wasn’t correct before. There’s a scenario that requires the contents of the array to be optional.

2 Likes

Isn’t it actually the missing @obj decorator? On an object constructor function like this, what would the name in double-quotes be anyway? It doesn’t bind to any actual JavaScript function.

Yes that’s the bug, which I’ve already released a patch to fix, but the error is caused by the empty string external :slight_smile:

This patch? Added missing @obj to http2 settings object API. This API was broken,… · TheSpyder/rescript-nodejs@7321ede · GitHub

There could be issues with rescript-relay . See #5493.

There’s really an issue with rescript-relay

Yes it’s in the release notes.
Would you contribute the smallest repro in an issue. That will help speed up resolution.

1 Like

There’s an example project in the rescript-relay repo. I’ve cloned it, installed rescript@next and got the error.

1 Like

Build failed on windows10

It turns out that because of using comment caused this error.
image
After removing it and build again, it failed with another error:
image

This is now fixed in rescript-relay@1.0.0-beta.24.

For PPX authors experiencing the same issue (should be anyone using ppxlib), what I did to solve the issue is here: https://github.com/zth/rescript-relay/pull/372

3 Likes

Thank you for the fix!

I’m so pleased to have the V10 alpha release. It has been a while to see the release with awesome new features. Thank core team for your efforts! Cheers!

2 Likes

yes. I published it immediately as v14.2.1.

1 Like

Could anyone of our team contributors update the latest package file of ci into the npm? I’m very happy to use and feedback the bugs of the latest compiler. The current compiler version rescript@10.0.0-alpha.1 on npm failed to build rescript project on windows10.

Maybe will be worth changing attributes on the parser to start with “_”? That’s how ppxlib ignore the checks for attributes: Ignore all attributes starting with _ by jeremiedimino · Pull Request #46 · ocaml-ppx/ppxlib · GitHub

I’m aware that the point were the compatibility will break will arrive, even If I don’t like it. But I see that the problem here can be solved more elegantly and the breakage can be avoided or at least posponed.

Also note that the parse tree will change in future. So the fewer dependencies used in a ppx the better.
Without need to support multiple compiler version, the utility of those ppx libraries is also reduced.

2 Likes

Sure, that’s expected.

This small change would delay the breakage with ppxlib (meanwhile we would have time to catch up with whatever system we want to implement).

Beta is out and published on npm. Fixes the issues reported on the alpha release.

12 Likes

Hi! Pretty excited for the new version of ReScript… :slight_smile:

I tested the latest beta on my pretty large codebase and I found 2 issues:

  1. Regular expressions

UPDATE: I just found the explanation in the changelog: Regular expressions don’t need escaping

Valid regular expressions not recognized as valid:

// full regex taken from: https://mathiasbynens.be/demo/url-regex
let fullURLRegex = %re("/^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$/i")

let simpleURLRegex = %re("/^(https?|ftp):\\/\\/\\w+\\.([^\\s\\,]+\\.)*[^\\s\\.\\,]{2,}$/")

Error:

  Syntax error: a valid JS regex literal expected
  1. genType 4.4.0 (in .gen.tsx) started importing from bs-platform instead of rescript
// now
import * as Curry__Es6Import from 'bs-platform/lib/es6/curry.js';
// before
import * as Curry__Es6Import from 'rescript/lib/es6/curry.js';

Can you open an issue on the genType repo?
Either that or the integration of genType inside the compiler could be accelerated.

1 Like