Skip to content

Remove uncurried flag from bsb #7049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions jscomp/bsb/bsb_build_schemas.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,3 @@ let suffix = "suffix"
let gentypeconfig = "gentypeconfig"
let language = "language"
let ignored_dirs = "ignored-dirs"

let uncurried = "uncurried"
2 changes: 1 addition & 1 deletion jscomp/bsb/bsb_clean.ml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ let clean_bs_garbage proj_dir =
Bsb_log.warn "@{<warning>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) ->
Expand Down
13 changes: 0 additions & 13 deletions jscomp/bsb/bsb_config_parse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ->
Expand All @@ -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
2 changes: 1 addition & 1 deletion jscomp/bsb/bsb_config_parse.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
1 change: 0 additions & 1 deletion jscomp/bsb/bsb_config_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 1 addition & 2 deletions jscomp/bsb/bsb_ninja_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 *)
Expand Down
6 changes: 1 addition & 5 deletions jscomp/bsb/bsb_ninja_rule.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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";
Expand Down
1 change: 0 additions & 1 deletion jscomp/bsb/bsb_ninja_rule.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion jscomp/bsb/bsb_package_kind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions jscomp/bsb/bsb_world.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 |]
Expand Down Expand Up @@ -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)
Expand Down