Skip to content

Commit 23ae897

Browse files
authored
Remove external stdlib (#8175)
1 parent 4bc7266 commit 23ae897

7 files changed

Lines changed: 40 additions & 67 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#### :boom: Breaking Change
1616

1717
- `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.
18+
- Remove `external-stdlib` configuration option from `rescript.json`. This option was rarely used and is no longer supported.
1819

1920
#### :eyeglasses: Spec Compliance
2021

compiler/bsb/bsb_build_schemas.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let package_specs = "package-specs"
4747
let type_ = "type"
4848
let export_all = "all"
4949
let export_none = "none"
50-
let external_stdlib = "external-stdlib"
50+
5151
let jsx = "jsx"
5252
let jsx_version = "version"
5353
let jsx_module = "module"

compiler/bsb/bsb_package_specs.ml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* Copyright (C) 2017 Hongbo Zhang, Authors of ReScript
2-
*
2+
*
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU Lesser General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or
@@ -17,7 +17,7 @@
1717
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1818
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1919
* GNU Lesser General Public License for more details.
20-
*
20+
*
2121
* You should have received a copy of the GNU Lesser General Public License
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. *)
@@ -27,13 +27,7 @@ let ( // ) = Ext_path.combine
2727
(*FIXME: use assoc list instead *)
2828
module Spec_set = Bsb_spec_set
2929

30-
type t = {
31-
modules: Spec_set.t;
32-
runtime: string option;
33-
(* This has to be resolved as early as possible, since
34-
the path will be inherited in sub projects
35-
*)
36-
}
30+
type t = {modules: Spec_set.t}
3731

3832
let ( .?() ) = Map_string.find_opt
3933

@@ -159,9 +153,7 @@ let package_flag_of_package_specs (package_specs : t) ~(dirname : string) :
159153
(fun format acc -> Ext_string.inter2 acc (package_flag format dirname))
160154
package_specs.modules Ext_string.empty
161155
in
162-
match package_specs.runtime with
163-
| None -> res
164-
| Some x -> Ext_string.inter3 res "-runtime" x
156+
res
165157

166158
let default_package_specs suffix =
167159
(* TODO: swap default to Esmodule in v12 *)
@@ -205,18 +197,11 @@ let extract_js_suffix_exn (map : json_map) : string =
205197
Bsb_exception.config_error config "expected a string extension like \".js\""
206198

207199
let from_map ~(cwd : string) map =
200+
ignore cwd;
208201
let suffix = extract_js_suffix_exn map in
209202
let modules =
210203
match map.?(Bsb_build_schemas.package_specs) with
211204
| Some x -> from_json suffix x
212205
| None -> default_package_specs suffix
213206
in
214-
let runtime =
215-
match map.?(Bsb_build_schemas.external_stdlib) with
216-
| None -> None
217-
| Some (Str {str; _}) ->
218-
Some
219-
(Bsb_pkg.resolve_bs_package ~cwd (Bsb_pkg_types.string_as_package str))
220-
| _ -> assert false
221-
in
222-
{runtime; modules}
207+
{modules}

compiler/gentype/GenTypeConfig.ml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,7 @@ let read_config ~get_config_file ~namespace =
177177
| Some b -> b
178178
in
179179
let generated_file_extension = generated_file_extension_string_option in
180-
let external_stdlib = bsconf |> get_string_option "external-stdlib" in
181-
let platform_lib =
182-
match external_stdlib with
183-
| None -> "rescript"
184-
| Some external_stdlib -> external_stdlib
185-
in
180+
let platform_lib = "rescript" in
186181
if !Debug.config then (
187182
Log_.item "Project roLiterals.bsconfig_jsonot: %s\n" project_root;
188183
if bsb_project_root <> project_root then

docs/docson/build-schema.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,6 @@
460460
"$ref": "#/definitions/package-specs",
461461
"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)"
462462
},
463-
"external-stdlib": {
464-
"type": "string",
465-
"description": "Use the external stdlib library instead of the one shipped with the compiler package"
466-
},
467463
"bs-external-includes": {
468464
"type": "array",
469465
"items": {

rewatch/CompilerConfigurationSpec.md

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,34 @@
22

33
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.
44

5-
| Parameter | JSON type | Remark | Implemented? |
6-
| --------------------- | ----------------------- | ------ | :----------: |
7-
| name | string | | [x] |
8-
| namespace | boolean | | [x] |
9-
| namespace | string | | [x] |
10-
| sources | string | | [x] |
11-
| sources | array of string | | [x] |
12-
| sources | Source | | [x] |
13-
| sources | array of Source | | [x] |
14-
| ignored-dirs | array of string | | [_] |
15-
| dependencies | array of string | | [x] |
16-
| dev-dependencies | array of string | | [x] |
17-
| generators | array of Rule-Generator | | [_] |
18-
| cut-generators | boolean | | [_] |
19-
| jsx | JSX | | [x] |
20-
| gentypeconfig | Gentype | | [x] |
21-
| compiler-flags | array of string | | [x] |
22-
| warnings | Warnings | | [x] |
23-
| ppx-flags | array of string | | [x] |
24-
| pp-flags | array of string | | [_] |
25-
| js-post-build | Js-Post-Build | `${file}` is now an absolute path | [x] |
26-
| package-specs | array of Module-Format | | [_] |
27-
| package-specs | array of Package-Spec | | [x] |
28-
| entries | array of Target-Item | | [_] |
29-
| use-stdlib | boolean | | [_] |
30-
| external-stdlib | string | | [_] |
31-
| bs-external-includes | array of string | | [_] |
32-
| suffix | Suffix | | [x] |
33-
| reanalyze | Reanalyze | | [_] |
34-
| experimental-features | ExperimentalFeatures | | [x] |
5+
| Parameter | JSON type | Remark | Implemented? |
6+
| --------------------- | ----------------------- | ---------------------------------------- | :----------: |
7+
| name | string | | [x] |
8+
| namespace | boolean | | [x] |
9+
| namespace | string | | [x] |
10+
| sources | string | | [x] |
11+
| sources | array of string | | [x] |
12+
| sources | Source | | [x] |
13+
| sources | array of Source | | [x] |
14+
| ignored-dirs | array of string | | [_] |
15+
| dependencies | array of string | | [x] |
16+
| dev-dependencies | array of string | | [x] |
17+
| generators | array of Rule-Generator | | [_] |
18+
| cut-generators | boolean | | [_] |
19+
| jsx | JSX | | [x] |
20+
| gentypeconfig | Gentype | | [x] |
21+
| compiler-flags | array of string | | [x] |
22+
| warnings | Warnings | | [x] |
23+
| ppx-flags | array of string | | [x] |
24+
| pp-flags | array of string | | [_] |
25+
| js-post-build | Js-Post-Build | `${file}` is now an absolute path | [x] |
26+
| package-specs | array of Module-Format | | [_] |
27+
| package-specs | array of Package-Spec | | [x] |
28+
| entries | array of Target-Item | | [_] |
29+
| bs-external-includes | array of string | | [_] |
30+
| suffix | Suffix | | [x] |
31+
| reanalyze | Reanalyze | | [_] |
32+
| experimental-features | ExperimentalFeatures | | [x] |
3533
| editor | object | VS Code tooling only; ignored by rewatch | [x] |
3634

3735
### Source
@@ -133,9 +131,9 @@ Currently supported features:
133131

134132
### Js-Post-Build
135133

136-
| Parameter | JSON type | Remark | Implemented? |
137-
| --------- | --------- | ------ | :----------: |
138-
| cmd | string | `${file}` is now an absolute path | [x] |
134+
| Parameter | JSON type | Remark | Implemented? |
135+
| --------- | --------- | --------------------------------- | :----------: |
136+
| cmd | string | `${file}` is now an absolute path | [x] |
139137

140138
### Package-Spec
141139

rewatch/src/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,6 @@ impl Config {
717717
"cut-generators",
718718
"pp-flags",
719719
"entries",
720-
"use-stdlib",
721-
"external-stdlib",
722720
"bs-external-includes",
723721
"reanalyze",
724722
];

0 commit comments

Comments
 (0)