Skip to content

Commit 40e5796

Browse files
committed
Merge branch 'master' into throw-error-instance
2 parents 2cc5bc8 + c7b3dce commit 40e5796

File tree

373 files changed

+2590
-2377
lines changed

Some content is hidden

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

373 files changed

+2590
-2377
lines changed

.github/ISSUE_TEMPLATE.md renamed to .github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
name: 🚨 Bug report
3+
about: Create a report to help us improve the ReScript compiler and build system
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
110
Thank you for filing! Check list:
211

312
- [ ] Is it a bug? Usage questions should often be asked in the [forum](https://forum.rescript-lang.org) instead.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 📝 rescript-lang.org
4+
url: https://github.com/rescript-association/rescript-lang.org/issues
5+
about: Please report problems about the documentation page here.
6+
- name: 💻 rescript-vscode
7+
url: https://github.com/rescript-lang/rescript-vscode/issues
8+
about: VSCode language support, LSP, tools
9+
- name: 📦 create-rescript-app
10+
url: https://github.com/rescript-lang/create-rescript-app/issues
11+
about: ReScript's project generator
12+
- name: ⚛️ rescript-react
13+
url: https://github.com/rescript-lang/rescript-react/issues
14+
about: ReScript bindings to React.js
15+
- name: 🌐 rescript-core
16+
url: https://github.com/rescript-association/rescript-core/issues
17+
about: New ReScript standard library
18+
- name: 💬 ReScript Forum
19+
url: https://forum.rescript-lang.org/
20+
about: For discussions about ReScript, please visit the official ReScript forum.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: 💡 Feature request
3+
about: Suggest a new feature/RFC for the ReScript compiler and build system
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+

.github/workflows/ci.yml

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,22 @@ jobs:
3333

3434
runs-on: ${{matrix.os}}
3535

36-
container:
37-
image: ghcr.io/rescript-lang/rescript-ci-build:alpine-3.19-ocaml-4.14.1-02
38-
3936
steps:
40-
# See https://github.com/actions/runner/issues/801#issuecomment-1374967227.
41-
- name: Workaround for Github actions runner on Alpine arm64
42-
if: runner.arch == 'ARM64'
43-
run: sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release
44-
4537
- name: Checkout
46-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
4739

4840
- name: Build compiler binaries
49-
run: opam exec -- dune build --display quiet --profile static
41+
uses: docker://ghcr.io/rescript-lang/rescript-ci-build:alpine-3.19-ocaml-5.1.1-01
42+
with:
43+
args: opam exec -- dune build --display quiet --profile static
5044

5145
- name: Build ninja binary
52-
working-directory: ninja
53-
env:
54-
LDFLAGS: -static
55-
run: python3 configure.py --bootstrap --verbose
46+
uses: docker://ghcr.io/rescript-lang/rescript-ci-build:alpine-3.19-ocaml-5.1.1-01
47+
with:
48+
args: sh -c "cd ninja && LDFLAGS=-static python3 configure.py --bootstrap"
5649

5750
- name: "Upload artifacts"
58-
uses: actions/upload-artifact@v3
51+
uses: actions/upload-artifact@v4
5952
with:
6053
name: static-binaries-linux-${{runner.arch}}
6154
path: |
@@ -72,11 +65,11 @@ jobs:
7265

7366
steps:
7467
- name: Checkout
75-
uses: actions/checkout@v3
68+
uses: actions/checkout@v4
7669

7770
- name: Download static linux binaries
7871
if: runner.os == 'Linux'
79-
uses: actions/download-artifact@v3
72+
uses: actions/download-artifact@v4
8073
with:
8174
name: static-binaries-linux-${{ runner.arch }}
8275

@@ -87,9 +80,9 @@ jobs:
8780
chmod +x _build/install/default/bin/*
8881
8982
- name: Use Node.js
90-
uses: actions/setup-node@v3
83+
uses: actions/setup-node@v4
9184
with:
92-
node-version: 16
85+
node-version: 18
9386

9487
- name: Copy exes to platform bin dirs
9588
run: node ./scripts/copyExes.js
@@ -98,7 +91,7 @@ jobs:
9891
run: node .github/workflows/get_artifact_info.js
9992

10093
- name: "Upload artifacts: binaries"
101-
uses: actions/upload-artifact@v3
94+
uses: actions/upload-artifact@v4
10295
with:
10396
name: ${{ env.artifact_name }}
10497
path: ${{ env.artifact_path }}
@@ -115,7 +108,7 @@ jobs:
115108
ubuntu-latest,
116109
windows-latest,
117110
]
118-
ocaml_compiler: [4.14.1]
111+
ocaml_compiler: [5.1.1]
119112

120113
runs-on: ${{matrix.os}}
121114

@@ -130,13 +123,13 @@ jobs:
130123
git config --global core.eol lf
131124
132125
- name: Checkout
133-
uses: actions/checkout@v3
126+
uses: actions/checkout@v4
134127
with:
135128
fetch-depth: 2 # to be able to check for changes in subfolder jscomp/syntax later
136129

137130
- name: Download static linux binaries
138131
if: runner.os == 'Linux'
139-
uses: actions/download-artifact@v3
132+
uses: actions/download-artifact@v4
140133
with:
141134
name: static-binaries-linux-${{ runner.arch }}
142135

@@ -158,11 +151,12 @@ jobs:
158151
uses: ocaml/setup-ocaml@v2
159152
if: matrix.os == 'windows-latest'
160153
with:
161-
ocaml-compiler: ${{matrix.ocaml_compiler}}
154+
ocaml-compiler: ocaml-variants.5.1.1+options,ocaml-option-mingw
162155
opam-pin: false
163156
opam-depext: false
164157
opam-repositories: |
165-
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
158+
windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0
159+
sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
166160
default: https://github.com/ocaml/opam-repository.git
167161
168162
- name: "Install OPAM dependencies"
@@ -173,16 +167,16 @@ jobs:
173167
run: opam exec -- dune build --display quiet --profile release
174168

175169
- name: Use Node.js
176-
uses: actions/setup-node@v3
170+
uses: actions/setup-node@v4
177171
with:
178-
node-version: 16
172+
node-version: 18
179173

180174
- name: Install npm packages
181175
run: npm ci --ignore-scripts
182176

183177
- name: "Windows: Use MSVC for ninja build"
184178
if: runner.os == 'Windows'
185-
uses: TheMrMilchmann/setup-msvc-dev@v2
179+
uses: TheMrMilchmann/setup-msvc-dev@v3
186180
with:
187181
arch: x64
188182

@@ -238,7 +232,7 @@ jobs:
238232
# Build the playground compiler on the fastest runner (ubuntu-latest)
239233
- name: Install JSOO
240234
if: matrix.os == 'ubuntu-latest'
241-
run: opam install js_of_ocaml.4.0.0
235+
run: opam install js_of_ocaml.5.6.0
242236

243237
- name: Build playground compiler
244238
if: matrix.os == 'ubuntu-latest'
@@ -256,20 +250,20 @@ jobs:
256250
env:
257251
KEYCDN_USER: ${{ secrets.KEYCDN_USER }}
258252
KEYCDN_PASSWORD: ${{ secrets.KEYCDN_PASSWORD }}
259-
run: sh playground/upload_bundle.sh
253+
run: bash playground/upload_bundle.sh
260254

261255
- name: Prepare artifact upload
262256
run: node .github/workflows/get_artifact_info.js
263257

264258
- name: "Upload artifacts: binaries"
265-
uses: actions/upload-artifact@v3
259+
uses: actions/upload-artifact@v4
266260
with:
267261
name: ${{ env.artifact_name }}
268262
path: ${{ env.artifact_path }}
269263

270264
- name: "Upload artifacts: lib/ocaml"
271265
if: runner.os == 'Linux'
272-
uses: actions/upload-artifact@v3
266+
uses: actions/upload-artifact@v4
273267
with:
274268
name: lib-ocaml
275269
path: lib/ocaml
@@ -280,18 +274,18 @@ jobs:
280274

281275
steps:
282276
- name: Checkout
283-
uses: actions/checkout@v3
277+
uses: actions/checkout@v4
284278

285279
- name: Use Node.js
286-
uses: actions/setup-node@v3
280+
uses: actions/setup-node@v4
287281
with:
288-
node-version: 16
282+
node-version: 18
289283

290284
- name: NPM install
291285
run: npm ci --ignore-scripts
292286

293287
- name: Download artifacts
294-
uses: actions/download-artifact@v3
288+
uses: actions/download-artifact@v4
295289

296290
- name: Move artifacts
297291
run: ./scripts/moveArtifacts.sh
@@ -314,7 +308,7 @@ jobs:
314308
run: node .github/workflows/prepare_package_upload.js ${{ github.event.pull_request.head.sha }}
315309

316310
- name: "Upload artifact: npm packages"
317-
uses: actions/upload-artifact@v3
311+
uses: actions/upload-artifact@v4
318312
with:
319313
name: npm-packages
320314
path: |
@@ -341,15 +335,15 @@ jobs:
341335

342336
steps:
343337
- name: Checkout
344-
uses: actions/checkout@v3
338+
uses: actions/checkout@v4
345339

346340
- name: Use Node.js
347-
uses: actions/setup-node@v3
341+
uses: actions/setup-node@v4
348342
with:
349-
node-version: 16
343+
node-version: 18
350344

351345
- name: Download artifacts
352-
uses: actions/download-artifact@v3
346+
uses: actions/download-artifact@v4
353347
with:
354348
name: npm-packages
355349
path: packages/test
@@ -373,16 +367,16 @@ jobs:
373367

374368
steps:
375369
- name: Checkout
376-
uses: actions/checkout@v3
370+
uses: actions/checkout@v4
377371

378372
- name: Use Node.js
379-
uses: actions/setup-node@v3
373+
uses: actions/setup-node@v4
380374
with:
381-
node-version: 16
375+
node-version: 18
382376
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
383377

384378
- name: Download artifacts
385-
uses: actions/download-artifact@v3
379+
uses: actions/download-artifact@v4
386380
with:
387381
name: npm-packages
388382

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ _opam
1111
CHANGELOG.md
1212
README.md
1313
playground/
14+
.github/ISSUE_TEMPLATE/*.md

CHANGELOG.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,70 @@
1212
1313
# 12.0.0-alpha.1 (Unreleased)
1414

15-
# 11.1.0-rc.2 (Unreleased)
15+
#### :boom: Breaking Change
16+
17+
- `lazy` syntax is no longer supported. If you're using it, use `Lazy` module or `React.lazy_` instead. https://github.com/rescript-lang/rescript-compiler/pull/6342
18+
- Remove handling of attributes with `bs.` prefix (`@bs.as` -> `@as` etc.). https://github.com/rescript-lang/rescript-compiler/pull/6643
19+
- Remove obsolete `@bs.open` feature. https://github.com/rescript-lang/rescript-compiler/pull/6629
20+
- Drop Node.js version <18 support, due to it reaching End-of-Life. https://github.com/rescript-lang/rescript-compiler/pull/6429
21+
22+
#### :house: Internal
23+
24+
- Build with OCaml 5.1.1. https://github.com/rescript-lang/rescript-compiler/pull/6641
25+
26+
#### :nail_care: Polish
27+
28+
- Make the `--help` arg be prioritized in the CLI, so correctly prints help message and skip other commands. https://github.com/rescript-lang/rescript-compiler/pull/6667
29+
30+
# 11.1.0-rc.5
31+
32+
#### :bug: Bug Fix
33+
34+
- Fix misparsing in/after JSX. https://github.com/rescript-lang/rescript-compiler/pull/6686
35+
- Fix `@deriving(accessors)` outputting curried functions in uncurried mode. https://github.com/rescript-lang/rescript-compiler/pull/6687
36+
37+
# 11.1.0-rc.4
38+
39+
#### :bug: Bug Fix
40+
41+
- Fix emitting static import instead of dynamic import. https://github.com/rescript-lang/rescript-compiler/pull/6664
42+
- Fix local type variables breaking react components. https://github.com/rescript-lang/rescript-compiler/pull/6665
43+
- Fix remove redundant branches in generated switch body. https://github.com/rescript-lang/rescript-compiler/pull/6672
44+
- Fix issue in partial application when the last named arg is provided. https://github.com/rescript-lang/rescript-compiler/pull/6681
45+
46+
#### :nail-care: Polish
47+
48+
- Omit `undefined` in external function calls for trailing optional arguments when not supplied. https://github.com/rescript-lang/rescript-compiler/pull/6653
49+
- Make pattern match suggestions to be easier to copy-paste. https://github.com/rescript-lang/rescript-compiler/pull/6656
50+
51+
# 11.1.0-rc.3
52+
53+
#### :nail_care: Polish
54+
55+
- No parens around tagged template literals. https://github.com/rescript-lang/rescript-compiler/pull/6639
56+
- Allow identifier with modules in tagged template literals (e.g. Pg.sql`select * from ${table} where id = ${id}`). https://github.com/rescript-lang/rescript-compiler/pull/6645
57+
58+
#### :bug: Bug Fix
59+
60+
- Fix compiler crash when reexporting tagged template literal externals. https://github.com/rescript-lang/rescript-compiler/pull/6645
61+
62+
# 11.1.0-rc.2
63+
64+
#### :rocket: New Feature
65+
66+
- Add support for array spread. https://github.com/rescript-lang/rescript-compiler/pull/6608
67+
- Support import attributes (https://github.com/tc39/proposal-import-attributes) in `@module()`. https://github.com/rescript-lang/rescript-compiler/pull/6599
68+
- allow hyphens in jsx tag names (e.g. `<mj-column>`). https://github.com/rescript-lang/rescript-compiler/pull/6609
1669

1770
#### :bug: Bug Fix
1871

1972
- Fix issue with async and newtype in uncurried mode. https://github.com/rescript-lang/rescript-compiler/pull/6601
2073
- Generic JSX transform: Rename expected module name for lowercase JSX to `Elements` from `DOM`. https://github.com/rescript-lang/rescript-compiler/pull/6606
2174
- Generic JSX transform: Set default config params for `jsxConfig`. https://github.com/rescript-lang/rescript-compiler/pull/6606
2275
- Generic JSX transform: Handle namespaced names. https://github.com/rescript-lang/rescript-compiler/pull/6606
76+
- Fix issue with doc comment in recursive module. https://github.com/rescript-lang/rescript-compiler/pull/6613
77+
- Fix issue with Exceptions and Extensible types runtime generation. https://github.com/rescript-lang/rescript-compiler/pull/6570
78+
- Fix inline comment before spread syntax in record. https://github.com/rescript-lang/rescript-compiler/pull/6615
2379

2480
#### :house: Internal
2581

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Happy hacking!
1414

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
17-
- [NodeJS v16](https://nodejs.org/)
17+
- [NodeJS v18](https://nodejs.org/)
1818
- C compiler toolchain (usually installed with `xcode` on Mac)
1919
- `opam` (OCaml Package Manager)
2020
- VSCode (+ [OCaml Platform Extension](https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform))
@@ -41,7 +41,7 @@ Make sure you have [opam](https://opam.ocaml.org/doc/Install.html) installed on
4141
opam init
4242

4343
# Any recent OCaml version works as a development compiler
44-
opam switch create 4.14.1 # can also create local switch with opam switch create . 4.14.1
44+
opam switch create 5.1.1 # can also create local switch with opam switch create
4545

4646
# Install dev dependencies from OPAM
4747
opam install . --deps-only

docs/docson/build-schema.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@
335335
"description": "Build the given dependencies in JSX V3 compatibility mode."
336336
}
337337
},
338-
"additionalProperties": false,
339-
"required": ["version"]
338+
"additionalProperties": false
340339
},
341340
"bsc-flags": {
342341
"oneOf": [
@@ -440,7 +439,7 @@
440439
"properties": {
441440
"number": {
442441
"type": "string",
443-
"description": "Default: -40+6+7+27+32..39+44+45 [Here](https://caml.inria.fr/pub/docs/manual-ocaml/comp.html#sec270) for the meanings of the warning flags"
442+
"description": "Default: \"+a-4-9-20-40-41-42-50-61-102\". Go [here](https://rescript-lang.org/docs/manual/latest/warning-numbers) for the meanings of the warning flags"
444443
},
445444
"error": {
446445
"oneOf": [

0 commit comments

Comments
 (0)