Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
516e650
Remove the unreachable Longident.Lapply constructor (#8469)
JonoPrest Jun 12, 2026
4c4b308
Remove dead Sig_class and Sig_class_type signature variants
JonoPrest Jun 11, 2026
7004d36
Support v12 CMT files in analysis (#8477)
aspeddro Jun 17, 2026
863cf5f
Remove unused files (#8481)
aspeddro Jun 22, 2026
44b1e81
Analysis refactor for #8425 (#8478)
aspeddro Jun 22, 2026
7f15521
Fix build crash when compiler output is not valid UTF-8 (#8482)
nathan-tranquilla Jun 22, 2026
3fd24bb
Tell agents to add a CHANGELOG entry for user-facing changes (#8483)
nathan-tranquilla Jun 22, 2026
f4eba01
Update coverage.yml to use OIDC for Codecov (#8474)
cometkim Jun 26, 2026
d37477e
Bump @types/node from 25.6.0 to 25.9.2 (#8462)
dependabot[bot] Jul 2, 2026
70760f6
Bump rollup from 4.60.3 to 4.61.1 (#8463)
dependabot[bot] Jul 2, 2026
3e0b5a9
Bump codecov/codecov-action from 6 to 7 (#8472)
dependabot[bot] Jul 2, 2026
0f85520
Bump vite from 8.0.14 to 8.0.16 (#8476)
dependabot[bot] Jul 2, 2026
ace6624
Bump actions/checkout from 6 to 7 (#8480)
dependabot[bot] Jul 2, 2026
1ce310c
Bump tar from 7.5.11 to 7.5.16 (#8484)
dependabot[bot] Jul 2, 2026
30cd653
Bump js-yaml from 3.14.2 to 3.15.0 (#8490)
dependabot[bot] Jul 2, 2026
868bd08
Bump actions/cache from 5 to 6 (#8489)
dependabot[bot] Jul 2, 2026
6a38bea
destructure record rest elements (#8317)
tsnobip Jul 3, 2026
8cb30c7
Bump rollup from 4.61.1 to 4.62.2 (#8493)
dependabot[bot] Jul 7, 2026
28c3d4a
Add dependabot ignore for awalsh128/cache-apt-pkgs-action (#8495)
cknitt Jul 8, 2026
c3ac921
Merge branch 'master' into jono/remove-sig-class
JonoPrest Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "weekly"
ignore:
# Versions >1.4.3 interfere with caching done by our own CI script,
# causing the dune binary not to be found anymore.
- dependency-name: "awalsh128/cache-apt-pkgs-action"
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
git config --system core.longpaths true

- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand All @@ -111,7 +111,7 @@ jobs:

- name: Restore rewatch build cache
id: rewatch-build-cache
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: rewatch/target
key: rewatch-build-v3-${{ matrix.rust-target }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:

- name: Restore OPAM environment
id: cache-opam-env
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: |
${{ runner.tool_cache }}/opam
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:

- name: Cache OPAM environment
if: steps.cache-opam-env.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: |
${{ runner.tool_cache }}/opam
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:
- name: Restore compiler build state
if: github.base_ref == 'master' || github.ref == 'refs/heads/master'
id: compiler-build-state
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: |
C:\.cache\dune
Expand All @@ -284,7 +284,7 @@ jobs:

- name: Save compiler build state
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: |
C:\.cache\dune
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:
#
# - name: Restore previous benchmark data
# if: matrix.benchmarks
# uses: actions/cache/restore@v5
# uses: actions/cache/restore@v6
# with:
# path: ./tests/benchmark-cache
# key: syntax-benchmark-v1
Expand All @@ -369,7 +369,7 @@ jobs:

# - name: Save benchmark data as new baseline
# if: matrix.benchmarks && github.ref == 'refs/heads/master'
# uses: actions/cache/save@v5
# uses: actions/cache/save@v6
# with:
# path: ./tests/benchmark-cache
# key: syntax-benchmark-v1
Expand Down Expand Up @@ -476,7 +476,7 @@ jobs:
PLAYGROUND_BUNDLE_ID: master
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -521,7 +521,7 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -554,7 +554,7 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout rescript-lang.org
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
repository: rescript-lang/rescript-lang.org
ssh-key: ${{ secrets.RESCRIPT_LANG_ORG_DEPLOY_KEY }}
Expand Down Expand Up @@ -601,7 +601,7 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Run make in dev container
uses: devcontainers/ci@v0.3
with:
Expand All @@ -623,7 +623,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -683,7 +683,7 @@ jobs:
node-version: 22

- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Make test directory
id: tmp-dir
Expand Down Expand Up @@ -727,7 +727,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -757,7 +757,7 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ env:
jobs:
coverage:
runs-on: ubuntu-24.04-arm
permissions:
actions: write # For build cache overwriting
id-token: write # For CodeCov OIDC
env:
OS: ubuntu-24.04-arm
OCAML_COMPILER: 5.3.0
RUST_TARGET: aarch64-unknown-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v6
Expand All @@ -48,7 +51,7 @@ jobs:
# and the cargo build when the rewatch sources haven't changed.
- name: Restore rewatch build cache
id: rewatch-build-cache
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: rewatch/target
key: rewatch-build-v3-${{ env.RUST_TARGET }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:

- name: Restore OPAM environment
id: cache-opam-env
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: |
${{ runner.tool_cache }}/opam
Expand Down Expand Up @@ -124,7 +127,7 @@ jobs:
# still get full restore from the latest master-saved cache.
- name: Save OPAM environment
if: steps.cache-opam-env.outputs.cache-hit != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: |
${{ runner.tool_cache }}/opam
Expand Down Expand Up @@ -165,7 +168,7 @@ jobs:
- name: Restore coverage build state
if: github.base_ref == 'master' || github.ref == 'refs/heads/master'
id: coverage-build-state
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: |
~/.cache/dune
Expand All @@ -188,16 +191,16 @@ jobs:

- name: Save coverage build state
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: |
~/.cache/dune
_build
key: ${{ steps.coverage-build-state-key.outputs.value }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
uses: codecov/codecov-action@v7
with:
files: _coverage/coverage.json
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
use_oidc: true
2 changes: 0 additions & 2 deletions .ocamlformat-ignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
compiler/js_parser/**
**/*.cppo.ml
**/*.cppo.mli
compiler/syntax/compiler-libs-406/*
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ tests/
- Unit tests for utility functions
- Always check JavaScript output quality

4. **Add a `CHANGELOG.md` entry** for any user-facing change (bug fix, feature, or breaking change). Put it under the matching section of the current `(Unreleased)` version and end the line with the PR link. See [CONTRIBUTING.md](CONTRIBUTING.md). PRs are expected to include one.

### Debugging Techniques

#### View Intermediate Representations
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

- Add a first-class `taggedTemplate<'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`). https://github.com/rescript-lang/rescript/pull/8461
- Make mutation of private record mutable fields a configurable warning instead of a hard error. https://github.com/rescript-lang/rescript/pull/8366
- Add support for pattern matching/destructuring of record rest. https://github.com/rescript-lang/rescript/pull/8317

#### :bug: Bug fix

Expand All @@ -37,6 +38,8 @@
- Fix formatting of trailing comments before `=` in let bindings. https://github.com/rescript-lang/rescript/pull/8444
- Fix analysis namespace parsing after the Yojson migration. https://github.com/rescript-lang/rescript/pull/8454
- Fix namespaced reference lookup in editor analysis. https://github.com/rescript-lang/rescript/pull/8455
- Fix analysis segmentation fault for references after https://github.com/rescript-lang/rescript/pull/7887. https://github.com/rescript-lang/rescript/pull/8477
- Fix build crash when the compiler emits output that is not valid UTF-8, such as a truncated multibyte character in a code frame. https://github.com/rescript-lang/rescript/pull/8482

#### :memo: Documentation

Expand Down Expand Up @@ -67,6 +70,10 @@
- Analysis refactor: remove global state `Shared_types.state`. https://github.com/rescript-lang/rescript/pull/8465
- Refactor analysis CLI helpers to use source input. https://github.com/rescript-lang/rescript/pull/8466
- Include syntax, gentype, analysis, tools, and reanalyze tests in coverage reports. https://github.com/rescript-lang/rescript/pull/8467
- Remove the unreachable `Longident.Lapply` constructor (OCaml's applicative-functor path syntax `F(X).t`, which ReScript's grammar cannot produce). https://github.com/rescript-lang/rescript/pull/8469
- Refactor analysis for server side use. https://github.com/rescript-lang/rescript/pull/8478
- Remove unused files. https://github.com/rescript-lang/rescript/pull/8481
- Remove the dead `Sig_class`/`Sig_class_type` signature variants (OCaml class items, which ReScript cannot produce). https://github.com/rescript-lang/rescript/pull/8470

# 13.0.0-alpha.4

Expand Down
2 changes: 1 addition & 1 deletion analysis/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ let main () =
| [_; "format"; path] -> Cli.format ~path
| [_; "test"; path] -> Cli.test ~state ~path
| [_; "cmt"; rescript_json; cmt_path] ->
Cmt_viewer.dump ~state rescript_json cmt_path
Cli.dump_cmt ~state ~rescript_json ~cmt_path
| args when List.mem "-h" args || List.mem "--help" args -> prerr_endline help
| _ ->
prerr_endline help;
Expand Down
74 changes: 70 additions & 4 deletions analysis/reanalyze/src/dead_value.ml
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,78 @@ let rec collect_expr ~config ~refs ~file_deps ~cross_file
With this annotation we declare a new type for each branch to allow the
function to be typed.
*)
let collect_pattern ~config ~refs :
let type_path_candidates ~file ~(module_path : Module_path.t) path =
let path = Dce_path.from_path_t path in
let module_context =
module_path.path @ [File_context.module_name_tagged file]
in
let add_unique paths path =
if List.exists (fun existing -> existing = path) paths then paths
else path :: paths
in
[path; path @ module_context]
|> List.fold_left
(fun paths path ->
[
path;
Dce_path.module_to_implementation path;
Dce_path.module_to_interface path;
]
|> List.fold_left add_unique paths)
[]

let add_record_label_type_references ~config ~refs ~pos_from labels =
labels
|> List.iter (fun {Types.ld_loc = {loc_start = pos_to; loc_ghost}; _} ->
if not loc_ghost then
Dead_type.add_type_reference ~config ~refs ~pos_from ~pos_to)

let add_record_rest_type_references_from_path ~config ~decls ~refs ~file
~module_path ~pos_from rest =
if !Config.analyze_types then
match (Ctype.repr rest.Typedtree.rest_type).desc with
| Types.Tconstr (path, _, _) ->
let type_paths = type_path_candidates ~file ~module_path path in
decls |> Declarations.builder_to_list
|> List.iter (fun (_, decl) ->
match (decl.Decl.decl_kind, decl.path) with
| RecordLabel, _label :: type_path
when List.exists
(fun candidate -> candidate = type_path)
type_paths ->
Dead_type.add_type_reference ~config ~refs ~pos_from
~pos_to:decl.pos
| _ -> ())
| _ -> ()

let add_record_rest_type_references ~config ~decls ~refs ~file ~module_path
~pos_from ~env rest =
if !Config.analyze_types then
match
try Some (Ctype.extract_concrete_typedecl env rest.Typedtree.rest_type)
with Not_found -> None
with
| Some (_, _, {Types.type_kind = Type_record (labels, _)}) ->
add_record_label_type_references ~config ~refs ~pos_from labels
| _ ->
add_record_rest_type_references_from_path ~config ~decls ~refs ~file
~module_path ~pos_from rest

let collect_pattern ~config ~decls ~refs ~file ~module_path :
_ -> _ -> Typedtree.pattern -> Typedtree.pattern =
fun super self pat ->
let pos_from = pat.Typedtree.pat_loc.loc_start in
(match pat.pat_desc with
| Typedtree.Tpat_record (cases, _clodsedFlag) ->
| Typedtree.Tpat_record (cases, _clodsedFlag, rest) -> (
cases
|> List.iter (fun (_loc, {Types.lbl_loc = {loc_start = pos_to}}, _pat, _) ->
if !Config.analyze_types then
Dead_type.add_type_reference ~config ~refs ~pos_from ~pos_to)
Dead_type.add_type_reference ~config ~refs ~pos_from ~pos_to);
match rest with
| None -> ()
| Some rest ->
add_record_rest_type_references ~config ~decls ~refs ~file ~module_path
~pos_from:rest.rest_name.loc.loc_start ~env:pat.pat_env rest)
| _ -> ());
super.Tast_mapper.pat self pat

Expand Down Expand Up @@ -331,7 +393,11 @@ let traverse_structure ~config ~decls ~refs ~file_deps ~cross_file ~file
e
|> collect_expr ~config ~refs ~file_deps ~cross_file ~last_binding
super mapper);
pat = (fun _self p -> p |> collect_pattern ~config ~refs super mapper);
pat =
(fun _self p ->
p
|> collect_pattern ~config ~decls ~refs ~file ~module_path super
mapper);
structure_item =
(fun _self (structure_item : Typedtree.structure_item) ->
let modulePath_for_item_opt =
Expand Down
Loading