Skip to content

Remove refmt.exe / Reason syntax support #5683

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 9 commits into from
Sep 24, 2022
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
jscomp/js_cmj_datasets.ml binary
jscomp/bin/reactjs_ppx_v2.ml binary
jscomp/bin/refmt_main3.ml binary
docs/Manual.html binary
docs/Manual.pdf binary
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ jscomp/bin/*.exe
# so that `npm install && npm intall -g .`
# the second install would use the cached ninja.exe (instead of being ignored)
#
!bin/bsrefmt


#ninja
.ninja_log
.ninja_deps
Expand Down
13 changes: 0 additions & 13 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,6 @@
"fileLocation": "autoDetect",
"owner": "globalUnused"
}
},
{
"label": "check unused refmt",
"command": "node",
"options": {
"cwd": "${workspaceRoot}/lib"
},
"args": ["../scripts/checkUnused.js", "refmt_main3"],
"problemMatcher": {
"base": "$ocamlc",
"fileLocation": "autoDetect",
"owner": "globalUnused"
}
}
]
}
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
> - :house: [Internal]
> - :nail_care: [Polish]

# 10.1.0-rc.1
# 11.0.0-alpha.1

#### :boom: Breaking Change

- Remove support for the legacy Reason syntax. Existing Reason code can be converted to ReScript syntax using ReScript 9 as follows:
- `npm i -g rescript@9`
- `rescript convert <reason files>`
- 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.

# 10.1.0-alpha.2

Expand Down
16 changes: 0 additions & 16 deletions bsrefmt

This file was deleted.

Binary file removed darwin/refmt.exe
Binary file not shown.
Binary file removed darwinarm64/refmt.exe
Binary file not shown.
13 changes: 0 additions & 13 deletions docs/docson/build-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,6 @@
"additionalProperties": false,
"required": ["version"]
},
"refmt-specs": {
"oneOf": [
{
"type": "number",
"enum": [2, 3],
"description": "Reason syntax version to use. Prefer 3. Default: 2, for backward-compatiblity"
},
{
"type": "string",
"description": "(Usually not needed) Alternative path to `refmt`, the Reason syntax binary. Default: path to the `refmt.exe` ReScript provides out of the box"
}
]
},
"bsc-flags": {
"oneOf": [
{
Expand Down
4 changes: 0 additions & 4 deletions jscomp/bsb/bsb_db_util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ let add_basename ~(dir : string) (map : t) ?error_on_invalid_suffix basename : t
(match () with
| _ when file_suffix = Literals.suffix_ml -> ()
| _ when file_suffix = Literals.suffix_res -> syntax_kind := Res
| _ when file_suffix = Literals.suffix_re -> syntax_kind := Reason
| _ when file_suffix = Literals.suffix_mli -> info := Intf
| _ when file_suffix = Literals.suffix_resi ->
info := Intf;
syntax_kind := Res
| _ when file_suffix = Literals.suffix_rei ->
info := Intf;
syntax_kind := Reason
| _ -> invalid_suffix := true);
let info = !info in
let syntax_kind = !syntax_kind in
Expand Down
3 changes: 0 additions & 3 deletions jscomp/bsb/bsb_ninja_file_groups.ml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ let handle_generators oc (group : Bsb_file_groups.file_group) custom_rules =

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

let re_suffixes = { impl = Literals.suffix_re; intf = Literals.suffix_rei }

let ml_suffixes = { impl = Literals.suffix_ml; intf = Literals.suffix_mli }

let res_suffixes = { impl = Literals.suffix_res; intf = Literals.suffix_resi }
Expand All @@ -52,7 +50,6 @@ let emit_module_build (rules : Bsb_ninja_rule.builtin)
let has_intf_file = module_info.info = Impl_intf in
let config, ast_rule =
match module_info.syntax_kind with
| Reason -> (re_suffixes, rules.build_ast_from_re)
| Ml -> (ml_suffixes, rules.build_ast)
| Res -> (res_suffixes, rules.build_ast_from_re)
(* FIXME: better names *)
Expand Down
2 changes: 0 additions & 2 deletions jscomp/bsb/bsb_ninja_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ let output_installation_file cwd_lib_bs namespace files_to_install =
let suffix =
match syntax_kind with
| Ml -> Literals.suffix_ml
| Reason -> Literals.suffix_re
| Res -> Literals.suffix_res
in
oo suffix ~dest:base ~src:(sb // name_sans_extension);
Expand All @@ -124,7 +123,6 @@ let output_installation_file cwd_lib_bs namespace files_to_install =
let suffix_b =
match syntax_kind with
| Ml -> Literals.suffix_mli
| Reason -> Literals.suffix_rei
| Res -> Literals.suffix_resi
in
oo suffix_b ~dest:base ~src:(sb // name_sans_extension);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions jscomp/build_tests/case3/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
"suffix": ".bs.js",
"bs-dependencies": [
],
"warnings": {"error" : "+101"},
"refmt": 3
"warnings": {"error" : "+101"}
}
2 changes: 0 additions & 2 deletions jscomp/build_tests/case3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions jscomp/build_tests/customize_namespace/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
"depa",
"depb"
],
"warnings": {"error" : "+101"},
"refmt": 3
"warnings": {"error" : "+101"}
}
2 changes: 0 additions & 2 deletions jscomp/build_tests/customize_namespace/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions jscomp/build_tests/cycle/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
"suffix": ".bs.js",
"bs-dependencies": [
],
"warnings": {"error" : "+101"},
"refmt": 3
"warnings": {"error" : "+101"}
}
2 changes: 0 additions & 2 deletions jscomp/build_tests/cycle/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion jscomp/build_tests/cycle1/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions jscomp/build_tests/devdeps/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
"bs-dependencies": [
],
"bs-dev-dependencies": ["weird"],
"warnings": {"error":"+101"},
"refmt": 3
"warnings": {"error":"+101"}
}
2 changes: 0 additions & 2 deletions jscomp/build_tests/devdeps/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions jscomp/build_tests/devonly/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
"suffix": ".bs.js",
"bs-dependencies": [
],
"warnings": {"error" : "+101"},
"refmt": 3
"warnings": {"error" : "+101"}
}
2 changes: 0 additions & 2 deletions jscomp/build_tests/devonly/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
"z"
],
"warnings": {"error" : "+101"},
"namespace": true,
"refmt": 3
"namespace": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
"c"
],
"warnings": {"error" : "+101"},
"namespace": true,
"refmt": 3
"namespace": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@

],
"warnings": {"error" : "+101"},
"namespace": true,
"refmt": 3
"namespace": true
}
3 changes: 1 addition & 2 deletions jscomp/build_tests/install/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"suffix": ".bs.js",
"bs-dependencies": [
],
"warnings": {"error" : "+101"},
"refmt": 3
"warnings": {"error" : "+101"}
}

2 changes: 0 additions & 2 deletions jscomp/build_tests/install/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion jscomp/build_tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions jscomp/build_tests/pinned/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions jscomp/build_tests/post-build/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions jscomp/build_tests/react_ppx/bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
}
],
"suffix": ".bs.js",
"namespace": true,
"refmt": 3
"namespace": true
}
1 change: 0 additions & 1 deletion jscomp/build_tests/scoped_ppx/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading