Skip to content

Commit 382988a

Browse files
authored
Make uncurried mode opt-out. (#6249)
* Make uncurried mode opt-out. By default, every project is in uncurried mode, unless `"uncurried": false` is specified in the project config. * Update res_multi_printer.ml
1 parent c646742 commit 382988a

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
1313
# 11.0.0-beta.1 (Unreleased)
1414

15+
#### :rocket: Main New Feature
16+
- Make uncurried mode opt-out: by default, every project is now in uncurried mode, unless `"uncurried": false` is specified in the project config. https://github.com/rescript-lang/rescript-compiler/pull/6249
17+
1518
# 11.0.0-alpha.6
1619

1720
#### :boom: Breaking Change

jscomp/bsb/bsb_config_parse.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ let extract_gentype_config (map : json_map) : Bsb_config_types.gentype_config =
9797

9898
let extract_uncurried (map : json_map) : bool =
9999
match map.?(Bsb_build_schemas.uncurried) with
100-
| None -> false
100+
| None -> true
101101
| Some (True _) -> true
102102
| Some (False _) -> false
103103
| Some config ->

jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js

+6-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/react_ppx/src/recursive_component_test.bs.js

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/syntax/src/res_multi_printer.ml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let defaultPrintWidth = 100
22

33
(* Determine if the file is in uncurried mode by looking for
4-
the fist ancestor .bsconfig and see if it contains "uncurried": true *)
4+
the fist ancestor .bsconfig and see if it contains "uncurried": false *)
55
let getUncurriedFromBsconfig ~filename =
66
let rec findBsconfig ~dir =
77
let bsconfig = Filename.concat dir "bsconfig.json" in
@@ -42,18 +42,19 @@ let getUncurriedFromBsconfig ~filename =
4242
lines
4343
|> List.exists (fun line ->
4444
let uncurried = ref false in
45-
let true_ = ref false in
45+
let false_ = ref false in
4646
let words = line |> String.split_on_char ' ' in
4747
words
4848
|> List.iter (fun word ->
4949
match word with
5050
| "\"uncurried\"" | "\"uncurried\":" -> uncurried := true
51-
| "\"uncurried\":true" | "\"uncurried\":true," ->
51+
| "\"uncurried\":false" | "\"uncurried\":false," ->
5252
uncurried := true;
53-
true_ := true
54-
| "true" | ":true" | "true," | ":true," -> true_ := true
53+
false_ := true
54+
| "false" | ":false" | "false," | ":false," ->
55+
false_ := true
5556
| _ -> ());
56-
!uncurried && !true_)
57+
not (!uncurried && !false_))
5758
in
5859
if uncurried then Config.uncurried := Uncurried
5960

0 commit comments

Comments
 (0)