Skip to content

Commit bf4a7ff

Browse files
authored
Remove uncurried flag from bsb (#7049)
* Remove uncurried flag from bsb * CHANGELOG
1 parent 52a8890 commit bf4a7ff

11 files changed

+13
-31
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
- Improve error messages around JSX components. https://github.com/rescript-lang/rescript-compiler/pull/7038
2929
- Improve output of record copying. https://github.com/rescript-lang/rescript-compiler/pull/7043
3030

31+
#### :house: Internal
32+
33+
- Remove uncurried flag from bsb. https://github.com/rescript-lang/rescript-compiler/pull/7049
34+
3135
# 12.0.0-alpha.3
3236

3337
#### :bug: Bug fix

jscomp/bsb/bsb_build_schemas.ml

-2
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,3 @@ let suffix = "suffix"
6666
let gentypeconfig = "gentypeconfig"
6767
let language = "language"
6868
let ignored_dirs = "ignored-dirs"
69-
70-
let uncurried = "uncurried"

jscomp/bsb/bsb_clean.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let clean_bs_garbage proj_dir =
5151
Bsb_log.warn "@{<warning>Failed@} to clean due to %s" (Printexc.to_string e)
5252

5353
let clean_bs_deps proj_dir =
54-
let _, _, _, pinned_dependencies = Bsb_config_parse.deps_from_bsconfig () in
54+
let _, _, pinned_dependencies = Bsb_config_parse.deps_from_bsconfig () in
5555
let queue = Bsb_build_util.walk_all_deps proj_dir ~pinned_dependencies in
5656
Queue.iter
5757
(fun (pkg_cxt : Bsb_build_util.package_context) ->

jscomp/bsb/bsb_config_parse.ml

-13
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ let extract_gentype_config (map : json_map) : Bsb_config_types.gentype_config =
8989
| Some config ->
9090
Bsb_exception.config_error config "gentypeconfig expect an object"
9191

92-
let extract_uncurried (map : json_map) : bool =
93-
match map.?(Bsb_build_schemas.uncurried) with
94-
| None -> true
95-
| Some (True _) -> true
96-
| Some (False _) -> false
97-
| Some config ->
98-
Bsb_exception.config_error config "uncurried expects one of: true, false."
99-
10092
let extract_string (map : json_map) (field : string) cb =
10193
match map.?(field) with
10294
| None -> None
@@ -338,10 +330,6 @@ let interpret_json
338330
jsx;
339331
generators = extract_generators map;
340332
cut_generators;
341-
uncurried =
342-
(match package_kind with
343-
| Toplevel -> extract_uncurried map
344-
| Pinned_dependency x | Dependency x -> x.uncurried);
345333
filename;
346334
}
347335
| None ->
@@ -355,6 +343,5 @@ let deps_from_bsconfig () =
355343
| _, Obj { map } ->
356344
( Bsb_package_specs.from_map ~cwd map,
357345
Bsb_jsx.from_map map,
358-
extract_uncurried map,
359346
Bsb_build_util.extract_pinned_dependencies map )
360347
| _, _ -> assert false

jscomp/bsb/bsb_config_parse.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
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. *)
2424

25-
val deps_from_bsconfig : unit -> Bsb_package_specs.t * Bsb_jsx.t * bool * Set_string.t
25+
val deps_from_bsconfig : unit -> Bsb_package_specs.t * Bsb_jsx.t * Set_string.t
2626

2727
val interpret_json :
2828
filename:string ->

jscomp/bsb/bsb_config_types.ml

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ type t = {
6363
cut_generators : bool;
6464
(* note when used as a dev mode, we will always ignore it *)
6565
gentype_config : gentype_config;
66-
uncurried: bool;
6766

6867
filename: string;
6968
}

jscomp/bsb/bsb_ninja_gen.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind
150150
files_to_install;
151151
reason_react_jsx;
152152
jsx;
153-
uncurried;
154153
generators;
155154
namespace;
156155
warning;
@@ -197,7 +196,7 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind
197196
let rules : Bsb_ninja_rule.builtin =
198197
Bsb_ninja_rule.make_custom_rules ~gentype_config
199198
~has_postbuild:js_post_build_cmd ~pp_file
200-
~reason_react_jsx ~jsx ~uncurried ~package_specs ~namespace ~digest ~package_name
199+
~reason_react_jsx ~jsx ~package_specs ~namespace ~digest ~package_name
201200
~warnings ~ppx_files ~bsc_flags ~dpkg_incls (* dev dependencies *)
202201
~lib_incls (* its own libs *)
203202
~dev_incls (* its own devs *)

jscomp/bsb/bsb_ninja_rule.ml

+1-5
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type builtin = {
8989
let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
9090
~(has_postbuild : string option) ~(pp_file : string option)
9191
~(reason_react_jsx : Bsb_config_types.reason_react_jsx option)
92-
~(jsx : Bsb_jsx.t) ~(uncurried: bool) ~(digest : string) ~(package_specs : Bsb_package_specs.t)
92+
~(jsx : Bsb_jsx.t) ~(digest : string) ~(package_specs : Bsb_package_specs.t)
9393
~(namespace : string option) ~package_name ~warnings
9494
~(ppx_files : Bsb_config_types.ppx list) ~bsc_flags ~(dpkg_incls : string)
9595
~(lib_incls : string) ~(dev_incls : string) ~bs_dependencies
@@ -100,8 +100,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
100100
since the default is already good -- it does not*)
101101
let buf = Ext_buffer.create 100 in
102102
let ns_flag = match namespace with None -> "" | Some n -> " -bs-ns " ^ n in
103-
let add_uncurried_flag b =
104-
if b then Ext_buffer.add_string buf " -uncurried" in
105103
let mk_ml_cmj_cmd ~(read_cmi : [ `yes | `is_cmi | `no ]) ~is_dev ~postbuild :
106104
string =
107105
Ext_buffer.clear buf;
@@ -120,7 +118,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
120118
(match gentype_config with
121119
| false -> ()
122120
| true -> Ext_buffer.add_string buf " -bs-gentype");
123-
add_uncurried_flag uncurried;
124121
if read_cmi <> `is_cmi then (
125122
Ext_buffer.add_string buf " -bs-package-name ";
126123
Ext_buffer.add_string buf (Ext_filename.maybe_quote package_name);
@@ -172,7 +169,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config)
172169
| None -> ()
173170
| Some Classic -> Ext_buffer.add_string buf " -bs-jsx-mode classic"
174171
| Some Automatic -> Ext_buffer.add_string buf " -bs-jsx-mode automatic");
175-
add_uncurried_flag uncurried;
176172

177173
Ext_buffer.add_char_string buf ' ' bsc_flags;
178174
Ext_buffer.add_string buf " -absname -bs-ast -o $out $i";

jscomp/bsb/bsb_ninja_rule.mli

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ val make_custom_rules :
7070
pp_file:string option ->
7171
reason_react_jsx:Bsb_config_types.reason_react_jsx option ->
7272
jsx:Bsb_jsx.t ->
73-
uncurried:bool ->
7473
digest:string ->
7574
package_specs:Bsb_package_specs.t ->
7675
namespace:string option ->

jscomp/bsb/bsb_package_kind.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
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. *)
2424

25-
type dep_payload = { package_specs : Bsb_package_specs.t; jsx : Bsb_jsx.t; uncurried : bool }
25+
type dep_payload = { package_specs : Bsb_package_specs.t; jsx : Bsb_jsx.t }
2626

2727
type t =
2828
| Toplevel

jscomp/bsb/bsb_world.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let vendor_ninja = Bsb_global_paths.vendor_ninja
2727

2828
let make_world_deps cwd (config : Bsb_config_types.t option)
2929
(ninja_args : string array) warn_as_error =
30-
let package_specs, jsx, uncurried, pinned_dependencies =
30+
let package_specs, jsx, pinned_dependencies =
3131
match config with
3232
| None ->
3333
(* When this running bsb does not read rescript.json,
@@ -36,7 +36,7 @@ let make_world_deps cwd (config : Bsb_config_types.t option)
3636
*)
3737
Bsb_config_parse.deps_from_bsconfig ()
3838
| Some config ->
39-
(config.package_specs, config.jsx, config.uncurried, config.pinned_dependencies)
39+
(config.package_specs, config.jsx, config.pinned_dependencies)
4040
in
4141
let args =
4242
if Ext_array.is_empty ninja_args then [| vendor_ninja |]
@@ -67,8 +67,8 @@ let make_world_deps cwd (config : Bsb_config_types.t option)
6767
let _config : _ option =
6868
Bsb_ninja_regen.regenerate_ninja
6969
~package_kind:
70-
(if is_pinned then Pinned_dependency { package_specs; jsx; uncurried }
71-
else Dependency { package_specs; jsx; uncurried })
70+
(if is_pinned then Pinned_dependency { package_specs; jsx }
71+
else Dependency { package_specs; jsx })
7272
~per_proj_dir:proj_dir ~forced:false
7373
~warn_legacy_config:false
7474
~warn_as_error:(if is_pinned then warn_as_error else None)

0 commit comments

Comments
 (0)