Skip to content

Commit 7467e76

Browse files
authored
Merge branch 'master' into in-operator
2 parents 63563c7 + 9942dbd commit 7467e76

File tree

320 files changed

+7803
-9690
lines changed

Some content is hidden

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

320 files changed

+7803
-9690
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LABEL org.opencontainers.image.description="Docker image for ReScript developmen
44

55
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
66
&& apt-get -y install --no-install-recommends \
7+
yarn \
78
opam \
89
musl-tools \
910
python-is-python3 \

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
*.mli linguist-language=OCaml
33
*.res linguist-language=ReScript
44
*.resi linguist-language=ReScript
5+
6+
.yarn/releases/* binary linguist-vendored

.github/workflows/ci.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
- name: Checkout
4646
uses: actions/checkout@v4
4747

48+
- name: Use Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version-file: .nvmrc
52+
4853
- name: Restore build cache
4954
id: build-cache
5055
uses: actions/cache@v4
@@ -135,6 +140,7 @@ jobs:
135140
- name: Use Node.js
136141
uses: actions/setup-node@v4
137142
with:
143+
cache: yarn
138144
node-version-file: .nvmrc
139145

140146
- name: Get artifact dir name
@@ -151,7 +157,7 @@ jobs:
151157
# matrix.ocaml_compiler may contain commas
152158
- name: Get OPAM cache key
153159
shell: bash
154-
run: echo "opam_cache_key=opam-env-v7-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" | sed 's/,/-/g' >> $GITHUB_ENV
160+
run: echo "opam_cache_key=opam-env-v7-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
155161

156162
- name: Restore OPAM environment
157163
id: cache-opam-env
@@ -248,7 +254,7 @@ jobs:
248254
id: compiler-build-state-key
249255
shell: bash
250256
run: |
251-
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" \
257+
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" \
252258
| sed 's/,/-/g' >> "$GITHUB_OUTPUT"
253259
254260
- name: Restore compiler build state
@@ -270,6 +276,18 @@ jobs:
270276
if: runner.os == 'Linux'
271277
run: opam exec -- dune build --display quiet --profile static
272278

279+
- name: Delete stable compiler build state
280+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
281+
shell: bash
282+
run: |
283+
gh extension install actions/gh-actions-cache
284+
gh actions-cache delete ${{ steps.compiler-build-state-key.outputs.value }} \
285+
-R ${{ github.repository }} \
286+
-B ${{ github.ref }} \
287+
--confirm || echo "not exist"
288+
env:
289+
GH_TOKEN: ${{ github.token }}
290+
273291
- name: Save compiler build state
274292
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
275293
uses: actions/cache/save@v4
@@ -281,7 +299,7 @@ jobs:
281299
key: ${{ steps.compiler-build-state-key.outputs.value }}
282300

283301
- name: Install npm packages
284-
run: npm ci --ignore-scripts
302+
run: yarn install
285303

286304
- name: Copy compiler exes to platform bin dir
287305
run: node ./scripts/copyExes.js -compiler
@@ -388,11 +406,11 @@ jobs:
388406
run: |
389407
opam exec -- node packages/playground-bundling/scripts/generate_cmijs.js
390408
opam exec -- dune build --profile browser
391-
cp ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js playground/compiler.js
409+
cp ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js playground/compiler.cjs
392410
393411
- name: Test playground compiler
394412
if: matrix.build_playground
395-
run: node playground/playground_test.js
413+
run: node playground/playground_test.cjs
396414

397415
- name: Upload playground compiler to CDN
398416
if: ${{ matrix.build_playground && startsWith(github.ref, 'refs/tags/v') }}
@@ -429,10 +447,11 @@ jobs:
429447
- name: Use Node.js
430448
uses: actions/setup-node@v4
431449
with:
450+
cache: yarn
432451
node-version-file: .nvmrc
433452

434453
- name: NPM install
435-
run: npm ci --ignore-scripts
454+
run: yarn install
436455

437456
- name: Download artifacts
438457
uses: actions/download-artifact@v4
@@ -523,6 +542,7 @@ jobs:
523542
- name: Use Node.js
524543
uses: actions/setup-node@v4
525544
with:
545+
cache: yarn
526546
node-version-file: .nvmrc
527547
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
528548

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const fs = require("fs");
2-
const os = require("os");
1+
import * as fs from "node:fs";
2+
import * as os from "node:os";
33

4-
const { dirName: artifactDirName } = require("../../cli/bin_path.js");
4+
import { platformName } from "#cli/bins";
55

66
// Pass artifactDirName to subsequent GitHub actions
77
fs.appendFileSync(
88
process.env.GITHUB_ENV,
9-
`artifact_dir_name=${artifactDirName}${os.EOL}`,
9+
`artifact_dir_name=${platformName}${os.EOL}`,
1010
);

.github/workflows/prepare_package_upload.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
const fs = require("fs");
2-
const os = require("os");
1+
import * as fs from "node:fs";
2+
import * as os from "node:os";
3+
4+
import packageSpec from "rescript/package.json" with { type: "json" };
35

4-
const packageSpec = require("rescript/package.json");
56
const { version } = packageSpec;
67

78
const commitHash = process.argv[2] || process.env.GITHUB_SHA;

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ playground/stdlib/
7272
playground/*.cmj
7373
playground/*.cmi
7474
playground/.netrc
75-
playground/compiler.js
75+
playground/compiler.*js
7676

7777
rewatch/target/
7878
rewatch/rewatch
@@ -81,3 +81,12 @@ tests/tools_tests/**/*.res.js
8181
tests/tools_tests/lib
8282
tests/analysis_tests*/lib
8383
tests/analysis_tests/**/*.bs.js
84+
85+
.yarn/*
86+
!.yarn/patches
87+
!.yarn/plugins
88+
!.yarn/releases
89+
!.yarn/sdks
90+
!.yarn/versions
91+
92+
*.tsbuildinfo

.yarn/releases/yarn-4.7.0.cjs

Lines changed: 935 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
yarnPath: .yarn/releases/yarn-4.7.0.cjs
2+
3+
nodeLinker: node-modules
4+
5+
nmMode: hardlinks-global
6+
7+
defaultSemverRangePrefix: ""

CHANGELOG.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,55 @@
1010
> - :house: [Internal]
1111
> - :nail_care: [Polish]
1212
13-
# 12.0.0-alpha.10 (Unreleased)
13+
# 12.0.0-alpha.11 (Unreleased)
14+
15+
#### :bug: Bug fix
16+
17+
- Fix `Error.fromException`. https://github.com/rescript-lang/rescript/pull/7364
18+
- Fix signature of `throw`. https://github.com/rescript-lang/rescript/pull/7365
19+
20+
#### :house: Internal
21+
22+
- Remove `Stdlib_Char` module for now. https://github.com/rescript-lang/rescript/pull/7367
23+
- Convert internal JavaScript codebase into ESM, ReScript package itself is now ESM (`"type": "module"`). https://github.com/rescript-lang/rescript/pull/6899
24+
- Add built-in support for the JavaScript `in` operator. https://github.com/rescript-lang/rescript/pull/7342
25+
26+
# 12.0.0-alpha.10
1427

1528
#### :rocket: New Feature
1629

1730
- Add `Dict.has` and double `Dict.forEachWithKey`/`Dict.mapValues` performance. https://github.com/rescript-lang/rescript/pull/7316
18-
- Add popover attributes to JsxDOM.domProps. https://github.com/rescript-lang/rescript/pull/7317
31+
- Add popover attributes to `JsxDOM.domProps`. https://github.com/rescript-lang/rescript/pull/7317
1932
- Add `Array.removeInPlace` helper based on `splice`. https://github.com/rescript-lang/rescript/pull/7321
2033
- Add `inert` attribute to `JsxDOM.domProps`. https://github.com/rescript-lang/rescript/pull/7326
2134
- Make reanalyze exception tracking work with the new stdlib. https://github.com/rescript-lang/rescript/pull/7328
22-
- Fix Pervasive.max using boolean comparison for floats. https://github.com/rescript-lang/rescript/pull/7333
35+
- Fix `Pervasive.max` using boolean comparison for floats. https://github.com/rescript-lang/rescript/pull/7333
2336
- Experimental: Support nested/inline record types - records defined inside of other records, without needing explicit separate type definitions. https://github.com/rescript-lang/rescript/pull/7241
2437
- Add unified exponentiation (`**`) operator for numeric types using ES7 `**`. https://github.com/rescript-lang/rescript-compiler/pull/7153
25-
- Add built-in support for the JavaScript `in` operator. https://github.com/rescript-lang/rescript/pull/7342
38+
- Rename `raise` to `throw` to align with JavaScript vocabulary. `raise` has been deprecated. https://github.com/rescript-lang/rescript/pull/7346
39+
- Add unified bitwise (`^`) operator. https://github.com/rescript-lang/rescript/pull/7216
40+
- Stdlib: rename binary operations to match JavaScript terms. https://github.com/rescript-lang/rescript/pull/7353
2641

2742
#### :boom: Breaking Change
2843

29-
- Replace ~date with ~day in Date.make\*. https://github.com/rescript-lang/rescript/pull/7324
44+
- Replace `~date` with `~day` in `Date.make`. https://github.com/rescript-lang/rescript/pull/7324
3045
- Remove `-bs-jsx-mode`. https://github.com/rescript-lang/rescript/pull/7327
3146
- Drop Node.js version <20 support, as it is reaching End-of-Life. https://github.com/rescript-lang/rescript-compiler/pull/7354
3247
- Treat `int` multiplication as a normal int32 operation instead of using `Math.imul`. https://github.com/rescript-lang/rescript/pull/7358
3348

3449
#### :house: Internal
3550

3651
- Clean up legacy tags handling. https://github.com/rescript-lang/rescript/pull/7309
52+
- Use Yarn (Berry) workspaces for internal tooling. https://github.com/rescript-lang/rescript/pull/7309
3753

3854
#### :nail_care: Polish
3955

40-
- Deprecate JSON.Classify.classify. https://github.com/rescript-lang/rescript/pull/7315
56+
- Deprecate `JSON.Classify.classify`. https://github.com/rescript-lang/rescript/pull/7315
4157
- Hide stdlib modules in output. https://github.com/rescript-lang/rescript/pull/7305
4258
- Deprecate unsafe host-specific bindings from stdlib. https://github.com/rescript-lang/rescript/pull/7334
43-
- Make unsafe function names consistent in Stdlib.String. https://github.com/rescript-lang/rescript/pull/7337
59+
- Make unsafe function names consistent in `Stdlib.String`. https://github.com/rescript-lang/rescript/pull/7337
4460
- `rescript` package does not trigger `postinstall` script anymore. https://github.com/rescript-lang/rescript/pull/7350
61+
- Add Stdlib `Bool` and `Char` modules and improve Pervasives deprecation messages. https://github.com/rescript-lang/rescript/pull/7361
4562

4663
#### :bug: Bug fix
4764

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Happy hacking!
1515
> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!
1616
1717
- [Node.js](https://nodejs.org/) v20.x
18+
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
1819
- C compiler toolchain (usually installed with `xcode` on Mac)
1920
- Python <= 3.11 (required to build ninja)
2021
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)
@@ -58,7 +59,7 @@ opam install . --deps-only --with-test --with-dev-setup -y
5859

5960
#### npm install
6061

61-
Run `npm install --ignore-scripts`. This will install the npm dependencies required for the build scripts.
62+
Run `yarn install`. This will install the npm dependencies required for the build scripts.
6263

6364
### B. Devcontainer
6465

@@ -262,7 +263,7 @@ $ node
262263

263264
### Testing the Playground bundle
264265

265-
Run `node playground/playground_test.js` for a quick sanity check to see if all the build artifacts are working together correctly. When releasing the playground bundle, the test will always be executed before publishing to catch regressions.
266+
Run `node playground/playground_test.cjs` for a quick sanity check to see if all the build artifacts are working together correctly. When releasing the playground bundle, the test will always be executed before publishing to catch regressions.
266267

267268
### Working on the Playground JS API
268269

@@ -272,7 +273,7 @@ Whenever you are modifying any files in the ReScript compiler, or in the `jsoo_p
272273
make playground
273274
274275
# optionally run your test / arbitrary node script to verify your changes
275-
node playground/playground_test.js
276+
node playground/playground_test.cjs
276277
```
277278

278279
### Publishing the Playground Bundle on our KeyCDN

0 commit comments

Comments
 (0)