No, it wasn’t correct before. There’s a scenario that requires the contents of the array to be optional.
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
Yes it’s in the release notes.
Would you contribute the smallest repro in an issue. That will help speed up resolution.
There’s an example project in the rescript-relay
repo. I’ve cloned it, installed rescript@next
and got the error.
It turns out that because of using comment caused this error.
After removing it and build again, it failed with another error:
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
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!
yes. I published it immediately as v14.2.1.
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.
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.
Hi! Pretty excited for the new version of ReScript…
I tested the latest beta on my pretty large codebase and I found 2 issues:
- 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
- genType 4.4.0 (in .gen.tsx) started importing from
bs-platform
instead ofrescript
// 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.