diff --git a/CHANGELOG.md b/CHANGELOG.md index 22f1402b87..aa72c2986d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ #### :boom: Breaking Change - `Int.fromString` and `Float.fromString` use stricter number parsing and no longer uses an explicit radix argument, but instead supports parsing hexadecimal, binary and exponential notation. +- Remove `external-stdlib` configuration option from `rescript.json`. This option was rarely used and is no longer supported. #### :eyeglasses: Spec Compliance diff --git a/compiler/bsb/bsb_build_schemas.ml b/compiler/bsb/bsb_build_schemas.ml index 24d14027e2..de5f9e18b8 100644 --- a/compiler/bsb/bsb_build_schemas.ml +++ b/compiler/bsb/bsb_build_schemas.ml @@ -47,7 +47,7 @@ let package_specs = "package-specs" let type_ = "type" let export_all = "all" let export_none = "none" -let external_stdlib = "external-stdlib" + let jsx = "jsx" let jsx_version = "version" let jsx_module = "module" diff --git a/compiler/bsb/bsb_package_specs.ml b/compiler/bsb/bsb_package_specs.ml index eaf4ccee02..ad80b98914 100644 --- a/compiler/bsb/bsb_package_specs.ml +++ b/compiler/bsb/bsb_package_specs.ml @@ -1,5 +1,5 @@ (* Copyright (C) 2017 Hongbo Zhang, Authors of ReScript - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -17,7 +17,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) @@ -27,13 +27,7 @@ let ( // ) = Ext_path.combine (*FIXME: use assoc list instead *) module Spec_set = Bsb_spec_set -type t = { - modules: Spec_set.t; - runtime: string option; - (* This has to be resolved as early as possible, since - the path will be inherited in sub projects - *) -} +type t = {modules: Spec_set.t} let ( .?() ) = Map_string.find_opt @@ -159,9 +153,7 @@ let package_flag_of_package_specs (package_specs : t) ~(dirname : string) : (fun format acc -> Ext_string.inter2 acc (package_flag format dirname)) package_specs.modules Ext_string.empty in - match package_specs.runtime with - | None -> res - | Some x -> Ext_string.inter3 res "-runtime" x + res let default_package_specs suffix = (* TODO: swap default to Esmodule in v12 *) @@ -205,18 +197,11 @@ let extract_js_suffix_exn (map : json_map) : string = Bsb_exception.config_error config "expected a string extension like \".js\"" let from_map ~(cwd : string) map = + ignore cwd; let suffix = extract_js_suffix_exn map in let modules = match map.?(Bsb_build_schemas.package_specs) with | Some x -> from_json suffix x | None -> default_package_specs suffix in - let runtime = - match map.?(Bsb_build_schemas.external_stdlib) with - | None -> None - | Some (Str {str; _}) -> - Some - (Bsb_pkg.resolve_bs_package ~cwd (Bsb_pkg_types.string_as_package str)) - | _ -> assert false - in - {runtime; modules} + {modules} diff --git a/compiler/gentype/GenTypeConfig.ml b/compiler/gentype/GenTypeConfig.ml index 73925cc1d5..e6c05c2d43 100644 --- a/compiler/gentype/GenTypeConfig.ml +++ b/compiler/gentype/GenTypeConfig.ml @@ -177,12 +177,7 @@ let read_config ~get_config_file ~namespace = | Some b -> b in let generated_file_extension = generated_file_extension_string_option in - let external_stdlib = bsconf |> get_string_option "external-stdlib" in - let platform_lib = - match external_stdlib with - | None -> "rescript" - | Some external_stdlib -> external_stdlib - in + let platform_lib = "rescript" in if !Debug.config then ( Log_.item "Project roLiterals.bsconfig_jsonot: %s\n" project_root; if bsb_project_root <> project_root then diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index ee1959bf50..03204c0cd5 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -460,10 +460,6 @@ "$ref": "#/definitions/package-specs", "description": "ReScript can currently output to [Commonjs](https://en.wikipedia.org/wiki/CommonJS), and [ES6 modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)" }, - "external-stdlib": { - "type": "string", - "description": "Use the external stdlib library instead of the one shipped with the compiler package" - }, "bs-external-includes": { "type": "array", "items": { diff --git a/rewatch/CompilerConfigurationSpec.md b/rewatch/CompilerConfigurationSpec.md index 3e01b7b561..6b32d4d96a 100644 --- a/rewatch/CompilerConfigurationSpec.md +++ b/rewatch/CompilerConfigurationSpec.md @@ -2,36 +2,34 @@ This document contains a list of all bsconfig parameters with remarks, and whether they are already implemented in rewatch. It is based on https://rescript-lang.org/docs/manual/latest/build-configuration-schema. -| Parameter | JSON type | Remark | Implemented? | -| --------------------- | ----------------------- | ------ | :----------: | -| name | string | | [x] | -| namespace | boolean | | [x] | -| namespace | string | | [x] | -| sources | string | | [x] | -| sources | array of string | | [x] | -| sources | Source | | [x] | -| sources | array of Source | | [x] | -| ignored-dirs | array of string | | [_] | -| dependencies | array of string | | [x] | -| dev-dependencies | array of string | | [x] | -| generators | array of Rule-Generator | | [_] | -| cut-generators | boolean | | [_] | -| jsx | JSX | | [x] | -| gentypeconfig | Gentype | | [x] | -| compiler-flags | array of string | | [x] | -| warnings | Warnings | | [x] | -| ppx-flags | array of string | | [x] | -| pp-flags | array of string | | [_] | -| js-post-build | Js-Post-Build | `${file}` is now an absolute path | [x] | -| package-specs | array of Module-Format | | [_] | -| package-specs | array of Package-Spec | | [x] | -| entries | array of Target-Item | | [_] | -| use-stdlib | boolean | | [_] | -| external-stdlib | string | | [_] | -| bs-external-includes | array of string | | [_] | -| suffix | Suffix | | [x] | -| reanalyze | Reanalyze | | [_] | -| experimental-features | ExperimentalFeatures | | [x] | +| Parameter | JSON type | Remark | Implemented? | +| --------------------- | ----------------------- | ---------------------------------------- | :----------: | +| name | string | | [x] | +| namespace | boolean | | [x] | +| namespace | string | | [x] | +| sources | string | | [x] | +| sources | array of string | | [x] | +| sources | Source | | [x] | +| sources | array of Source | | [x] | +| ignored-dirs | array of string | | [_] | +| dependencies | array of string | | [x] | +| dev-dependencies | array of string | | [x] | +| generators | array of Rule-Generator | | [_] | +| cut-generators | boolean | | [_] | +| jsx | JSX | | [x] | +| gentypeconfig | Gentype | | [x] | +| compiler-flags | array of string | | [x] | +| warnings | Warnings | | [x] | +| ppx-flags | array of string | | [x] | +| pp-flags | array of string | | [_] | +| js-post-build | Js-Post-Build | `${file}` is now an absolute path | [x] | +| package-specs | array of Module-Format | | [_] | +| package-specs | array of Package-Spec | | [x] | +| entries | array of Target-Item | | [_] | +| bs-external-includes | array of string | | [_] | +| suffix | Suffix | | [x] | +| reanalyze | Reanalyze | | [_] | +| experimental-features | ExperimentalFeatures | | [x] | | editor | object | VS Code tooling only; ignored by rewatch | [x] | ### Source @@ -133,9 +131,9 @@ Currently supported features: ### Js-Post-Build -| Parameter | JSON type | Remark | Implemented? | -| --------- | --------- | ------ | :----------: | -| cmd | string | `${file}` is now an absolute path | [x] | +| Parameter | JSON type | Remark | Implemented? | +| --------- | --------- | --------------------------------- | :----------: | +| cmd | string | `${file}` is now an absolute path | [x] | ### Package-Spec diff --git a/rewatch/src/config.rs b/rewatch/src/config.rs index fae38fd0d8..55ea4baf15 100644 --- a/rewatch/src/config.rs +++ b/rewatch/src/config.rs @@ -717,8 +717,6 @@ impl Config { "cut-generators", "pp-flags", "entries", - "use-stdlib", - "external-stdlib", "bs-external-includes", "reanalyze", ];