Skip to content

Commit 32dc3c6

Browse files
cknittcristianoc
authored andcommitted
Remove refmt.exe / Reason syntax support (#5683)
* Remove bsrefmt * Remove refmt.exe * Remove "refmt": 3 * Remove ast_reason_pp module and re/rei file extensions * Remove leftover js_refmt_compiler * Remove refmt_main3.ml * Fix moveArtifacts script * Clean up literals.ml * Update CHANGELOG
1 parent 5a2c5ce commit 32dc3c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+256
-117094
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
jscomp/js_cmj_datasets.ml binary
22
jscomp/bin/reactjs_ppx_v2.ml binary
3-
jscomp/bin/refmt_main3.ml binary
43
docs/Manual.html binary
54
docs/Manual.pdf binary

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ jscomp/bin/*.exe
7373
# so that `npm install && npm intall -g .`
7474
# the second install would use the cached ninja.exe (instead of being ignored)
7575
#
76-
!bin/bsrefmt
77-
78-
7976
#ninja
8077
.ninja_log
8178
.ninja_deps

.vscode/tasks.json

-13
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,6 @@
7474
"fileLocation": "autoDetect",
7575
"owner": "globalUnused"
7676
}
77-
},
78-
{
79-
"label": "check unused refmt",
80-
"command": "node",
81-
"options": {
82-
"cwd": "${workspaceRoot}/lib"
83-
},
84-
"args": ["../scripts/checkUnused.js", "refmt_main3"],
85-
"problemMatcher": {
86-
"base": "$ocamlc",
87-
"fileLocation": "autoDetect",
88-
"owner": "globalUnused"
89-
}
9077
}
9178
]
9279
}

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010
> - :house: [Internal]
1111
> - :nail_care: [Polish]
1212
13-
# 10.1.0-rc.1
13+
# 11.0.0-alpha.1
14+
15+
#### :boom: Breaking Change
16+
17+
- Remove support for the legacy Reason syntax. Existing Reason code can be converted to ReScript syntax using ReScript 9 as follows:
18+
- `npm i -g rescript@9`
19+
- `rescript convert <reason files>`
20+
- Remove obsolete built-in project templates and the "rescript init" functionality. This will be replaced by the create-rescript-app project that is maintained separately.
1421

1522
## :rocket: New Feature
1623

bsrefmt

-16
This file was deleted.

darwin/refmt.exe

-8.49 MB
Binary file not shown.

darwinarm64/refmt.exe

-8.49 MB
Binary file not shown.

docs/docson/build-schema.json

-13
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,6 @@
354354
"additionalProperties": false,
355355
"required": ["version"]
356356
},
357-
"refmt-specs": {
358-
"oneOf": [
359-
{
360-
"type": "number",
361-
"enum": [2, 3],
362-
"description": "Reason syntax version to use. Prefer 3. Default: 2, for backward-compatiblity"
363-
},
364-
{
365-
"type": "string",
366-
"description": "(Usually not needed) Alternative path to `refmt`, the Reason syntax binary. Default: path to the `refmt.exe` ReScript provides out of the box"
367-
}
368-
]
369-
},
370357
"bsc-flags": {
371358
"oneOf": [
372359
{

jscomp/bsb/bsb_db_util.ml

-4
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,10 @@ let add_basename ~(dir : string) (map : t) ?error_on_invalid_suffix basename : t
8181
(match () with
8282
| _ when file_suffix = Literals.suffix_ml -> ()
8383
| _ when file_suffix = Literals.suffix_res -> syntax_kind := Res
84-
| _ when file_suffix = Literals.suffix_re -> syntax_kind := Reason
8584
| _ when file_suffix = Literals.suffix_mli -> info := Intf
8685
| _ when file_suffix = Literals.suffix_resi ->
8786
info := Intf;
8887
syntax_kind := Res
89-
| _ when file_suffix = Literals.suffix_rei ->
90-
info := Intf;
91-
syntax_kind := Reason
9288
| _ -> invalid_suffix := true);
9389
let info = !info in
9490
let syntax_kind = !syntax_kind in

jscomp/bsb/bsb_ninja_file_groups.ml

-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ let handle_generators oc (group : Bsb_file_groups.file_group) custom_rules =
4040

4141
type suffixes = { impl : string; intf : string }
4242

43-
let re_suffixes = { impl = Literals.suffix_re; intf = Literals.suffix_rei }
44-
4543
let ml_suffixes = { impl = Literals.suffix_ml; intf = Literals.suffix_mli }
4644

4745
let res_suffixes = { impl = Literals.suffix_res; intf = Literals.suffix_resi }
@@ -52,7 +50,6 @@ let emit_module_build (rules : Bsb_ninja_rule.builtin)
5250
let has_intf_file = module_info.info = Impl_intf in
5351
let config, ast_rule =
5452
match module_info.syntax_kind with
55-
| Reason -> (re_suffixes, rules.build_ast_from_re)
5653
| Ml -> (ml_suffixes, rules.build_ast)
5754
| Res -> (res_suffixes, rules.build_ast_from_re)
5855
(* FIXME: better names *)

jscomp/bsb/bsb_ninja_gen.ml

-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ let output_installation_file cwd_lib_bs namespace files_to_install =
113113
let suffix =
114114
match syntax_kind with
115115
| Ml -> Literals.suffix_ml
116-
| Reason -> Literals.suffix_re
117116
| Res -> Literals.suffix_res
118117
in
119118
oo suffix ~dest:base ~src:(sb // name_sans_extension);
@@ -124,7 +123,6 @@ let output_installation_file cwd_lib_bs namespace files_to_install =
124123
let suffix_b =
125124
match syntax_kind with
126125
| Ml -> Literals.suffix_mli
127-
| Reason -> Literals.suffix_rei
128126
| Res -> Literals.suffix_resi
129127
in
130128
oo suffix_b ~dest:base ~src:(sb // name_sans_extension);

jscomp/build_tests/bs_dependencies_node_path_override/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/case3/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
"suffix": ".bs.js",
1313
"bs-dependencies": [
1414
],
15-
"warnings": {"error" : "+101"},
16-
"refmt": 3
15+
"warnings": {"error" : "+101"}
1716
}

jscomp/build_tests/case3/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/customize_namespace/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
"depa",
1515
"depb"
1616
],
17-
"warnings": {"error" : "+101"},
18-
"refmt": 3
17+
"warnings": {"error" : "+101"}
1918
}

jscomp/build_tests/customize_namespace/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/cycle/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
"suffix": ".bs.js",
1313
"bs-dependencies": [
1414
],
15-
"warnings": {"error" : "+101"},
16-
"refmt": 3
15+
"warnings": {"error" : "+101"}
1716
}

jscomp/build_tests/cycle/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/cycle1/package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/devdeps/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@
1818
"bs-dependencies": [
1919
],
2020
"bs-dev-dependencies": ["weird"],
21-
"warnings": {"error":"+101"},
22-
"refmt": 3
21+
"warnings": {"error":"+101"}
2322
}

jscomp/build_tests/devdeps/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/devonly/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
"suffix": ".bs.js",
1717
"bs-dependencies": [
1818
],
19-
"warnings": {"error" : "+101"},
20-
"refmt": 3
19+
"warnings": {"error" : "+101"}
2120
}

jscomp/build_tests/devonly/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/duplicated_symlinked_packages/a/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@
1515
"z"
1616
],
1717
"warnings": {"error" : "+101"},
18-
"namespace": true,
19-
"refmt": 3
18+
"namespace": true
2019
}

jscomp/build_tests/duplicated_symlinked_packages/b/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
"c"
1515
],
1616
"warnings": {"error" : "+101"},
17-
"namespace": true,
18-
"refmt": 3
17+
"namespace": true
1918
}

jscomp/build_tests/duplicated_symlinked_packages/c/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414

1515
],
1616
"warnings": {"error" : "+101"},
17-
"namespace": true,
18-
"refmt": 3
17+
"namespace": true
1918
}

jscomp/build_tests/install/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"suffix": ".bs.js",
1313
"bs-dependencies": [
1414
],
15-
"warnings": {"error" : "+101"},
16-
"refmt": 3
15+
"warnings": {"error" : "+101"}
1716
}
1817

jscomp/build_tests/install/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/pinned/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/post-build/package-lock.json

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/react_ppx/bsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
}
1515
],
1616
"suffix": ".bs.js",
17-
"namespace": true,
18-
"refmt": 3
17+
"namespace": true
1918
}

jscomp/build_tests/scoped_ppx/package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)