Skip to content

Commit 63e9922

Browse files
committed
Sync syntax: remove reason related module usage such as ReasonReact in JSX.
1 parent e9cbbdd commit 63e9922

File tree

4 files changed

+25
-37
lines changed

4 files changed

+25
-37
lines changed

lib/4.06.1/unstable/js_compiler.ml

+8-12
Original file line numberDiff line numberDiff line change
@@ -273354,29 +273354,26 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
273354273354
let propsCall =
273355273355
Exp.apply
273356273356
(Exp.ident
273357-
{
273358-
loc = Location.none;
273359-
txt = Ldot (Lident "ReactDOMRe", "domProps");
273360-
})
273357+
{loc = Location.none; txt = Ldot (Lident "ReactDOM", "domProps")})
273361273358
(nonEmptyProps
273362273359
|> List.map (fun (label, expression) ->
273363273360
(label, mapper.expr mapper expression)))
273364273361
in
273365273362
[
273366273363
(* "div" *)
273367273364
(nolabel, componentNameExpr);
273368-
(* ReactDOMRe.domProps(~className=blabla, ~foo=bar, ()) *)
273365+
(* ReactDOM.domProps(~className=blabla, ~foo=bar, ()) *)
273369273366
(labelled "props", propsCall);
273370273367
(* [|moreCreateElementCallsHere|] *)
273371273368
(nolabel, childrenExpr);
273372273369
]
273373273370
in
273374273371
Exp.apply ~loc:jsxExprLoc ~attrs
273375-
(* ReactDOMRe.createElement *)
273372+
(* ReactDOM.createElement *)
273376273373
(Exp.ident
273377273374
{
273378273375
loc = Location.none;
273379-
txt = Ldot (Lident "ReactDOMRe", createElementCall);
273376+
txt = Ldot (Lident "ReactDOM", createElementCall);
273380273377
})
273381273378
args
273382273379

@@ -274049,7 +274046,7 @@ let transformJsxCall ~config mapper callExpression callArguments jsxExprLoc
274049274046
callArguments
274050274047
(* div(~prop1=foo, ~prop2=bar, ~children=[bla], ()) *)
274051274048
(* turn that into
274052-
ReactDOMRe.createElement(~props=ReactDOMRe.props(~props1=foo, ~props2=bar, ()), [|bla|]) *)
274049+
ReactDOM.createElement(~props=ReactDOM.props(~props1=foo, ~props2=bar, ()), [|bla|]) *)
274053274050
| {loc; txt = Lident id} ->
274054274051
transformLowercaseCall3 ~config mapper jsxExprLoc loc attrs callArguments
274055274052
id
@@ -274111,7 +274108,7 @@ let expr ~config mapper expression =
274111274108
| "automatic" ->
274112274109
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsxFragment")}
274113274110
| "classic" | _ ->
274114-
Exp.ident ~loc {loc; txt = Ldot (Lident "ReasonReact", "fragment")}
274111+
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "fragment")}
274115274112
in
274116274113
let childrenExpr = transformChildrenIfList ~mapper listItems in
274117274114
let args =
@@ -274142,15 +274139,14 @@ let expr ~config mapper expression =
274142274139
Exp.apply
274143274140
~loc (* throw away the [@JSX] attribute and keep the others, if any *)
274144274141
~attrs:nonJSXAttributes
274145-
(* ReactDOMRe.createElement *)
274142+
(* ReactDOM.createElement *)
274146274143
(match config.mode with
274147274144
| "automatic" ->
274148274145
if countOfChildren childrenExpr > 1 then
274149274146
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsxs")}
274150274147
else Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsx")}
274151274148
| "classic" | _ ->
274152-
Exp.ident ~loc
274153-
{loc; txt = Ldot (Lident "ReactDOMRe", "createElement")})
274149+
Exp.ident ~loc {loc; txt = Ldot (Lident "ReactDOM", "createElement")})
274154274150
args)
274155274151
(* Delegate to the default mapper, a deep identity traversal *)
274156274152
| e -> default_mapper.expr mapper e

lib/4.06.1/unstable/js_playground_compiler.ml

+8-12
Original file line numberDiff line numberDiff line change
@@ -274817,29 +274817,26 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
274817274817
let propsCall =
274818274818
Exp.apply
274819274819
(Exp.ident
274820-
{
274821-
loc = Location.none;
274822-
txt = Ldot (Lident "ReactDOMRe", "domProps");
274823-
})
274820+
{loc = Location.none; txt = Ldot (Lident "ReactDOM", "domProps")})
274824274821
(nonEmptyProps
274825274822
|> List.map (fun (label, expression) ->
274826274823
(label, mapper.expr mapper expression)))
274827274824
in
274828274825
[
274829274826
(* "div" *)
274830274827
(nolabel, componentNameExpr);
274831-
(* ReactDOMRe.domProps(~className=blabla, ~foo=bar, ()) *)
274828+
(* ReactDOM.domProps(~className=blabla, ~foo=bar, ()) *)
274832274829
(labelled "props", propsCall);
274833274830
(* [|moreCreateElementCallsHere|] *)
274834274831
(nolabel, childrenExpr);
274835274832
]
274836274833
in
274837274834
Exp.apply ~loc:jsxExprLoc ~attrs
274838-
(* ReactDOMRe.createElement *)
274835+
(* ReactDOM.createElement *)
274839274836
(Exp.ident
274840274837
{
274841274838
loc = Location.none;
274842-
txt = Ldot (Lident "ReactDOMRe", createElementCall);
274839+
txt = Ldot (Lident "ReactDOM", createElementCall);
274843274840
})
274844274841
args
274845274842

@@ -275512,7 +275509,7 @@ let transformJsxCall ~config mapper callExpression callArguments jsxExprLoc
275512275509
callArguments
275513275510
(* div(~prop1=foo, ~prop2=bar, ~children=[bla], ()) *)
275514275511
(* turn that into
275515-
ReactDOMRe.createElement(~props=ReactDOMRe.props(~props1=foo, ~props2=bar, ()), [|bla|]) *)
275512+
ReactDOM.createElement(~props=ReactDOM.props(~props1=foo, ~props2=bar, ()), [|bla|]) *)
275516275513
| {loc; txt = Lident id} ->
275517275514
transformLowercaseCall3 ~config mapper jsxExprLoc loc attrs callArguments
275518275515
id
@@ -275574,7 +275571,7 @@ let expr ~config mapper expression =
275574275571
| "automatic" ->
275575275572
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsxFragment")}
275576275573
| "classic" | _ ->
275577-
Exp.ident ~loc {loc; txt = Ldot (Lident "ReasonReact", "fragment")}
275574+
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "fragment")}
275578275575
in
275579275576
let childrenExpr = transformChildrenIfList ~mapper listItems in
275580275577
let args =
@@ -275605,15 +275602,14 @@ let expr ~config mapper expression =
275605275602
Exp.apply
275606275603
~loc (* throw away the [@JSX] attribute and keep the others, if any *)
275607275604
~attrs:nonJSXAttributes
275608-
(* ReactDOMRe.createElement *)
275605+
(* ReactDOM.createElement *)
275609275606
(match config.mode with
275610275607
| "automatic" ->
275611275608
if countOfChildren childrenExpr > 1 then
275612275609
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsxs")}
275613275610
else Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsx")}
275614275611
| "classic" | _ ->
275615-
Exp.ident ~loc
275616-
{loc; txt = Ldot (Lident "ReactDOMRe", "createElement")})
275612+
Exp.ident ~loc {loc; txt = Ldot (Lident "ReactDOM", "createElement")})
275617275613
args)
275618275614
(* Delegate to the default mapper, a deep identity traversal *)
275619275615
| e -> default_mapper.expr mapper e

lib/4.06.1/whole_compiler.ml

+8-12
Original file line numberDiff line numberDiff line change
@@ -285196,29 +285196,26 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
285196285196
let propsCall =
285197285197
Exp.apply
285198285198
(Exp.ident
285199-
{
285200-
loc = Location.none;
285201-
txt = Ldot (Lident "ReactDOMRe", "domProps");
285202-
})
285199+
{loc = Location.none; txt = Ldot (Lident "ReactDOM", "domProps")})
285203285200
(nonEmptyProps
285204285201
|> List.map (fun (label, expression) ->
285205285202
(label, mapper.expr mapper expression)))
285206285203
in
285207285204
[
285208285205
(* "div" *)
285209285206
(nolabel, componentNameExpr);
285210-
(* ReactDOMRe.domProps(~className=blabla, ~foo=bar, ()) *)
285207+
(* ReactDOM.domProps(~className=blabla, ~foo=bar, ()) *)
285211285208
(labelled "props", propsCall);
285212285209
(* [|moreCreateElementCallsHere|] *)
285213285210
(nolabel, childrenExpr);
285214285211
]
285215285212
in
285216285213
Exp.apply ~loc:jsxExprLoc ~attrs
285217-
(* ReactDOMRe.createElement *)
285214+
(* ReactDOM.createElement *)
285218285215
(Exp.ident
285219285216
{
285220285217
loc = Location.none;
285221-
txt = Ldot (Lident "ReactDOMRe", createElementCall);
285218+
txt = Ldot (Lident "ReactDOM", createElementCall);
285222285219
})
285223285220
args
285224285221

@@ -285891,7 +285888,7 @@ let transformJsxCall ~config mapper callExpression callArguments jsxExprLoc
285891285888
callArguments
285892285889
(* div(~prop1=foo, ~prop2=bar, ~children=[bla], ()) *)
285893285890
(* turn that into
285894-
ReactDOMRe.createElement(~props=ReactDOMRe.props(~props1=foo, ~props2=bar, ()), [|bla|]) *)
285891+
ReactDOM.createElement(~props=ReactDOM.props(~props1=foo, ~props2=bar, ()), [|bla|]) *)
285895285892
| {loc; txt = Lident id} ->
285896285893
transformLowercaseCall3 ~config mapper jsxExprLoc loc attrs callArguments
285897285894
id
@@ -285953,7 +285950,7 @@ let expr ~config mapper expression =
285953285950
| "automatic" ->
285954285951
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsxFragment")}
285955285952
| "classic" | _ ->
285956-
Exp.ident ~loc {loc; txt = Ldot (Lident "ReasonReact", "fragment")}
285953+
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "fragment")}
285957285954
in
285958285955
let childrenExpr = transformChildrenIfList ~mapper listItems in
285959285956
let args =
@@ -285984,15 +285981,14 @@ let expr ~config mapper expression =
285984285981
Exp.apply
285985285982
~loc (* throw away the [@JSX] attribute and keep the others, if any *)
285986285983
~attrs:nonJSXAttributes
285987-
(* ReactDOMRe.createElement *)
285984+
(* ReactDOM.createElement *)
285988285985
(match config.mode with
285989285986
| "automatic" ->
285990285987
if countOfChildren childrenExpr > 1 then
285991285988
Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsxs")}
285992285989
else Exp.ident ~loc {loc; txt = Ldot (Lident "React", "jsx")}
285993285990
| "classic" | _ ->
285994-
Exp.ident ~loc
285995-
{loc; txt = Ldot (Lident "ReactDOMRe", "createElement")})
285991+
Exp.ident ~loc {loc; txt = Ldot (Lident "ReactDOM", "createElement")})
285996285992
args)
285997285993
(* Delegate to the default mapper, a deep identity traversal *)
285998285994
| e -> default_mapper.expr mapper e

0 commit comments

Comments
 (0)