diff --git a/CHANGELOG.md b/CHANGELOG.md index 4272471bd2..9e4bad7c0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ - Improve error messages around JSX components. https://github.com/rescript-lang/rescript-compiler/pull/7038 - Improve output of record copying. https://github.com/rescript-lang/rescript-compiler/pull/7043 +#### :house: Internal + +- Remove uncurried flag from bsb. https://github.com/rescript-lang/rescript-compiler/pull/7049 + # 12.0.0-alpha.3 #### :bug: Bug fix diff --git a/jscomp/bsb/bsb_build_schemas.ml b/jscomp/bsb/bsb_build_schemas.ml index 769f6a7a29..4d6949dc3b 100644 --- a/jscomp/bsb/bsb_build_schemas.ml +++ b/jscomp/bsb/bsb_build_schemas.ml @@ -66,5 +66,3 @@ let suffix = "suffix" let gentypeconfig = "gentypeconfig" let language = "language" let ignored_dirs = "ignored-dirs" - -let uncurried = "uncurried" \ No newline at end of file diff --git a/jscomp/bsb/bsb_clean.ml b/jscomp/bsb/bsb_clean.ml index ff8ed40da1..32c67dc17d 100644 --- a/jscomp/bsb/bsb_clean.ml +++ b/jscomp/bsb/bsb_clean.ml @@ -51,7 +51,7 @@ let clean_bs_garbage proj_dir = Bsb_log.warn "@{Failed@} to clean due to %s" (Printexc.to_string e) let clean_bs_deps proj_dir = - let _, _, _, pinned_dependencies = Bsb_config_parse.deps_from_bsconfig () in + let _, _, pinned_dependencies = Bsb_config_parse.deps_from_bsconfig () in let queue = Bsb_build_util.walk_all_deps proj_dir ~pinned_dependencies in Queue.iter (fun (pkg_cxt : Bsb_build_util.package_context) -> diff --git a/jscomp/bsb/bsb_config_parse.ml b/jscomp/bsb/bsb_config_parse.ml index 4a9aab131c..7200d5191a 100644 --- a/jscomp/bsb/bsb_config_parse.ml +++ b/jscomp/bsb/bsb_config_parse.ml @@ -89,14 +89,6 @@ let extract_gentype_config (map : json_map) : Bsb_config_types.gentype_config = | Some config -> Bsb_exception.config_error config "gentypeconfig expect an object" -let extract_uncurried (map : json_map) : bool = - match map.?(Bsb_build_schemas.uncurried) with - | None -> true - | Some (True _) -> true - | Some (False _) -> false - | Some config -> - Bsb_exception.config_error config "uncurried expects one of: true, false." - let extract_string (map : json_map) (field : string) cb = match map.?(field) with | None -> None @@ -338,10 +330,6 @@ let interpret_json jsx; generators = extract_generators map; cut_generators; - uncurried = - (match package_kind with - | Toplevel -> extract_uncurried map - | Pinned_dependency x | Dependency x -> x.uncurried); filename; } | None -> @@ -355,6 +343,5 @@ let deps_from_bsconfig () = | _, Obj { map } -> ( Bsb_package_specs.from_map ~cwd map, Bsb_jsx.from_map map, - extract_uncurried map, Bsb_build_util.extract_pinned_dependencies map ) | _, _ -> assert false diff --git a/jscomp/bsb/bsb_config_parse.mli b/jscomp/bsb/bsb_config_parse.mli index 3aedf9891b..c850693585 100644 --- a/jscomp/bsb/bsb_config_parse.mli +++ b/jscomp/bsb/bsb_config_parse.mli @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val deps_from_bsconfig : unit -> Bsb_package_specs.t * Bsb_jsx.t * bool * Set_string.t +val deps_from_bsconfig : unit -> Bsb_package_specs.t * Bsb_jsx.t * Set_string.t val interpret_json : filename:string -> diff --git a/jscomp/bsb/bsb_config_types.ml b/jscomp/bsb/bsb_config_types.ml index c80e3e88bf..88ac34e2df 100644 --- a/jscomp/bsb/bsb_config_types.ml +++ b/jscomp/bsb/bsb_config_types.ml @@ -63,7 +63,6 @@ type t = { cut_generators : bool; (* note when used as a dev mode, we will always ignore it *) gentype_config : gentype_config; - uncurried: bool; filename: string; } diff --git a/jscomp/bsb/bsb_ninja_gen.ml b/jscomp/bsb/bsb_ninja_gen.ml index a505fb991e..9cb10bb11d 100644 --- a/jscomp/bsb/bsb_ninja_gen.ml +++ b/jscomp/bsb/bsb_ninja_gen.ml @@ -150,7 +150,6 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind files_to_install; reason_react_jsx; jsx; - uncurried; generators; namespace; warning; @@ -197,7 +196,7 @@ let output_ninja_and_namespace_map ~per_proj_dir ~package_kind let rules : Bsb_ninja_rule.builtin = Bsb_ninja_rule.make_custom_rules ~gentype_config ~has_postbuild:js_post_build_cmd ~pp_file - ~reason_react_jsx ~jsx ~uncurried ~package_specs ~namespace ~digest ~package_name + ~reason_react_jsx ~jsx ~package_specs ~namespace ~digest ~package_name ~warnings ~ppx_files ~bsc_flags ~dpkg_incls (* dev dependencies *) ~lib_incls (* its own libs *) ~dev_incls (* its own devs *) diff --git a/jscomp/bsb/bsb_ninja_rule.ml b/jscomp/bsb/bsb_ninja_rule.ml index ecc96789e2..f3a2f2eab4 100644 --- a/jscomp/bsb/bsb_ninja_rule.ml +++ b/jscomp/bsb/bsb_ninja_rule.ml @@ -89,7 +89,7 @@ type builtin = { let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) ~(has_postbuild : string option) ~(pp_file : string option) ~(reason_react_jsx : Bsb_config_types.reason_react_jsx option) - ~(jsx : Bsb_jsx.t) ~(uncurried: bool) ~(digest : string) ~(package_specs : Bsb_package_specs.t) + ~(jsx : Bsb_jsx.t) ~(digest : string) ~(package_specs : Bsb_package_specs.t) ~(namespace : string option) ~package_name ~warnings ~(ppx_files : Bsb_config_types.ppx list) ~bsc_flags ~(dpkg_incls : string) ~(lib_incls : string) ~(dev_incls : string) ~bs_dependencies @@ -100,8 +100,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) since the default is already good -- it does not*) let buf = Ext_buffer.create 100 in let ns_flag = match namespace with None -> "" | Some n -> " -bs-ns " ^ n in - let add_uncurried_flag b = - if b then Ext_buffer.add_string buf " -uncurried" in let mk_ml_cmj_cmd ~(read_cmi : [ `yes | `is_cmi | `no ]) ~is_dev ~postbuild : string = Ext_buffer.clear buf; @@ -120,7 +118,6 @@ let make_custom_rules ~(gentype_config : Bsb_config_types.gentype_config) (match gentype_config with | false -> () | true -> Ext_buffer.add_string buf " -bs-gentype"); - add_uncurried_flag uncurried; if read_cmi <> `is_cmi then ( Ext_buffer.add_string buf " -bs-package-name "; 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) | None -> () | Some Classic -> Ext_buffer.add_string buf " -bs-jsx-mode classic" | Some Automatic -> Ext_buffer.add_string buf " -bs-jsx-mode automatic"); - add_uncurried_flag uncurried; Ext_buffer.add_char_string buf ' ' bsc_flags; Ext_buffer.add_string buf " -absname -bs-ast -o $out $i"; diff --git a/jscomp/bsb/bsb_ninja_rule.mli b/jscomp/bsb/bsb_ninja_rule.mli index 1f77aad84a..e8d25c2a92 100644 --- a/jscomp/bsb/bsb_ninja_rule.mli +++ b/jscomp/bsb/bsb_ninja_rule.mli @@ -70,7 +70,6 @@ val make_custom_rules : pp_file:string option -> reason_react_jsx:Bsb_config_types.reason_react_jsx option -> jsx:Bsb_jsx.t -> - uncurried:bool -> digest:string -> package_specs:Bsb_package_specs.t -> namespace:string option -> diff --git a/jscomp/bsb/bsb_package_kind.ml b/jscomp/bsb/bsb_package_kind.ml index 22c196260f..0f4f74802e 100644 --- a/jscomp/bsb/bsb_package_kind.ml +++ b/jscomp/bsb/bsb_package_kind.ml @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type dep_payload = { package_specs : Bsb_package_specs.t; jsx : Bsb_jsx.t; uncurried : bool } +type dep_payload = { package_specs : Bsb_package_specs.t; jsx : Bsb_jsx.t } type t = | Toplevel diff --git a/jscomp/bsb/bsb_world.ml b/jscomp/bsb/bsb_world.ml index 30b776c796..631523a1e3 100644 --- a/jscomp/bsb/bsb_world.ml +++ b/jscomp/bsb/bsb_world.ml @@ -27,7 +27,7 @@ let vendor_ninja = Bsb_global_paths.vendor_ninja let make_world_deps cwd (config : Bsb_config_types.t option) (ninja_args : string array) warn_as_error = - let package_specs, jsx, uncurried, pinned_dependencies = + let package_specs, jsx, pinned_dependencies = match config with | None -> (* When this running bsb does not read rescript.json, @@ -36,7 +36,7 @@ let make_world_deps cwd (config : Bsb_config_types.t option) *) Bsb_config_parse.deps_from_bsconfig () | Some config -> - (config.package_specs, config.jsx, config.uncurried, config.pinned_dependencies) + (config.package_specs, config.jsx, config.pinned_dependencies) in let args = 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) let _config : _ option = Bsb_ninja_regen.regenerate_ninja ~package_kind: - (if is_pinned then Pinned_dependency { package_specs; jsx; uncurried } - else Dependency { package_specs; jsx; uncurried }) + (if is_pinned then Pinned_dependency { package_specs; jsx } + else Dependency { package_specs; jsx }) ~per_proj_dir:proj_dir ~forced:false ~warn_legacy_config:false ~warn_as_error:(if is_pinned then warn_as_error else None)