Releases: rescript-lang/rescript
Releases · rescript-lang/rescript
12.0.0-alpha.15
💥 Breaking Change
- New
rewatchbased build system. #7551 #7593- The new
rewatchbased build system is now the default and is exposed through therescriptcommand. Therewatchcommand has been removed. - The previous Ninja-based build system is now available via the
rescript legacysubcommand. - Argument
--compiler-argsis now a subcommandcompiler-args.
- The new
- Remove
String.getSymbol,String.getSymbolUnsafe,String.setSymbolfrom standard library. #7571
🐛 Bug fix
- Ignore inferred arity in functions inside
%rawfunctions, leaving to%ffithe responsibility to check the arity since it gives an error in case of mismatch. #7542 - Pass the rewatch exit code through in wrapper script. #7565
- Prop punning when types don't match results in
I/O error: _none_: No such file or directory. #7533 - Pass location to children prop in jsx ppx. #7540
- Fix crash when
-bs-gis used with untagged variants. #7575 - Fix issue with preserve mode where
jsxis declared as an external without a@moduleattribute. #7591 - Rewatch: don't add deps to modules that are in packages that are not a dependency. #7612
- Rewatch: fix non-unicode stderr. #7613
- Fix rewatch considering warning configs of non-local dependencies. #7614
- Rewatch: fix panic if package.json name different from module name. #7616
- Fix finding the standard library for pnpm. #7615
💅 Polish
- Better error message for when trying to await something that is not a promise. #7561
- Better error messages for object field missing and object field type mismatches. #7580
- Better error messages for when polymorphic variants does not match for various reasons. #7596
- Improved completions for inline records. #7601
- Add
OrThrowaliases forBeltfunctions ending withExn. #7581, #7590 The following aliases have been added:Belt.Array.getOrThrowBelt.Array.setOrThrowBelt.Map.getOrThrowBelt.MutableMap.getOrThrowBelt.Set.getOrThrowBelt.MutableSet.getOrThrowBelt.List.getOrThrowBelt.List.tailOrThrowBelt.List.headOrThrowBelt.MutableQueue.peekOrThrowBelt.MutableQueue.popOrThrowBelt.Option.getOrThrowBelt.Result.getOrThrow
🏠 Internal
12.0.0-alpha.14
💥 Breaking Change
Iterator.forEachnow emitsIterator.prototype.forEachcall. #7506- Rename functions ending with
Exnto end withOrThrow. The oldExnfunctions are now deprecated:Bool.fromStringExn→Bool.fromStringOrThrowBigInt.fromStringExn→BigInt.fromStringOrThrowJSON.parseExn→JSON.parseOrThrow- Changed
BigInt.fromFloatto return an option rather than throwing an error. - Added
BigInt.fromFloatOrThrow Option.getExn→Option.getOrThrowNull.getExn→Null.getOrThrowNullable.getExn→Nullable.getOrThrowResult.getExn→Result.getOrThrowList.getExn→List.getOrThrowList.tailExn→List.tailOrThrowList.headExn→List.headOrThrow- Old functions remain available but are marked as deprecated with guidance to use the new
OrThrowvariants. - #7518, #7554
🚀 New Feature
- Add
RegExp.flags. #7461 - Add
Array.findLast,Array.findLastWithIndex,Array.findLastIndex,Array.findLastIndexWithIndexandArray.findLastIndexOpt. #7503 - Add
optionsargument toConsole.dir. #7504 - Show variant constructor's inline record types on hover. #7519
- Add additional
Iterator.prototypebindings toruntime/Stdlib_Iterator.res. #7506
🐛 Bug fix
rescript-tools docno longer includes shadowed bindings in its output. #7497- Treat
throwlikeraisein analysis. #7521 - Fix
index out of boundsexception thrown in rare cases byrescript-editor-analysis.exe codeActioncommand. #7523 - Don't produce duplicate type definitions for recursive types on hover. #7524
- Prop punning when types don't match results in
I/O error: _none_: No such file or directory. #7533 - Fix partial application with user-defined function types. #7548
- Fix doc comment before variant throwing syntax error. #7535
- Fix apparent non-determinism in generated code for pattern matching. #7557
💅 Polish
- Suggest awaiting promise before using it when types mismatch. #7498
- Complete from
RegExpstdlib module for regexes. #7425 - Allow oneliner formatting when including module with single type alias. #7502
- Improve error messages for JSX type mismatches, passing objects where record is expected, passing array literal where tuple is expected, and more. #7500
- Show in error messages when coercion can be used to fix a type mismatch. #7505
- Remove deprecated pipe last (
|>) syntax. #7512 - Improve error message for pipe (
->) syntax. #7520 - Improve a few error messages around various subtyping issues. #7404
- In module declarations, accept the invalid syntax
M = {...}and format it toM : {...}. #7527 - Improve doc comment formatting to match the style of multiline comments. #7529
- Improve error messages around type mismatches for try/catch, if, for, while, and optional record fields + optional function arguments. #7522
- Sync reanalyze with the new APIs around exception. #7536
- Improve array pattern spread error message. #7549
- Sync API docs with rescript-lang.org on release. #7555
🏠 Internal
12.0.0-alpha.13
💥 Breaking Change
- Rename
JsErrortoJsExnand error modules cleanup. #7408 - Make
BigInt.fromFloatreturn an option rather than throwing an error in case it's passed a value with a decimal value. #7419
🚀 New Feature
- Add shift (
<<,>>,>>>) operators forintandbigint. #7183 - Add bitwise AND (
&) operator forintandbigint. #7415 - Add bitwise NOT (
~) operator forintandbigint. #7418 - Significantly reduced the download size by splitting binaries into optional platform-specific dependencies (e.g,
@rescript/linux-x64). #7395 - JSX: do not error on ref as prop anymore (which is allowed in React 19). #7420
- Add new attribute
@notUndefinedfor abstract types to prevent unnecessary wrapping withPrimitive_option.somein JS output. #7458 - Preserve JSX: enable by adding
"-bs-jsx-preserve"to"bsc-flags"(does require"jsx": { "version": 4 }). #7387 - Add slot prop to
JsxDOM.domProps. #7487
🐛 Bug fix
- Fix broken
bstracingCLI location. #7398 - Fix field flattening optimization to avoid creating unnecessary copies of allocating constants. #7421
- Fix leading comments removed when braces inside JSX contains
letassignment. #7424 - Fix JSON escaping in code editor analysis: JSON was not always escaped properly, which prevented code actions from being available in certain situations. #7435
- Fix regression in pattern matching for optional fields containing variants. #7440
- Fix missing checks for duplicate literals in variants with payloads. #7441
- Fix printer removing private for empty record. #7448
- Fix: handle dynamic imports with module aliases. #7452
- Fix missing unescaping when accessing prop with exotic name. #7469
- Fix syntax error with mutable nested record. #7470
🏠 Internal
- AST: Add bar location to
case. #7407 - Clean up lazy from ASTs and back-end. #7474
- Compile runtime with rewatch and add rewatch tests to the compiler repo. #7422
💅 Polish
12.0.0-alpha.12
12.0.0-alpha.11
🐛 Bug fix
- Fix
Error.fromException. #7364 - Fix signature of
throw. #7365 - Fix formatter adds superfluous parens in pipe chain. #7370
🏠 Internal
- Remove
Stdlib_Charmodule for now. #7367 - Convert internal JavaScript codebase into ESM, ReScript package itself is now ESM (
"type": "module"). #6899
💅 Polish
- More deprecations in
Pervasives; addStdlib.PairandStdlib.Int.Ref. #7371
12.0.0-alpha.10
🚀 New Feature
- Add
Dict.hasand doubleDict.forEachWithKey/Dict.mapValuesperformance. #7316 - Add popover attributes to
JsxDOM.domProps. #7317 - Add
Array.removeInPlacehelper based onsplice. #7321 - Add
inertattribute toJsxDOM.domProps. #7326 - Make reanalyze exception tracking work with the new stdlib. #7328
- Fix
Pervasive.maxusing boolean comparison for floats. #7333 - Experimental: Support nested/inline record types - records defined inside of other records, without needing explicit separate type definitions. #7241
- Add unified exponentiation (
**) operator for numeric types using ES7**. #7153 - Rename
raisetothrowto align with JavaScript vocabulary.raisehas been deprecated. #7346 - Add unified bitwise (
^) operator. #7216 - Stdlib: rename binary operations to match JavaScript terms. #7353
💥 Breaking Change
- Replace
~datewith~dayinDate.make. #7324 - Remove
-bs-jsx-mode. #7327 - Drop Node.js version <20 support, as it is reaching End-of-Life. #7354
- Treat
intmultiplication as a normal int32 operation instead of usingMath.imul. #7358
🏠 Internal
💅 Polish
- Deprecate
JSON.Classify.classify. #7315 - Hide stdlib modules in output. #7305
- Deprecate unsafe host-specific bindings from stdlib. #7334
- Make unsafe function names consistent in
Stdlib.String. #7337 rescriptpackage does not triggerpostinstallscript anymore. #7350- Add Stdlib
BoolandCharmodules and improve Pervasives deprecation messages. #7361
🐛 Bug fix
11.2.0-beta.2
🏠 Internal
- Playground: use TLS 1.2 to upload files to CDN using FTP. #7307
12.0.0-alpha.9
💥 Breaking Change
- Clean list API. #7290
💅 Polish
- Allow single newline in JSX. #7269
- Editor: Always complete from Core first. Use actual native regex syntax in code snippets for regexps. #7295
- Add
type tto Stdlib modules. #7302 - Gentype: handle null/nullable/undefined from Stdlib. #7132
🐛 Bug fix
- Fix async context checking for module await. #7271
- Fix
%externalextension. #7272 - Fix issue with type environment for unified ops. #7277
- Fix completion for application with tagged template. #7278
- Fix error message for arity in the presence of optional arguments. #7284
- Fix issue in functors with more than one argument (which are curried): emit nested function always. #7273
- Fix dot completion issue with React primitives. #7292
- Stdlib namespace for Core modules (fixes name clashes with user modules). #7285
- Fix runtime type check for Object in untagged variants when one variant case is
null. #7303 - Fix files that were being truncated when sent to the CDN over FTP. #7306
- Fix better editor completion for applications. #7291
- Fix
@react.componentWithPropsno longer works with@directive("'use memo'"). #7300
🏠 Internal
11.2.0-beta.1
💥 Breaking Change
- Deprecate JSX 3. #7042
- Deprecate js_cast.res. #7074
- Deprecate top-level
"suffix"option inrescript.json. #7056
🐛 Bug Fix
- Handle absolute file paths in gentype. #7111
- Fix "rescript format" with many files. #7081
- Fix exponential notation syntax. #7174
- Fix formatter handling of wildcard in pattern matching records with no fields specified. #7224
🏠 Internal
- Playground: Bundle and upload stdlib runtime so that the playground can execute functions from Core/Belt/Js. #7268
12.0.0-alpha.8
🐛 Bug fix
- Editor: Fix issue where pipe completions would not trigger with generic type arguments. #7231
- Fix leftover
assert falsein code fornull != undefined. #7232 - Editor: Fix issue where completions would not show up inside of object bodies. #7230
- Fix issue with pattern matching empty list which interferes with boolean optimisations. #7237
- Fix Cannot combine
@react.componentand@directive. #7260 - Fix issue where attributes on an application were not preserved by the AST conversion for ppx. #7262
🏠 Internal
- AST cleanup: Prepare for ast async cleanup: Refactor code for
@res.asyncpayload handling and clean up handling of type and term parameters, so that now each=>in a function definition corresponds to a function. #7223 - AST: always put type parameters first in function definitions. #7233
- AST cleanup: Remove
@res.asyncattribute from the internal representation, and add a flag to untyped and typed ASTs instead. #7234 - AST cleanup: Remove unused
expression_desc.Pexp_new,expression_desc.Pexp_setinstvar,expression_desc.Pexp_override,expression_desc.Pexp_poly,exp_extra.Texp_poly,expression_desc.Texp_new,expression_desc.Texp_setinstvar,expression_desc.Texp_override&expression_desc.Texp_instvarfrom AST. #7239 - AST cleanup: Remove
@res.partialattribute from the internal representation, and add a flag to untyped and typed ASTs instead. #7238 #7240 - AST cleanup: Remove unused
structure_item_desc.Pstr_class,signature_item_desc.Psig_class,structure_item_desc.Pstr_class_type,signature_item_desc.Psig_class_type,structure_item_desc.Tstr_class,structure_item_desc.Tstr_class_type,signature_item_desc.Tsig_class,signature_item_desc.Tsig_class_typefrom AST. #7242 - AST cleanup: remove
|.and rename|.to->in the internal representation for the pipe operator. #7244 - AST cleanup: represent concatenation (
++) and (dis)equality operators (==,===,!=,!==) just like in the syntax. #7248 - AST cleanup: use inline record for
Ptyp_arrow. #7250 - Playground: Bundle stdlib runtime so that the playground can execute functions from Core/Belt/Js. #7255
- AST cleanup: Remove
res.namedArgLocattribute and store the location information directly into the label. #7247