@@ -88,8 +88,7 @@ let check_stdlib (map : json_map) : bool =
88
88
| Some (False _ ) -> false
89
89
| None | Some _ -> true
90
90
91
- let extract_gentype_config (map : json_map ) :
92
- Bsb_config_types. gentype_config =
91
+ let extract_gentype_config (map : json_map ) : Bsb_config_types.gentype_config =
93
92
match map.?(Bsb_build_schemas. gentypeconfig) with
94
93
| None -> false
95
94
| Some (Obj _ ) -> true
@@ -130,53 +129,6 @@ let extract_reason_react_jsx (map : json_map) =
130
129
|> ignore;
131
130
! default
132
131
133
- let extract_jsx (map : json_map ) =
134
- let version : Bsb_config_types.jsx_version option ref = ref None in
135
- let module_ : Bsb_config_types.jsx_module option ref = ref None in
136
- let mode : Bsb_config_types.jsx_mode option ref = ref None in
137
- map
138
- |? ( Bsb_build_schemas. jsx,
139
- `Obj
140
- (fun m ->
141
- match m.?(Bsb_build_schemas. jsx_version) with
142
- | Some (Flo { loc; flo } ) -> (
143
- match flo with
144
- | "3" -> version := Some Jsx_v3
145
- | "4" -> version := Some Jsx_v4
146
- | _ -> Bsb_exception. errorf ~loc " Unsupported jsx-version %s" flo
147
- )
148
- | Some x ->
149
- Bsb_exception. config_error x
150
- " Unexpected input (expect a version number) for jsx-version"
151
- | None -> () ) )
152
- |? ( Bsb_build_schemas. jsx,
153
- `Obj
154
- (fun m ->
155
- match m.?(Bsb_build_schemas. jsx_module) with
156
- | Some (Str { loc; str } ) -> (
157
- match str with
158
- | "react" -> module_ := Some React
159
- | _ -> Bsb_exception. errorf ~loc " Unsupported jsx-module %s" str)
160
- | Some x ->
161
- Bsb_exception. config_error x
162
- " Unexpected input (jsx module name) for jsx-mode"
163
- | None -> () ) )
164
- |? ( Bsb_build_schemas. jsx,
165
- `Obj
166
- (fun m ->
167
- match m.?(Bsb_build_schemas. jsx_mode) with
168
- | Some (Str { loc; str } ) -> (
169
- match str with
170
- | "classic" -> mode := Some Classic
171
- | "automatic" -> mode := Some Automatic
172
- | _ -> Bsb_exception. errorf ~loc " Unsupported jsx-mode %s" str)
173
- | Some x ->
174
- Bsb_exception. config_error x
175
- " Unexpected input (expect classic or automatic) for jsx-mode"
176
- | None -> () ) )
177
- |> ignore;
178
- (! version, ! module_, ! mode)
179
-
180
132
let extract_warning (map : json_map ) =
181
133
match map.?(Bsb_build_schemas. warnings) with
182
134
| None -> Bsb_warning. use_default
@@ -324,7 +276,6 @@ let interpret_json ~(package_kind : Bsb_package_kind.t) ~(per_proj_dir : string)
324
276
.path)
325
277
in
326
278
let reason_react_jsx = extract_reason_react_jsx map in
327
- let jsx_version, jsx_module, jsx_mode = extract_jsx map in
328
279
let bs_dependencies =
329
280
extract_dependencies map per_proj_dir Bsb_build_schemas. bs_dependencies
330
281
in
@@ -381,9 +332,7 @@ let interpret_json ~(package_kind : Bsb_package_kind.t) ~(per_proj_dir : string)
381
332
generate_merlin =
382
333
extract_boolean map Bsb_build_schemas. generate_merlin false ;
383
334
reason_react_jsx;
384
- jsx_version;
385
- jsx_module;
386
- jsx_mode;
335
+ jsx = Bsb_jsx. from_map map;
387
336
generators = extract_generators map;
388
337
cut_generators;
389
338
}
0 commit comments