Skip to content

Commit c68cbc6

Browse files
cknittcristianoc
authored andcommitted
Remove refmt.exe / Reason syntax support (rescript-lang#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 02416c4 commit c68cbc6

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

+253
-117142
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

+5-49
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,14 @@
1010
> - :house: [Internal]
1111
> - :nail_care: [Polish]
1212
13-
# 10.1.0-rc.3
14-
15-
#### :bug: Bug Fix
16-
17-
- Fix issue where the JSX key type is not an optional string https://github.com/rescript-lang/syntax/pull/693
18-
19-
- Prevent inlining of async functions https://github.com/rescript-lang/rescript-compiler/issues/5754
20-
21-
# 10.1.0-rc.2
22-
23-
#### :bug: Bug Fix
24-
25-
- Fix issue with changes not being applied with React Native's Metro bundler for files with warnings https://github.com/rescript-lang/rescript-compiler/pull/5738
26-
- Fix emitting unary minus for floats in case of negative constants https://github.com/rescript-lang/rescript-compiler/pull/5737
27-
- Fix issue where a spread `...x` in non-last position would not be reported as syntax error https://github.com/rescript-lang/syntax/pull/673/
28-
- Fix issue where the formatter would delete `async` in a function with labelled arguments.
29-
- Fix several printing issues with `async` including an infinite loop https://github.com/rescript-lang/syntax/pull/680
30-
- Fix issue where certain JSX expressions would be formatted differenctly in compiler 10.1.0-rc.1 https://github.com/rescript-lang/syntax/issues/675
31-
- Fix issue where printing nested pipe discards await https://github.com/rescript-lang/syntax/issues/687
32-
33-
# 10.1.0-rc.1
13+
# 11.0.0-alpha.1
3414

3515
#### :boom: Breaking Change
3616

37-
- Deprecate DOM element attributes in `JsxDOM.domProps`: `begin_`, `end_`, `to_`
38-
- Use `begin`, `end`, `to` instead.
39-
- Emit an error when a `@string` or `@int` attribute is used in a V4 component https://github.com/rescript-lang/rescript-compiler/issues/5724
40-
41-
## :rocket: New Feature
42-
43-
- Add extra variants for output filename suffixes in `bsconfig.json`: `.bs.mjs` and `.bs.cjs` are allowed https://github.com/rescript-lang/rescript-compiler/pull/5631
44-
- Safe promises: t-first Js.Promise2 bindings, and remove warning for nested promises https://github.com/rescript-lang/rescript-compiler/pull/5709
45-
46-
#### :bug: Bug Fix
47-
48-
- Fix issue where uncurried async functions were emitted without `async` https://github.com/rescript-lang/rescript-compiler/pull/5718
49-
- Fix location issue in error messages with JSX V4 where the multiple props types are defined https://github.com/rescript-lang/syntax/pull/655
50-
- Fix location issue in make function in JSX V4 that breaks dead code elimination https://github.com/rescript-lang/syntax/pull/660
51-
- Fix parsing (hence pretty printing) of expressions with underscore `_` and comments.
52-
- Fix printing of comments inside JSX tag https://github.com/rescript-lang/syntax/pull/664
53-
- Fix issue where formatter erases tail comments inside JSX tag https://github.com/rescript-lang/syntax/issues/663
54-
- Fix issue where the JSX prop has type annotation of the first class module https://github.com/rescript-lang/syntax/pull/666
55-
- Fix issue where an empty record literal {} expected to have a non-record type would type check https://github.com/rescript-lang/rescript-compiler/pull/5729
56-
57-
#### :eyeglasses: Spec Compliance
58-
59-
- Functions with consecutive dots now print as multiple arrow functions like in JavaScript.
60-
61-
#### :nail_care: Polish
62-
63-
- Add `loading`, `aria-*` DOM element attributes in `JsxDOM.domProps`: `ariaCurrent`, `ariaInvalid`, `ariaAutocomplete`, etc.
64-
- Change the internal representation of props for the lowercase components to record. https://github.com/rescript-lang/syntax/pull/665
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.
6521

6622
# 10.1.0-alpha.2
6723

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.

0 commit comments

Comments
 (0)