Releases: rescript-lang/rescript
Releases · rescript-lang/rescript
12.0.0-alpha.5
🚀 New Feature
- Introduce "Unified operators" for arithmetic operators (
+
,-
,*
,/
,mod
). #7057 - Add remainder (
%
, aka modulus) operator. #7152
🐛 Bug fix
- Fix and clean up boolean and/or optimizations. #7134 #7151
- Fix identifiers with name
arguments
andeval
to be mangled. #7163
💅 Polish
- Improve code generation for pattern matching of untagged variants. #7128
- Improve negation handling in combination with and/or to simplify generated code (especially coming out of pattern matching). #7138
- Optimize JavaScript code generation by using
x == null
checks and improving type-based optimizations for string/number literals. #7141 - Improve pattern matching on optional fields. #7143 #7144
- Optimize compilation of switch statements for untagged variants when there are no literal cases. #7135
- Further improve boolean optimizations. #7149
- Simplify code generated for conditionals. #7151
🏠 Internal
- Move rescript-editor-analysis and rescript-tools into compiler repo. #7000
12.0.0-alpha.4
💥 Breaking Change
- OCaml compatibility in the stdlib and primitives are dropped/deprecated. #6984
- Remove JSX v3. #7072
- Remove js_cast.res. #7075
🚀 New Feature
- Use FORCE_COLOR environmental variable to force colorized output. #7033
- Allow spreads of variants in patterns (
| ...someVariant as v =>
) when the variant spread is a subtype of the variant matched on. #6721 - Fix the issue where dynamic imports are not working for function-defined externals. #7060
- Allow pattern matching on dicts.
switch someDict { | dict{"one": 1} => Js.log("one is one") }
. #7059 - "ReScript Core" standard library is now included in the
rescript
npm package. #7108 #7116 - Handle absolute filepaths in gentype. #7104
🐛 Bug fix
- Fix tuple coercion. #7024
- Fix attribute printing. #7025
- Fix "rescript format" with many files. #7081
- Fix bigint max, min. #7088
- Fix parsing issue with nested variant pattern type spreads. #7080
- Fix JSX settings inheritance: only 'version' propagates to dependencies, preserving their 'mode' and 'module'. #7094
- Fix variant cast to int. #7058
- Fix comments formatted away in function without arguments. #7095
- Fix genType JSX component compilation. #7107
💅 Polish
- Add some context to error message for unused variables. #7050
- Improve error message when passing
children
prop to a component that doesn't accept it. #7044 - Improve error messages for pattern matching on option vs non-option, and vice versa. #7035
- Improve bigint literal comparison. #7029
- Improve output of
@variadic
bindings. #7030 - Improve error messages around JSX components. #7038
- Improve output of record copying. #7043
- Provide additional context in error message when
unit
is expected. #7045 - Improve error message when passing an object where a record is expected. #7101
🏠 Internal
- Remove uncurried flag from bsb. #7049
- Build runtime/stdlib files with rescript/bsb instead of ninja.js. #7063
- Build tests with bsb and move them out of jscomp. #7068
- Run
build_tests
on Windows. #7065 - Rename folder "jscomp" to "compiler". #7086
- Disable -bs-cross-module-opt for tests. #7071
- Move
ounit_tests
into thetests
folder. #7096 - Move
syntax_tests
into thetests
folder. #7090 #7097 - Capitalize runtime filenames. #7110
- Build mocha tests as esmodule / .mjs. #7115
11.1.4
🐛 Bug Fix
- Fix issue where long layout break added a trailing comma in partial application
...
. #6949 - Fix incorrect format of function under unary operator. #6953
- Fix incorrect incorrect printing of module binding with signature. #6963
- Disallow spreading anything but regular variants inside of other variants. #6980
- Fix comment removed when function signature has
type
keyword. #6997 - Fix parse error on doc comment before "and" in type def. #7001
- Fix tuple coercion. #7024
12.0.0-alpha.3
12.0.0-alpha.2
🚀 New Feature
- Allow coercing polyvariants to variants when we can guarantee that the runtime representation matches. #6981
- Add new dict literal syntax (
dict{"foo": "bar"}
). #6774 - Optimize usage of the new dict literal syntax to emit an actual JS object literal. #6538
🐛 Bug Fix
- Fix issue where long layout break added a trailing comma in partial application
...
. #6949 - Fix incorrect format of function under unary operator. #6953
- Fix incorrect printing of module binding with signature. #6963
- Fix incorrect printing of external with
@as
attribute and_
placholder (fixed argument). #6970 - Disallow spreading anything but regular variants inside of other variants. #6980
- Fix comment removed when function signature has
type
keyword. #6997 - Fix parse error on doc comment before "and" in type def. #7001
🏠 Internal
- Add dev container. #6962
- Convert more tests to the node test runner. #6956
- Remove attribute "internal.arity". #7004
- Remove dead modules. #7008
💅 Polish
- Improve formatting in the generated js code. #6932
}\ncatch{
->} catch {
for(let i = 0 ,i_finish = r.length; i < i_finish; ++i){
->for (let i = 0, i_finish = r.length; i < i_finish; ++i) {
while(true) {
->while (true) {
- Fixed tabulation for
switch case
bodies - Fixed tabulation for
throw new Error
bodies - Removed empty line at the end of
switch
statement - Removed empty
default
case fromswitch
statement in the generated code
- Optimised the Type Extension runtime code and removed trailing
/1
fromRE_EXN_ID
. #6958 - Compact output for anonymous functions. #6945 #7013
- Rewatch 1.0.9. #7010
12.0.0-alpha.1
🚀 New Feature
- Allow
@directive
on functions for emitting function level directive code (let serverAction = @directive("'use server'") (~name) => {...}
). #6756 - Add
rewatch
to the npm package as an alternative build tool. #6762 - Throws an instance of JavaScript's
new Error()
and adds the extension payload forcause
option. #6611 - Allow free vars in types for type coercion
e :> t
. #6828 - Allow
private
in with constraints. #6843 - Add regex literals as syntax sugar for
@bs.re
. #6776 - Improved mechanism to determine arity of externals, which is consistent however the type is written. #6874 #6881 #6883
💥 Breaking Change
- Make
j
andjs
allowed names for tag functions. #6817 lazy
syntax is no longer supported. If you're using it, useLazy
module orReact.lazy_
instead. #6342- Remove handling of attributes with
bs.
prefix (@bs.as
->@as
etc.). #6643 - Remove obsolete
@bs.open
feature. #6629 - Drop Node.js version <18 support, due to it reaching End-of-Life. #6429
- Remove deprecated -bs-super-errors option. #6814
- Some global names and old keywords are no longer prefixed. #6831
- Remove ml parsing tests and conversion from
.ml
to.res
via format. #6848 - Remove support for compiling
.ml
files, and general cleanup. #6852 - Remove
rescript convert
subcommand. #6860 - Remove support for
@bs.send.pipe
. This also removes all functions inJs_typed_array
that rely on@bs.send.pipe
. #6858 #6891 - Remove deprecated
Js.Vector
andJs.List
. #6900
🐛 Bug Fix
- Fix unhandled cases for exotic idents (allow to use exotic PascalCased identifiers for types). #6777 #6779 #6897
- Fix unused attribute check for
@as
. #6795 - Reactivate unused attribute check for
@int
. #6802 - Fix issue where using partial application
...
can generate code that usesCurry
at runtime. #6872 - Avoid generation of
Curry
with reverse application|>
. #6876 - Fix issue where the internal ppx for pipe
->
would not use uncurried application in uncurried mode. #6878
🏠 Internal
- Build with OCaml 5.2.0. #6797
- Convert OCaml codebase to snake case style. #6702
- Fix
-nostdlib
internal compiler option. #6824 - Remove a number of ast nodes never populated by the .res parser, and resulting dead code. #6830
- Remove coercion with 2 types from internal representation. Coercion
e : t1 :> t2
was only supported in.ml
syntax and never by the.res
parser. #6829 - Convert
caml_format
andjs_math
to.res
. #6834 - Convert
js.ml
files to.res
. #6835 - Remove old
.ml
tests. #6847 - Make compiler libs ready for uncurried mode. #6861
- Make tests ready for uncurried mode. #6862
- Make gentype tests uncurried. #6866
- Remove
@@uncurried.swap
, which was used for internal tests. #6875 - Build the compiler libraries/tests in uncurried mode. #6864
- Ignore
-uncurried
command-line flag. #6885 - Cleanup: remove tracking of uncurried state in parser/printer. #6888
- Remove
%opaque
primitive. #6892 - Reunify JsxC/JsxU -> Jsx etc. #6895
- Remove the transformation of
foo(1,2)
intoJs.Internal.opaqueFullApply(Internal.opaque(f), 1, 2)
, and change the back-end to treat all applications as uncurried. #6893
💅 Polish
- Make the
--help
arg be prioritized in the CLI, so correctly prints help message and skip other commands. #6667 - Remove redundant space for empty return in generated js code. #6745
- Remove redundant space for export in generated js code. #6560
- Remove redundant space after continue in generated js code. #6743
- Remove empty export blocks in generated js code. #6744
- Fix indent for returned/thrown/wrapped in parentheses objects in generated js code. #6746
- Fix indent in generated js code. #6747
- In generated code, use
let
instead ofvar
. #6102 - Turn off transformation for closures inside loops when capturing loop variables, now that
let
is emitted instead ofvar
. #6480 - Improve unused attribute warning message. #6787
- Remove internal option
use-stdlib
from build schema. #6778 - Fix
Js.Types.JSBigInt
payload to use nativebigint
type. #6911 - Deprecate
%external
extension, which has never been officially introduced. #6906
11.1.3
🐛 Bug Fix
- Fix tag function location on compiler error. #6816
- Fix Deno compatibility issues on Windows. #6850
- Fix issue with infinite loops with type errors on recursive types. #6867
- Ignore
@uncurry
attribute in uncurried mode, to avoid generating calls toCurry
at runtime. #6869 - Avoid generating calls to Curry when adjusting arity of uncurried functions. #6870
- Fix build after calling without
-warn-error
, see #6868 for more details. #6877 - Fix issue with uninitialized
_param
in recursive functions with unit argument. #6907
11.1.3-rc.1
🐛 Bug Fix
- Omit standard library dir from load path if
-nostdlib
is set. #6833
11.1.2
11.1.2-rc.1
🚀 New Feature
- Support Windows 11 ARM (using the x64 binaries in emulation). #6813
🐛 Bug Fix
- Fix location of let bindings with attributes. #6791
- PPX v4: mark props type in externals as
@live
to avoid dead code warnings for prop fields in the editor tooling. #6796 - Fix issue where optional labels were not taken into account when disambiguating record value construction. #6798
- Fix issue in gentype when type
Jsx.element
surfaces to the user. #6808 - Fix inclusion check (impl vs interface) for untagged variants, and fix the outcome printer to show tags. #6669
- Fix encoding inside tagged template literals. #6810