Skip to content

Commit 58f5d36

Browse files
authored
JSX automatic mode as default (#6552)
* JSX automatic mode as default * changelog * fix dead value * revert unnecessary diff
1 parent a10e02b commit 58f5d36

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#### :nail_care: Polish
2626

2727
- Format docstrings. https://github.com/rescript-lang/rescript-compiler/pull/6417
28+
- JSX v4 automatic mode as the default mode https://github.com/rescript-lang/rescript-compiler/pull/6552
2829

2930
# 11.0.0-rc.8
3031

docs/JSXV4.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Another example is a V4 project that also uses `"rescript-react-native", "rescri
4343
4444
### Classic and Automatic Mode
4545

46-
Classic mode is the default and generates calls to `React.createElement` just as with V3.
46+
Classic mode generates calls to `React.createElement` just as with V3.
4747

4848
```json
4949
"jsx": {
@@ -52,7 +52,7 @@ Classic mode is the default and generates calls to `React.createElement` just as
5252
}
5353
```
5454

55-
Automatic mode is an experimental mode that generate calls to `_jsx` functions (similar to TypeScript's `react-jsx` mode)
55+
Automatic mode is the default and generates calls to `_jsx` functions (similar to TypeScript's `react-jsx` mode)
5656

5757
```json
5858
"jsx": {

jscomp/common/js_config.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let force_cmi = ref false
5151
let force_cmj = ref false
5252
let jsx_version = ref None
5353
let jsx_module = ref React
54-
let jsx_mode = ref Classic
54+
let jsx_mode = ref Automatic
5555
let js_stdout = ref true
5656
let all_module_aliases = ref false
5757
let no_stdlib = ref false

jscomp/gentype/ImportPath.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ open GenTypeCommon
33
type t
44

55
val bsCurryPath : config:Config.t -> t
6-
val chopExtensionSafe : t -> t
6+
val chopExtensionSafe : t -> t [@@live]
77
val dump : t -> string
88
val emit : t -> string
99
val fromModule : dir:string -> importExtension:string -> ModuleName.t -> t

jscomp/syntax/cli/res_cli.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ end = struct
177177
let interface = ref false
178178
let jsxVersion = ref (-1)
179179
let jsxModule = ref "react"
180-
let jsxMode = ref "classic"
180+
let jsxMode = ref "automatic"
181181
let file = ref ""
182182
let typechecker = ref false
183183

@@ -215,7 +215,7 @@ end = struct
215215
"Specify the jsx module. Default: react" );
216216
( "-jsx-mode",
217217
Arg.String (fun txt -> jsxMode := txt),
218-
"Specify the jsx mode, classic or automatic. Default: classic" );
218+
"Specify the jsx mode, classic or automatic. Default: automatic" );
219219
( "-typechecker",
220220
Arg.Unit (fun () -> typechecker := true),
221221
"Parses the ast as it would be passed to the typechecker and not the \

0 commit comments

Comments
 (0)