diff --git a/CHANGELOG.md b/CHANGELOG.md index adf1501b22..2e71fa7ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Remove internal/unused `-bs-v` flag. https://github.com/rescript-lang/rescript/pull/7627 - Remove unused `-bs-D` and `-bs-list-conditionals` flags. https://github.com/rescript-lang/rescript/pull/7631 +- Remove obsolete jsx options. https://github.com/rescript-lang/rescript/pull/7633 # 12.0.0-beta.1 diff --git a/analysis/examples/example-project/bsconfig.json b/analysis/examples/example-project/bsconfig.json index f592900000..3d9a812dc6 100644 --- a/analysis/examples/example-project/bsconfig.json +++ b/analysis/examples/example-project/bsconfig.json @@ -6,7 +6,6 @@ "number": "-32-26-27-33" }, "bs-dependencies": ["reason-react"], - "reason": { "react-jsx": 3 }, "namespace": "my-namespace", "reanalyze": { "analysis": ["dce", "exception"] diff --git a/analysis/examples/larger-project/bsconfig.json b/analysis/examples/larger-project/bsconfig.json index e3a2f6f551..56d0975d84 100644 --- a/analysis/examples/larger-project/bsconfig.json +++ b/analysis/examples/larger-project/bsconfig.json @@ -6,7 +6,6 @@ }, "name": "sample-typescript-app", "bsc-flags": ["-bs-super-errors -w a"], - "reason": { "react-jsx": 3 }, "bs-dependencies": ["@rescript/react", "@glennsl/bs-json"], "sources": [ { diff --git a/compiler/bsb/bsb_build_schemas.ml b/compiler/bsb/bsb_build_schemas.ml index 12e16ae65c..5e210619e6 100644 --- a/compiler/bsb/bsb_build_schemas.ml +++ b/compiler/bsb/bsb_build_schemas.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. *) @@ -46,8 +46,6 @@ let type_ = "type" let export_all = "all" let export_none = "none" let external_stdlib = "external-stdlib" -let reason = "reason" -let react_jsx = "react-jsx" let jsx = "jsx" let jsx_version = "version" let jsx_module = "module" diff --git a/compiler/bsc/rescript_compiler_main.ml b/compiler/bsc/rescript_compiler_main.ml index ab569d4083..a975a3073f 100644 --- a/compiler/bsc/rescript_compiler_main.ml +++ b/compiler/bsc/rescript_compiler_main.ml @@ -228,7 +228,7 @@ let[@inline] string_list_add s : Bsc_args.spec = String (String_list_add s) (* mostly common used to list in the beginning to make search fast *) -let buckle_script_flags : (string * Bsc_args.spec * string) array = +let command_line_flags : (string * Bsc_args.spec * string) array = [| ( "-I", string_list_add Clflags.include_dirs, @@ -258,8 +258,7 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array = "*internal* Opens the module before typing" ); ( "-bs-jsx", string_call (fun i -> - if i <> "3" && i <> "4" then - Bsc_args.bad_arg (" Not supported jsx version : " ^ i); + if i <> "4" then Bsc_args.bad_arg ("Unsupported jsx version: " ^ i); Js_config.jsx_version := Js_config.jsx_version_of_int @@ int_of_string i), "*internal* Set jsx version" ); @@ -446,7 +445,7 @@ let file_level_flags_handler (e : Parsetree.expression option) = Location.raise_errorf ~loc:e.pexp_loc "string literal expected")) in try - Bsc_args.parse_exn ~start:0 ~argv:args buckle_script_flags + Bsc_args.parse_exn ~start:0 ~argv:args command_line_flags (fun ~rev_args:_ -> ()) ~usage with _ -> @@ -460,9 +459,7 @@ let _ : unit = let flags = "flags" in Ast_config.add_structure flags file_level_flags_handler; Ast_config.add_signature flags file_level_flags_handler; - try - Bsc_args.parse_exn ~argv:Sys.argv buckle_script_flags anonymous ~usage - with + try Bsc_args.parse_exn ~argv:Sys.argv command_line_flags anonymous ~usage with | Bsc_args.Bad msg -> Format.eprintf "%s@." msg; exit 2 diff --git a/compiler/syntax/src/jsx_ppx.mli b/compiler/syntax/src/jsx_ppx.mli index de5bd83f8f..36ff84f541 100644 --- a/compiler/syntax/src/jsx_ppx.mli +++ b/compiler/syntax/src/jsx_ppx.mli @@ -3,9 +3,6 @@ a ReasonReact-specific function call. Aka, this is a macro, using OCaml's ppx facilities; https://whitequark.org/blog/2014/04/16/a-guide-to-extension- points-in-ocaml/ - You wouldn't use this file directly; it's used by ReScript's - rescript.json. Specifically, there's a field called `react-jsx` inside the - field `reason`, which enables this ppx through some internal call in bsb *) val rewrite_implementation : diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index 9c5cc6ee53..730eaca3e0 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -91,11 +91,6 @@ }, "additionalProperties": false }, - "react-jsx-version": { - "title": "jsx-version", - "type": "number", - "description": "backward compatible mode, true means on with the default to be version 1 (the default value is subject to change)" - }, "ppx-specs": { "type": "array", "items": { diff --git a/rewatch/CompilerConfigurationSpec.md b/rewatch/CompilerConfigurationSpec.md index ddfbdcfc54..dd43df0550 100644 --- a/rewatch/CompilerConfigurationSpec.md +++ b/rewatch/CompilerConfigurationSpec.md @@ -19,8 +19,6 @@ This document contains a list of all bsconfig parameters with remarks, and wheth | generators | array of Rule-Generator | | [_] | | cut-generators | boolean | | [_] | | jsx | JSX | | [x] | -| uncurried | boolean | | [x] | -| reason | Reason | | [x] | | gentypeconfig | Gentype | | [_] | | bsc-flags | array of string | | [x] | | warnings | Warnings | | [x] | @@ -144,12 +142,6 @@ enum: "commonjs" | "es6" | "es6-global" enum: ".js" | ".mjs" | ".cjs" | ".bs.js" | ".bs.mjs" | ".bs.cjs" -### Reason - -| Parameter | JSON type | Remark | Implemented? | -| --------- | --------- | ------ | :----------: | -| react-jsx | number | | [x] | - ### Target-Item Not really usable by ReScript, likely to be removed. diff --git a/rewatch/src/build/packages.rs b/rewatch/src/build/packages.rs index 92d15bb6fd..c5bc613f76 100644 --- a/rewatch/src/build/packages.rs +++ b/rewatch/src/build/packages.rs @@ -983,7 +983,6 @@ mod test { bs_dev_dependencies: Some(build_dev_deps), ppx_flags: None, bsc_flags: None, - reason: None, namespace: None, jsx: None, gentype_config: None, diff --git a/rewatch/src/config.rs b/rewatch/src/config.rs index 31044e65b3..708d17154b 100644 --- a/rewatch/src/config.rs +++ b/rewatch/src/config.rs @@ -145,16 +145,6 @@ pub struct Warnings { pub error: Option, } -#[derive(Deserialize, Debug, Clone, PartialEq, Hash)] -#[serde(untagged)] -pub enum Reason { - Versioned { - #[serde(rename = "react-jsx")] - react_jsx: i32, - }, - Unversioned(bool), -} - #[derive(Deserialize, Debug, Clone)] #[serde(untagged)] pub enum NamespaceConfig { @@ -212,7 +202,6 @@ pub struct Config { pub ppx_flags: Option>>, #[serde(rename = "bsc-flags", alias = "compiler-flags")] pub bsc_flags: Option>>, - pub reason: Option, pub namespace: Option, pub jsx: Option, #[serde(rename = "gentypeconfig")] @@ -373,22 +362,15 @@ impl Config { } } pub fn get_jsx_args(&self) -> Vec { - match (self.reason.to_owned(), self.jsx.to_owned()) { - (_, Some(jsx)) => match jsx.version { + match self.jsx.to_owned() { + Some(jsx) => match jsx.version { Some(version) if version == 3 || version == 4 => { vec!["-bs-jsx".to_string(), version.to_string()] } Some(_version) => panic!("Unsupported JSX version"), None => vec![], }, - (Some(Reason::Versioned { react_jsx }), None) => { - vec!["-bs-jsx".to_string(), format!("{}", react_jsx)] - } - (Some(Reason::Unversioned(true)), None) => { - // If Reason is 'true' - we should default to the latest - vec!["-bs-jsx".to_string()] - } - _ => vec![], + None => vec![], } } diff --git a/rewatch/testrepo/bsconfig.json b/rewatch/testrepo/bsconfig.json index 95e49a9f45..dfa69cf830 100644 --- a/rewatch/testrepo/bsconfig.json +++ b/rewatch/testrepo/bsconfig.json @@ -31,8 +31,5 @@ "@testrepo/namespace-casing", "@testrepo/with-dev-deps", "@testrepo/compiled-by-legacy" - ], - "reason": { - "react-jsx": 3 - } + ] } diff --git a/tests/ounit_tests/ounit_bsb_regex_tests.ml b/tests/ounit_tests/ounit_bsb_regex_tests.ml index 57eb79567a..0f46051536 100644 --- a/tests/ounit_tests/ounit_bsb_regex_tests.ml +++ b/tests/ounit_tests/ounit_bsb_regex_tests.ml @@ -37,7 +37,6 @@ let suites = "sources": [ "src" ], - "reason" : { "react-jsx" : true}, "bs-dependencies" : [ ] } @@ -49,7 +48,6 @@ let suites = "sources": [ "src" ], - "reason" : { "react-jsx" : true}, "bs-dependencies" : [ ] }