Skip to content

Commit

Permalink
Merge branch '11.0_release' into generic-jsx-transform-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zth authored Feb 2, 2024
2 parents 6e8edd7 + 91096aa commit 9aa1b94
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ${{matrix.os}}

container:
image: ghcr.io/rescript-lang/rescript-ci-build:v1.1.0
image: ghcr.io/rescript-lang/rescript-ci-build:v1.2.0

steps:
# See https://github.com/actions/runner/issues/801#issuecomment-1374967227.
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
ubuntu-latest,
windows-latest,
]
ocaml_compiler: [4.14.0]
ocaml_compiler: [4.14.1]

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

Expand Down Expand Up @@ -147,15 +147,15 @@ jobs:
chmod +x _build/install/default/bin/*
- name: Use OCaml ${{matrix.ocaml_compiler}}
uses: ocaml/setup-ocaml@v2.1.7
uses: ocaml/setup-ocaml@v2
if: matrix.os != 'windows-latest'
with:
ocaml-compiler: ${{matrix.ocaml_compiler}}
opam-pin: false
opam-depext: false

- name: Use OCaml ${{matrix.ocaml_compiler}} (Win)
uses: ocaml/setup-ocaml@v2.1.7
uses: ocaml/setup-ocaml@v2
if: matrix.os == 'windows-latest'
with:
ocaml-compiler: ${{matrix.ocaml_compiler}}
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
# 12.0.0-alpha.1 (Unreleased)

#### :bug: Bug Fix

- Fix issue with async and newtype in uncurried mode. https://github.com/rescript-lang/rescript-compiler/pull/6601

#### :house: Internal

- Use OCaml 4.14.1 (+ Alpine 3.19 container) for CI build. https://github.com/rescript-lang/rescript-compiler/pull/6600

# 11.1.0-rc.1

#### :rocket: New Feature
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Make sure you have [opam](https://opam.ocaml.org/doc/Install.html) installed on
opam init

# Any recent OCaml version works as a development compiler
opam switch create 4.14.0 # can also create local switch with opam switch create . 4.14.0
opam switch create 4.14.1 # can also create local switch with opam switch create . 4.14.1

# Install dev dependencies from OPAM
opam install . --deps-only
Expand Down
18 changes: 12 additions & 6 deletions jscomp/ml/ast_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ let add_promise_type ?(loc = Location.none) ~async

let add_async_attribute ~async (body : Parsetree.expression) =
if async then
{
body with
pexp_attributes =
({txt = "res.async"; loc = Location.none}, PStr [])
:: body.pexp_attributes;
}
(
match body.pexp_desc with
| Pexp_construct (x, Some e) when Ast_uncurried.exprIsUncurriedFun body ->
{body with pexp_desc = Pexp_construct (x, Some {e with pexp_attributes =
({txt = "res.async"; loc = Location.none}, PStr []) :: e.pexp_attributes} )}
| _ ->
{
body with
pexp_attributes =
({txt = "res.async"; loc = Location.none}, PStr [])
:: body.pexp_attributes;
})
else body

let rec add_promise_to_result ~loc (e : Parsetree.expression) =
Expand Down
5 changes: 5 additions & 0 deletions jscomp/test/async_await.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions jscomp/test/async_await.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ let arr = [1, 2, 3]

let toplevelAwait = await topFoo()
let toplevelAwait2 = arr[await topFoo()]

let f = async (type input, value: input) => {
await Js.Promise.resolve(. 1)
}

0 comments on commit 9aa1b94

Please sign in to comment.