[ANN] ReScript 10 - First Alpha Release

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