Skip to content

Commit 41103ba

Browse files
Merge master and migrate clean changelog to a fragment
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
2 parents 7795392 + 8d51b9c commit 41103ba

533 files changed

Lines changed: 11646 additions & 15195 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/pull_request_template.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Checklist
2+
3+
- [ ] Added a changelog fragment (see `changes/README.md`), or no release notes are needed and a maintainer should apply `changelog:skip`.
4+
- [ ] Added tests for the fix or feature.
5+
- [ ] Signed off every commit for the DCO (`git commit -s`).

‎.github/workflows/changelog.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Changelog
2+
3+
on:
4+
push:
5+
branches: [master, 11.0_release]
6+
7+
# Label events rerun only this check, so applying changelog:skip or
8+
# changelog:release does not restart the main CI.
9+
pull_request:
10+
types: [opened, synchronize, reopened, labeled, unlabeled]
11+
branches: [master, 11.0_release]
12+
13+
concurrency:
14+
group: changelog-${{ github.ref }}
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
changelog:
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- uses: actions/checkout@v7
25+
with:
26+
fetch-depth: 0
27+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
28+
- uses: actions/setup-node@v6
29+
with:
30+
node-version: 22
31+
- run: node --test scripts/changelog.test.js
32+
- run: node scripts/changelog.js check

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ jobs:
190190
- name: Version Check
191191
run: yarn constraints
192192

193+
- name: Test release plan
194+
run: yarn test-release-plan
195+
193196
- name: Run tests
194197
run: node scripts/test.js -all
195198

‎AGENTS.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ relevant guidance from each.
6868
### Commit Standards
6969

7070
- Use DCO sign-off: `Signed-Off-By: Your Name <email>`
71+
- Put the sign-off in the final paragraph of the message, next to any other
72+
trailers such as `Co-Authored-By:`, with no blank line between them. Git only
73+
parses the last paragraph as trailers, so a sign-off separated by a blank
74+
line doesn't count. Check with
75+
`git log -1 --format=%B | git interpret-trailers --parse`.
7176
- Include appropriate tests with all changes
7277
- Build must pass before committing
7378

@@ -92,7 +97,7 @@ on `master`. CI runs on every PR in the stack.
9297

9398
## Testing and changelog
9499

95-
**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.
100+
**Add a changelog fragment** `changes/<description>.<category>.md` for any user-facing change (bug fix, feature, or breaking change) instead of editing `CHANGELOG.md`; see [changes/README.md](changes/README.md) for categories and format. Validate with `yarn changelog:check`. Since the PR number is not known yet, open the PR as a draft with the placeholder link `https://github.com/rescript-lang/rescript/pull/XXXX`, then replace it with the real link, amend, push again, and mark the PR ready for review (`gh pr ready`).
96101

97102
For compiler or standard-library changes, run `make test`. For syntax changes,
98103
also run `make test-syntax`; use `make test-syntax-roundtrip` when parsing or

‎CHANGELOG.md‎

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
> **Tags:**
44
>
55
> - :boom: [Breaking Change]
6-
> - :eyeglasses: [Spec Compliance]
76
> - :rocket: [New Feature]
87
> - :bug: [Bug Fix]
98
> - :memo: [Documentation]
@@ -14,16 +13,33 @@
1413

1514
#### :boom: Breaking Change
1615

16+
- `\"_"` is no longer allowed as a quoted identifier, as it couldn't be told apart from the `_` wildcard and placeholder. https://github.com/rescript-lang/rescript/pull/8795
17+
- Record syntax no longer creates or matches dicts, e.g. `let d: dict<int> = {foo: 1}`; it's an error pointing to `dict{...}`. https://github.com/rescript-lang/rescript/pull/8751
1718
- Remove the call-site `@inlined` attribute, which was parsed but never affected code generation. It is now reported as a misplaced attribute (warning 53). https://github.com/rescript-lang/rescript/pull/8734
1819
- Remove `@deriving(abstract)` and `@deriving(jsConverter)`. Use record types (with optional fields, mutable fields and `@as` renaming) and polymorphic variants directly instead. https://github.com/rescript-lang/rescript/pull/8729
1920

20-
#### :eyeglasses: Spec Compliance
21-
2221
#### :rocket: New Feature
2322

23+
- Support Windows 11 on ARM by installing the x64 binaries, which Windows runs through its x64 emulation. https://github.com/rescript-lang/rescript/pull/8776
24+
- Allow `$` in identifiers, e.g. `let count$ = signal(0)`. https://github.com/rescript-lang/rescript/pull/8791
25+
- Allow an untagged variant to have both a boolean literal case and a boolean payload case, e.g. `@unboxed type t = | @as(true) A | B(bool)`, like for strings and numbers. https://github.com/rescript-lang/rescript/pull/8777
26+
2427
#### :bug: Bug fix
2528

26-
- Allow `rescript clean` to remove generated files when the source module graph is invalid. https://github.com/rescript-lang/rescript/pull/8640
29+
- Fix parser recovery and editor completion when a record or dict value is missing before a comma, e.g. `{a: , b: 1}`. https://github.com/rescript-lang/rescript/pull/8779
30+
- Derive module names from file names consistently, fixing files like `Button.test.res` that could not reference `Button`, and `.res`/`.resi` pairs with dotted or non-ASCII names. https://github.com/rescript-lang/rescript/pull/8797
31+
- Fix the formatter printing escaped identifiers starting with `_`, like `\"_'"`, in a form that doesn't parse. https://github.com/rescript-lang/rescript/pull/8795
32+
- Fix references to a `@val` global reading a binding with the same name, e.g. a toplevel `let` declared before them. https://github.com/rescript-lang/rescript/pull/8785
33+
- Evaluate the unused arguments of an inlined function call in parameter order. https://github.com/rescript-lang/rescript/pull/8786
34+
- Fix shadowed variables in generated JS colliding with identifiers or external names containing `$`. https://github.com/rescript-lang/rescript/pull/8778
35+
- Fix editor completion of values from modules included with `include await M`. https://github.com/rescript-lang/rescript/pull/8770
36+
- Fix editor completion inside dict literals and dict patterns, which suggested untyped values. https://github.com/rescript-lang/rescript/pull/8770
37+
- Report the required Node.js version 22 when the platform package can't be found. https://github.com/rescript-lang/rescript/pull/8770
38+
- Fix JSX preserve mode emitting JSX that means something other than the compiled call, and keep more elements as JSX. https://github.com/rescript-lang/rescript/pull/8754
39+
- Fix exhaustiveness and unused-case checks for dict patterns that match the same key in several cases, print their counter-examples as dict patterns, and reject a key matched twice in one pattern. https://github.com/rescript-lang/rescript/pull/8751
40+
- Emit `"__proto__"` keys in object literals as computed keys, so they create a property instead of setting the prototype. https://github.com/rescript-lang/rescript/pull/8747
41+
- Fix the formatter dropping attributes on dict literals and flattening nested dict spreads. https://github.com/rescript-lang/rescript/pull/8746
42+
- Fix attributes on patterns being duplicated before `as` and dropped on constants when formatting. https://github.com/rescript-lang/rescript/pull/8750
2743
- Fix compiler crashes when wrapping values in `Some` or passing optional arguments whose types come from a transitive dependency. https://github.com/rescript-lang/rescript/pull/8719
2844
- Fix unused-pattern warnings for variant spreads reported without a location. https://github.com/rescript-lang/rescript/pull/8744
2945
- Keep `@warning("-4")` on `if` expressions when formatting; the formatter dropped it. https://github.com/rescript-lang/rescript/pull/8741
@@ -43,6 +59,18 @@
4359

4460
#### :nail_care: Polish
4561

62+
- Speed up type checking of record expressions and patterns with many fields whose type is not known from context. https://github.com/rescript-lang/rescript/pull/8799
63+
- Print list literals with one list cell per line, so their output no longer grows quadratically with their length. https://github.com/rescript-lang/rescript/pull/8794
64+
- Compile dict spreads to object spread syntax instead of `Object.assign`. https://github.com/rescript-lang/rescript/pull/8747
65+
- Make compilation slightly faster and stop rewatch from copying files twice for modules with an interface. https://github.com/rescript-lang/rescript/pull/8769
66+
- Speed up inlining decisions for large functions. https://github.com/rescript-lang/rescript/pull/8771
67+
- Speed up the rewriting of JS globals shadowed by local bindings in nested functions. https://github.com/rescript-lang/rescript/pull/8772
68+
- Speed up dead code elimination of toplevel bindings in large modules. https://github.com/rescript-lang/rescript/pull/8773
69+
- Make .cmt and .cmti files smaller by no longer embedding a copy of the .cmi. https://github.com/rescript-lang/rescript/pull/8774
70+
- Use the OCaml standard library's hash tables in the compiler. https://github.com/rescript-lang/rescript/pull/8786
71+
- Use the OCaml standard library's hash tables for the compiler's hash sets, and always order the imports of a module used both with and without `default` the same way. https://github.com/rescript-lang/rescript/pull/8787
72+
- Use the OCaml standard library's sets in the compiler. https://github.com/rescript-lang/rescript/pull/8789
73+
- Use the OCaml standard library's maps in the compiler. https://github.com/rescript-lang/rescript/pull/8790
4674
- Represent explicit expression braces as `Pexp_braces` in parsetree v1 and format `else` branches consistently with `if` branches. https://github.com/rescript-lang/rescript/pull/8678
4775
- Omit redundant braces around multi-statement switch case bodies when formatting. https://github.com/rescript-lang/rescript/pull/8677
4876
- Avoid running `rescript-schema-ppx` and `sury-ppx` on source files without an `@schema` annotation. https://github.com/rescript-lang/rescript/pull/8662
@@ -51,6 +79,15 @@
5179

5280
#### :house: Internal
5381

82+
- Remove OCaml leftovers: unused warning numbers, the `Record_float_unused` representation, the `ns.braces` attribute name and unused `Ast_helper` functions. https://github.com/rescript-lang/rescript/pull/8805
83+
- Remove the S-expression parsetree printer (`res_parser -print sexp`). https://github.com/rescript-lang/rescript/pull/8803
84+
- Use one set of OCaml warning flags for the whole repository, including the editor analysis and tools. https://github.com/rescript-lang/rescript/pull/8796
85+
- Remove the unused `Packed` and `Partial_class_expr` constructors from the `.cmt` format and bump its magic number. https://github.com/rescript-lang/rescript/pull/8793
86+
- Make `dict` an abstract type instead of a record with a hidden field. https://github.com/rescript-lang/rescript/pull/8752
87+
- Remove dead code from the compiler and rewatch. https://github.com/rescript-lang/rescript/pull/8756
88+
- Represent dict patterns with a dedicated `Tpat_dict` typed tree node. https://github.com/rescript-lang/rescript/pull/8751
89+
- Represent dict patterns with a dedicated `Ppat_dict` node. https://github.com/rescript-lang/rescript/pull/8749
90+
- Represent dict literals with dedicated `Pexp_dict` and `Texp_dict` nodes. https://github.com/rescript-lang/rescript/pull/8746
5491
- Forward-port integer range pattern regression coverage from v12 to v13. https://github.com/rescript-lang/rescript/pull/8718
5592
- Remove the unused `res.iflet` encoding of `if let`, which the parser always rejects with a syntax error suggesting a `switch`. The error is unchanged. https://github.com/rescript-lang/rescript/pull/8741
5693
- Represent variant spread patterns (`...t`) with a dedicated `Ppat_variant_spread` parsetree node instead of `Ppat_type` with a `res.patVariantSpread` attribute, which remains only in the PPX wire representation. https://github.com/rescript-lang/rescript/pull/8742
@@ -62,6 +99,7 @@
6299
- Remove the unused `pat_record_label` alias from the current parsetree. https://github.com/rescript-lang/rescript/pull/8684
63100
- Remove the unused `Ppat_open` and `Tpat_open` AST nodes, with current-AST and CMT format bumps. https://github.com/rescript-lang/rescript/pull/8682
64101
- Represent ternary expressions with a dedicated parsetree node. https://github.com/rescript-lang/rescript/pull/8674
102+
- Remove the compiler's own growable vector (`Vec`) in favor of plain arrays. https://github.com/rescript-lang/rescript/pull/8784
65103

66104
# 13.0.0-alpha.6
67105

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ Adding a new entry there requires re-running the analysis tests. Follow these st
510510

511511
(If a `make` command fails, consider using the [DevContainer](#b-devcontainer).)
512512

513-
Finally, add a line to [CHANGELOG.md](CHANGELOG.md), using the `#### :nail_care: Polish` section.
513+
Finally, add a `changes/<description>.polish.md` fragment following [the changelog instructions](changes/README.md).
514514

515515
## Code structure
516516

@@ -572,7 +572,7 @@ The repository's `npm-release` GitHub environment should have required reviewers
572572
To build a new version and release it on NPM, follow these steps:
573573

574574
1. Verify that the version number is already set correctly for the release. (It should have been incremented after releasing the previous version.)
575-
1. Create a PR to update `CHANGELOG.md`, removing the "(Unreleased)" for the version to be released.
575+
1. Run `yarn changelog:preview` to review pending notes, then `yarn changelog:release` to collect fragments into `CHANGELOG.md`, remove "(Unreleased)", and delete consumed fragments. Create a PR containing these changes, review the combined release notes, and apply the `changelog:release` label. Existing unreleased entries are preserved. If more fragments are merged before publishing, the `Publish` workflow refuses to run; repeat this step to add them to the same version. Don't run `yarn changelog:release` while a `Publish` run is in progress: it could add notes for changes that the run is not publishing.
576576
1. Once that PR is merged and built successfully, run the `Publish` workflow from the GitHub Actions tab. Use the "Run workflow" branch dropdown to select the release branch (normally `master`, or the relevant maintenance branch) and indicate whether this is the current stable release. The version is read from that branch's `package.json`, and the npm tag is derived automatically:
577577
- A current stable release is published as `latest`.
578578
- A stable maintenance release for an older major is published as `latest-<major>`, for example `latest-12`.
@@ -585,7 +585,7 @@ To build a new version and release it on NPM, follow these steps:
585585
1. Create a PR with the following changes to prepare for development of the next version:
586586
- Increment the `EXPECTED_VERSION` number in `yarn.config.cjs` for the next version.
587587
- Run `yarn constraints --fix` to take that version number over into other files.
588-
- Update `CHANGELOG.md` and add an entry for the next version, e.g., "10.0.0-beta.2 (Unreleased)"
588+
- Run `yarn changelog:open` to add the empty "(Unreleased)" section for the next version to `CHANGELOG.md`, and apply the `changelog:release` label to the PR.
589589

590590
## Debugging issues from CI builds
591591

‎analysis/reanalyze/src/arnold.ml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,11 @@ module Compile = struct
990990
[e1; e2] |> List.map (expression ~ctx) |> Command.unordered_sequence
991991
| Texp_tuple expressions | Texp_array expressions ->
992992
expressions |> List.map (expression ~ctx) |> Command.unordered_sequence
993+
| Texp_dict entries ->
994+
entries
995+
|> List.map (function Typedtree.Tdict_entry (_, e) | Tdict_spread e ->
996+
expression ~ctx e)
997+
|> Command.unordered_sequence
993998
| Texp_assert _ -> Command.nothing
994999
| Texp_try (e, cases) ->
9951000
let c_e = e |> expression ~ctx in

‎analysis/reanalyze/src/dune‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
(name reanalyze)
33
(instrumentation
44
(backend bisect_ppx))
5-
(flags
6-
(-w "+6+26+27+32+33+39"))
75
(libraries reactive yojson ml str unix))

‎analysis/reanalyze/src/file_deps.ml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ end)
1212

1313
(** {2 Types} *)
1414

15-
type t = {
16-
files: String_set.t;
15+
type builder = {
16+
mutable files: String_set.t;
1717
deps: String_set.t File_hash.t; (* from_file -> set of to_files *)
1818
}
1919

20-
type builder = {mutable files: String_set.t; deps: String_set.t File_hash.t}
21-
2220
(** {2 Builder API} *)
2321

2422
let create_builder () : builder =
Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
(** File dependencies collected during AST processing.
2-
3-
Tracks which files reference which other files.
4-
Two types are provided:
5-
- [builder] - mutable, for AST processing
6-
- [t] - immutable, for analysis *)
72
8-
(** {2 Types} *)
9-
10-
type t
11-
(** Immutable file dependencies - for analysis *)
3+
Tracks which files reference which other files. *)
124

135
type builder
146
(** Mutable builder - for AST processing *)
@@ -21,7 +13,7 @@ val add_file : builder -> string -> unit
2113
(** Register a file as existing (even if it has no outgoing refs). *)
2214

2315
val add_dep : builder -> from_file:string -> to_file:string -> unit
24-
(** Merge all builders into one immutable result. Order doesn't matter. *)
16+
(** Record that [from_file] references [to_file]. *)
2517

2618
(** {2 Builder extraction for reactive merge} *)
2719

@@ -30,9 +22,3 @@ val builder_files : builder -> String_set.t
3022

3123
val builder_deps_to_list : builder -> (string * String_set.t) list
3224
(** Extract all deps as a list for reactive merge *)
33-
34-
(** {2 Internal types (for Reactive_merge)} *)
35-
36-
module File_hash : Hashtbl.S with type key = string
37-
(** Iterate over files in topological order (roots first, leaves last).
38-
Files with no incoming references are processed first. *)

0 commit comments

Comments
 (0)