ReScript is a robustly typed language that compiles to efficient and human-readable JavaScript.
Repo rescript-lang/rescript, read from GitHub 1 min ago. rescript-lang has not joined Take My Repo.
rescript now runs a build system rewritten in OCaml that compiles modules in-process on several CPU cores. The Rust implementation remains available as rescript-rust. #8780 #8781 #9170.cmt files up to 30× smaller. #9149let rec groups no longer take quadratic time. #8893 #8794 #8801 #9153Temporal bindings. #9094<Sidebar.Provider /> work as client references. #8904rescript-tools migrate-all with 12.3.2 before upgrading. #9052@deriving(abstract) and @deriving(jsConverter), the @ocaml.* attributes, @ocaml.doc/@ns.doc doc comments, record syntax for dicts and macOS Intel support are removed. See the breaking changes below. #8729 #8928 #8992 #8751 #8912"0", "1", … with @as are JavaScript arrays; record rest patterns, coercions and untagged variants that would treat them as objects are now errors. #9224%debugger with a debugger() function. #9163TypedArray.map and TypedArray.mapWithIndex keep the element type. #9112Temporal stdlib module shadows project modules named Temporal; nested modules named Temporal are exported to JavaScript as $$Temporal. #9094List.has, Error and Exn; run rescript-tools migrate-all with 12.3.2 first. #9052Int8Array.t are no longer interchangeable; upcast with :> TypedArray.t<_> to use the generic TypedArray functions. #9050@unboxed can only be written on a variant type, not on a constructor. On the type, it makes a single-field inline record payload the field itself instead of the record object; give the record type a name to keep the object. #9040.cmi and .cmt files use ReScript magic numbers, so tools that read them as OCaml files no longer accept them. #9000/** */; @ocaml.doc and @ns.doc are ignored. #8992@ocaml.* attribute spellings, such as @ocaml.warning, and %extension_constructor; PPX output keeps working. #8928@res.hoistedFunction; nested functions other than make are no longer exported as top-level A$B$f values. #8904\"_" is no longer a valid quoted identifier. #8795rescript ignores RESCRIPT_BSC_EXE; only rescript-rust reads it. #8781rescript rejects duplicate keys in rescript.json, namespace-entry without namespace and a value after --no-timing. #8780rescript --filter supports only common regular expression syntax. #8780--after-build command fails the build. #8780rescript format -v and rescript compiler-args -v write their logs to stderr instead of stdout. #8780rescript does not export OpenTelemetry traces; rescript-rust still does. #8780let d: dict<int> = {foo: 1}; it's an error pointing to dict{...}. #8751@inlined attribute, which had no effect. #8734%obj_is_int, %obj_dup, %obj_field, %array_safe_set, %null_to_opt and %nullable_to_opt. #8731-pp compiler flag, which had no effect. #8731@deriving(abstract) and @deriving(jsConverter); use records and polymorphic variants directly. #8729Temporal bindings to the standard library. #9094Array.arrayLike and taggedTemplate types through their type parameters, e.g. Iterator.t<sub> to Iterator.t<super>. #8981@instanceOf and @typeOf, so that JavaScript classes and opaque primitive types can be untagged variant cases. #8950 #9017 #9050for..of and for await..of accept generators and other iterator types directly, without asIterable. #8937try ... finally { ... } and try ... catch { ... } finally { ... }, compiled to JavaScript finally blocks. #8931make functions flat (A$B$make), so that nested components work as React Server Components client references. #8904200 .. 299. #8894char an alias of int. #8892$ in identifiers, e.g. let count$ = signal(0). #8791rescript now runs a build system rewritten in OCaml; the Rust implementation remains available as rescript-rust. #8780true%re; use regexp literals instead. #8634Char module, unsafe Obj operations, legacy Pervasives helpers, and Array.unsafe_get. #8564Js namespace and its runtime modules. #8531@rescript/belt package. Projects using Belt must install the package and list it in their rescript.json dependencies. #8554rescript-tools doc, preserving parameter labels, optionality, and nested type structure. This changes the published RescriptTools.Docgen schema. #8576@set unless inferred settable on an open row; private rows and coercions no longer implicitly grant write access. #8597@get (bare or with a null/undefined/nullable payload) and @set({no_get: ...}) on object types. Only bare @set marks a field settable; nullable getter types are written directly (null<t>, undefined<t>, nullable<t>). #8597Int.Ref and the obsolete %incr, %decr, %refget, %function_arity, %succint, and %predint builtins. Custom externals using these names are now rejected. #8616 #8608reanalyze -reactive option; reanalyze now always uses the reactive pipeline. #8648@this this => async arg => ... as a method returning an async function. To create an async method with both parameters, write @this async (this, arg) => .... #8566"\uD83D\uDE00" in ordinary string literals. #8606@scope; the generated import follows the complete property path. These imports were previously rejected. #8582@res.hoistedFunction for emitting nested module functions as flat JavaScript exports. #8402List.includes, deprecate List.has in favor of List.some, and clarify the equality semantics of List.includes and Array.includes. #8530reanalyze incorrectly reporting labels and variant cases of re-exported types as dead in the editor. #8647 #8648reanalyze incorrectly reporting record fields accessed through coercions as dead. #8643 #8645reanalyze findings in stable source order across machines. #8648%raw, %ffi, and %re payloads leaking into emitted JavaScript. #8630@as annotations when formatting object types containing spreads. #8619@as annotation exceeds the compiler's integer range. #8619@as on a record field whose payload does not name the field, such as @as(42). It renamed nothing and was silently accepted. #8619@set reports that the field is not settable and suggests the annotation, and missing-property errors name the field instead of a phantom "x#=" member. #8597unit so they use the same unit-return behavior as externals declared to return unit. #8581@variadic, @unwrap, polymorphic variant encodings, @as phantom arguments, optional labeled arguments, and @return wrappers. The imported value now applies the same conversions as a direct external call. #8582module Make: Pattern => {). #8519= in locally abstract value constraints (let f: type a. t /* comment */ = value). #8575int => int => int) could satisfy an uncurried interface ((int, int) => int) or be coerced to it, which could miscompile calls made through the interface type. Such mismatches are now compile errors with an explanatory hint. #8559(~x=default, y) => (~z=default, w) => ..., x's default was only computed when the inner function was applied. Each default is now computed when its own parameter group is applied. #8568~x: int => string) getting no arity: they printed identically to their parenthesized form ((~x: int) => string) but did not unify with it. #8563@res.async marker no longer leaks into the program, attributes on an arrow type or on an await expression are no longer dropped or relocated (previously this could crash the formatter), JSX elements keep their closing tag, and PPX-emitted OCaml-style function is desugared instead of crashing the compiler. #8561= in let bindings. #8444~x: int => string) getting no arity and failing to unify with their parenthesized form. #8563Jsx.component abstract. #8390@taggedTemplate decorator in favor of the new first-class taggedTemplate<'param, 'output> builtin type. Using the decorator, or backtick tagged-template syntax on a value that is not a taggedTemplate, is now a compile error pointing to the new binding form. #8461taggedTemplate<'param, 'output> builtin type and the TaggedTemplate stdlib module (TaggedTemplate.make). Tagged-template tags are now tracked through the type system, so they emit real JS tagged-template syntax across module boundaries, when passed as first-class values, and when constructed at runtime by a factory (e.g. postgres). #8461@warning("-102") not working. #8322for..of formatter. #8395dict{} patterns. #8403= in let bindings. #8444Some(React.component). #8500Stdlib_Error and Stdlib_Exn modules in favor of JsError/JsExn. #8404Json library and use yojson and lsp library for analysis. #8436Primitive_option.toUndefined; use valFromOption for optional ffi args. #8380master build to GitHub Pages. #8435super_errors fixture coverage for warnings and errors. #8429super_errors fixtures in parallel (~2.4× faster locally). #8430super_errors fixture coverage for the remaining reachable single-file error variants. #8432super_errors_multi) for cross-module errors and warnings. #8433tests/ERROR_VARIANTS.md and add fixtures for the remaining reachable ones. #8446Shared_types.state. #8465Longident.Lapply constructor (OCaml's applicative-functor path syntax F(X).t, which ReScript's grammar cannot produce). #8469Sig_class/Sig_class_type signature variants (OCaml class items, which ReScript cannot produce). #8470(No changes compared to 12.3.0-beta.1.)
"src/generated/**"). #8277~locales and ~options parameters to String.localeCompare. #8287null and array values incorrectly matching the Object branch when pattern matching on JSON.t (or other untagged variants with an Object case) in statement position. #8279package.json has no name field. #8291.... #83430:0 editor diagnostics in PPX-related flows. #8350dict{} and async, so you don't need to annotate one extra time when the type is known. #8359dict{} patterns. #8403rescript.json. #8292"src/generated/**"). #8277~locales and ~options parameters to String.localeCompare. #8287null and array values incorrectly matching the Object branch when pattern matching on JSON.t (or other untagged variants with an Object case) in statement position. #8279package.json has no name field. #8291.... #83430:0 editor diagnostics in PPX-related flows. #8350dict{} and async, so you don't need to annotate one extra time when the type is known. #8359dict{} patterns. #8403rescript.json. #8292