ReScript 11.1.x
ReScript 11.1 bugfix releases and deprecation warnings
In preparation for the next major release of ReScript, we decided to deprecate JSX V3 in ReScript 11.1.5, in order to remove it completely in ReScript 12. During the development of V12, we fixed some parser and formatter issues that got backported to V11 as well. Furthermore, some compiler bugfixes happened as well. And last but not least, we improved Windows support a bit.
Please ensure to be on the latest patch release:
SHnpm install rescript@11.1
All changes can be found in the changelog (11.1.1 - 11.1.5), but the most important ones are:
Deprecation of JSX 3
JSX 3 has been officially deprecated. Moving forward, developers should only use JSX 4 so we can safely remove it from ReScript V12 and also to ensure binding libraries will use it as the blessed path. Read more on the deprecation pull request.
Some parser and formatter fixes
On the way to remove the legacy Pervasives
standard library out of the compiler, we adapted a lot of compiler tests and found some parser and formatter issues, see below:
Trailing Comma Issue Fixed in Partial Applications
A bug that caused a trailing comma in partial applications (...
) during long layout breaks has been fixed. This resolves formatting inconsistencies that could arise in such cases. More details.
Unary Operator Function Format Fix
Previously, functions placed under unary operators could end up incorrectly formatted. This issue has now been resolved, ensuring that such scenarios are handled cleanly. PR link.
Correct printing of module binding with signature
An issue where the module binding with a signature was incorrectly printed has been addressed. The formatting now works as expected, improving readability and reducing confusion. Learn more.
Comment Retention in Function Signatures with type
Comments were sometimes removed when a function signature included the type
keyword. This bug has been fixed, ensuring that comments remain intact and improve code clarity. PR details.
Parsing Error Fixed in Type Definitions
A parsing error that occurred when a doc comment appeared before an "and" in a type definition has been corrected. Developers can now rely on proper parsing in such scenarios. See the PR.
Tuple Coercion Fix
A bug in tuple coercion has been addressed, ensuring proper behavior in tuple-related type coercion. More here.
Comment Handling in Uncurried Functions
The formatter now properly retains comments in the first argument of uncurried functions, improving code readability during formatting. Details in the PR.
Parenthesis Retention in Pipe Operators
A formatter bug where parentheses were removed in pipe operators with anonymous uncurried functions has been fixed, ensuring that the intended operator precedence is preserved. More details.
Improved Support for Capitalized Type Variables
A bug preventing capitalized type variables from being used in certain positions has been fixed, allowing greater flexibility in type variable naming. Details here.
Compiler improvements
Stricter Variant Spreading Rules
The compiler now disallows spreading anything other than regular variants inside other variants. This change enforces stricter type-safety rules, making your code more predictable and reducing potential edge-case errors. PR link.
Improved Error Reporting in Tag Functions
Compiler error reports related to tag functions have been improved, ensuring accurate error locations for easier debugging. Details in the PR.
Infinite Loops Fix in Recursive Types
An infinite loop issue arising from recursive types with type errors has been fixed. This significantly improves the compiler’s robustness when handling more complex type definitions. PR link.
Better Handling of @uncurry
in Uncurried Mode
The @uncurry
attribute is now ignored in uncurried mode, preventing unnecessary runtime calls to Curry
, which optimizes performance and reduces overhead. More on the fix. As uncurried mode will be the only mode of V12, the attribute will also be removed.
Arity Adjustment Without Curry
Calls
The compiler now avoids generating Curry
calls when adjusting the arity of uncurried functions, further improving runtime efficiency. Details in the PR.
Recursive Function Fix for _param
An uninitialized _param
in recursive functions with unit arguments has been fixed, improving reliability in recursive function calls. See the PR.
Optional Labels in Record Value Construction
An issue where optional labels were not considered during record value construction has been fixed, making record creation more consistent and error-free. PR link.
Gentype Improvements for Jsx.element
A bug in Gentype when the Jsx.element
type surfaced to the user has been addressed, ensuring better interoperability between Gentype and JSX elements. Read more.
Untagged Variant Fixes
The compiler now correctly handles inclusion checks for untagged variants and improves the outcome printer to properly display tags. Details in the PR.
Encoding Fix in Tagged Template Literals
An encoding issue in tagged template literals has been fixed, ensuring that template literals work correctly with special character encodings. Learn more.
Switch Case Issue Fixed for Mixed Objects and Arrays
A bug causing incorrect switch case behavior when mixing objects and arrays with identical bodies has been resolved, improving the correctness of switch case statements. PR link.
Platform support and build system
Deno Compatibility on Windows
The ReScript compiler now resolves compatibility issues when using Deno on Windows, making development smoother for Windows users working with Deno. Read more.
Windows 11 ARM Support
The compiler now supports Windows 11 ARM, using x64 binaries in emulation mode, expanding ReScript’s compatibility with new hardware architectures. Learn more.
Build Fix Without -warn-error
A specific build issue that occurred when running the compiler without -warn-error
has been resolved. This improves the flexibility of build configurations. Learn more.
Omit Standard Library in Load Path
If the -nostdlib
flag is set, the standard library directory will now be omitted from the load path, giving developers more control over their environment. PR link.
v12 outlook
We are deep in the process of removing a lot of legacy compiler internals as well as support for ml syntax. With v12, ReScript will be a language with just one syntax, targeting one platform and, ideally, one standard library that ships with the compiler directly. We hope it will enable us to tailor ReScript even more to the JS platform.
Acknowledgements
There is a good amount of recurring contributors who deliver some very good work now. So once again we have to thank you all, you are amazing! The most recent patch releases had contributions by:
@aspeddro, @cknitt, @cristianoc, @fhammerschmidt, @rlidwka, @shulhi, @tsnobip, @zth