Skip to content

Commit aca77bd

Browse files
authored
Merge branch 'master' into rewatch-cli-refactor
2 parents 7742361 + 75afc52 commit aca77bd

File tree

89 files changed

+589
-347
lines changed

Some content is hidden

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

89 files changed

+589
-347
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ jobs:
450450
if: ${{ matrix.generate_api_docs }}
451451
uses: actions/upload-artifact@v4
452452
with:
453-
name: api-docs
453+
name: api
454454
path: scripts/res/apiDocs/
455455

456456
pkg-pr-new:
@@ -495,11 +495,12 @@ jobs:
495495
uses: actions/download-artifact@v4
496496
with:
497497
artifact-ids: ${{ needs.build-compiler.outputs.api-docs-artifact-id }}
498-
path: data/api
498+
path: data
499499

500500
- name: Check if repo is clean
501501
id: diffcheck
502502
run: |
503+
git status
503504
if [ -z "$(git status --porcelain)" ]; then
504505
echo "clean=true" >> $GITHUB_OUTPUT
505506
else

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@
1010
> - :house: [Internal]
1111
> - :nail_care: [Polish]
1212
13+
# 12.0.0-alpha.15 (Unreleased)
14+
15+
#### :bug: Bug fix
16+
17+
- Ignore inferred arity in functions inside `%raw` functions, leaving to `%ffi` the responsibility to check the arity since it gives an error in case of mismatch. https://github.com/rescript-lang/rescript/pull/7542
18+
- Pass the rewatch exit code through in wrapper script. https://github.com/rescript-lang/rescript/pull/7565
19+
- Prop punning when types don't match results in I/O error: _none_: No such file or directory. https://github.com/rescript-lang/rescript/pull/7533
20+
- Pass location to children prop in jsx ppx. https://github.com/rescript-lang/rescript/pull/7540
21+
22+
#### :nail_care: Polish
23+
24+
- Better error message for when trying to await something that is not a promise. https://github.com/rescript-lang/rescript/pull/7561
25+
26+
#### :house: Internal
27+
28+
- Remove `@return(undefined_to_opt)` and `%undefined_to_opt` primitive. https://github.com/rescript-lang/rescript/pull/7462
29+
1330
# 12.0.0-alpha.14
1431

1532
#### :boom: Breaking Change

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
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-
- [Node.js](https://nodejs.org/) v20.x
17+
- [Node.js](https://nodejs.org/) v22.x
1818
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
1919
- C compiler toolchain (usually installed with `xcode` on Mac)
2020
- Python <= 3.11 (required to build ninja)

compiler/common/bs_version.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
* You should have received a copy of the GNU Lesser General Public License
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
24-
let version = "12.0.0-alpha.14"
24+
let version = "12.0.0-alpha.15"
2525
let header = "// Generated by ReScript, PLEASE EDIT WITH CARE"
2626
let package_name = ref "rescript"

compiler/core/lam.ml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ let rec apply ?(ap_transformed_jsx = false) fn args (ap_info : ap_info) : t =
298298
Lprim
299299
{
300300
primitive =
301-
( Pundefined_to_opt | Pnull_to_opt | Pnull_undefined_to_opt
302-
| Pis_null | Pis_null_undefined | Ptypeof ) as wrap;
301+
( Pnull_to_opt | Pnull_undefined_to_opt | Pis_null
302+
| Pis_null_undefined | Ptypeof ) as wrap;
303303
args =
304304
[Lprim ({primitive = _; args = inner_args} as primitive_call)];
305305
};
@@ -442,11 +442,7 @@ let rec seq (a : t) b : t =
442442
match a with
443443
| Lprim {primitive = Pmakeblock _; args = x :: xs} ->
444444
seq (Ext_list.fold_left xs x seq) b
445-
| Lprim
446-
{
447-
primitive = Pnull_to_opt | Pundefined_to_opt | Pnull_undefined_to_opt;
448-
args = [a];
449-
} ->
445+
| Lprim {primitive = Pnull_to_opt | Pnull_undefined_to_opt; args = [a]} ->
450446
seq a b
451447
| _ -> Lsequence (a, b)
452448

@@ -719,8 +715,6 @@ let result_wrap loc (result_type : External_ffi_types.return_wrapper) result =
719715
| Return_null_to_opt -> prim ~primitive:Pnull_to_opt ~args:[result] loc
720716
| Return_null_undefined_to_opt ->
721717
prim ~primitive:Pnull_undefined_to_opt ~args:[result] loc
722-
| Return_undefined_to_opt ->
723-
prim ~primitive:Pundefined_to_opt ~args:[result] loc
724718
| Return_unset | Return_identity -> result
725719

726720
let handle_bs_non_obj_ffi ?(transformed_jsx = false)

compiler/core/lam_analysis.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ let rec no_side_effects (lam : Lam.t) : bool =
4646
| _ -> false)
4747
| Pcreate_extension _ | Ptypeof | Pis_null | Pis_not_none | Psome
4848
| Psome_not_nest | Pis_undefined | Pis_null_undefined | Pnull_to_opt
49-
| Pundefined_to_opt | Pnull_undefined_to_opt | Pjs_fn_make _
50-
| Pjs_fn_make_unit | Pjs_object_create _ | Pimport
49+
| Pnull_undefined_to_opt | Pjs_fn_make _ | Pjs_fn_make_unit
50+
| Pjs_object_create _ | Pimport
5151
(* TODO: check *)
5252
| Pmakeblock _
5353
(* whether it's mutable or not *)

compiler/core/lam_arity_analysis.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ let rec get_arity (meta : Lam_stats.t) (lam : Lam.t) : Lam_arity.t =
6969
with
7070
| Submodule subs -> subs.(m) (* TODO: shall we store it as array?*)
7171
| Single _ -> Lam_arity.na)
72-
| Lprim {primitive = Praw_js_code {code_info = Exp (Js_function {arity})}} ->
73-
Lam_arity.info [arity] false
7472
| Lprim {primitive = Praise; _} -> Lam_arity.raise_arity_info
7573
| Lglobal_module _ (* TODO: fix me never going to happen *) | Lprim _ ->
7674
Lam_arity.na (* CHECK*)

compiler/core/lam_compile_primitive.ml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,6 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
9595
| Var _ | Undefined _ | Null -> Js_of_lam_option.null_to_opt e
9696
| _ -> E.runtime_call Primitive_modules.option "fromNull" args)
9797
| _ -> assert false)
98-
| Pundefined_to_opt -> (
99-
match args with
100-
| [e] -> (
101-
match e.expression_desc with
102-
| Var _ | Undefined _ | Null -> Js_of_lam_option.undef_to_opt e
103-
| _ -> E.runtime_call Primitive_modules.option "fromUndefined" args)
104-
| _ -> assert false)
10598
| Pnull_undefined_to_opt -> (
10699
match args with
107100
| [e] -> (

compiler/core/lam_convert.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t =
197197
| Pisnullable -> prim ~primitive:Pis_null_undefined ~args loc
198198
| Pnull_to_opt -> prim ~primitive:Pnull_to_opt ~args loc
199199
| Pnullable_to_opt -> prim ~primitive:Pnull_undefined_to_opt ~args loc
200-
| Pundefined_to_opt -> prim ~primitive:Pundefined_to_opt ~args loc
201200
| Pis_not_none -> prim ~primitive:Pis_not_none ~args loc
202201
| Pval_from_option -> prim ~primitive:Pval_from_option ~args loc
203202
| Pval_from_option_not_nest ->

compiler/core/lam_pass_collect.ml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,8 @@ let collect_info (meta : Lam_stats.t) (lam : Lam.t) =
6464
| Lprim {primitive = Psome | Psome_not_nest; args = [v]} ->
6565
Hash_ident.replace meta.ident_tbl ident (Normal_optional v);
6666
collect v
67-
| Lprim
68-
{
69-
primitive = Praw_js_code {code_info = Exp (Js_function {arity})};
70-
args = _;
71-
} ->
72-
Hash_ident.replace meta.ident_tbl ident
73-
(FunctionId {arity = Lam_arity.info [arity] false; lambda = None})
7467
| Lprim {primitive = Pnull_to_opt; args = [(Lvar _ as l)]; _} ->
7568
Hash_ident.replace meta.ident_tbl ident (OptionalBlock (l, Null))
76-
| Lprim {primitive = Pundefined_to_opt; args = [(Lvar _ as l)]; _} ->
77-
Hash_ident.replace meta.ident_tbl ident (OptionalBlock (l, Undefined))
7869
| Lprim {primitive = Pnull_undefined_to_opt; args = [(Lvar _ as l)]} ->
7970
Hash_ident.replace meta.ident_tbl ident
8071
(OptionalBlock (l, Null_undefined))

0 commit comments

Comments
 (0)