Skip to content

Commit d519570

Browse files
committed
sync latest syntax: createElementWithKey
1 parent c34e9b0 commit d519570

File tree

4 files changed

+28
-40
lines changed

4 files changed

+28
-40
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273182,23 +273182,18 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
273182273182
]
273183273183
@ key)
273184273184
| _ -> (
273185-
let keyAddedProps ~keyExpr =
273186-
let propsType =
273187-
Typ.constr (Location.mknoloc @@ ident ~suffix:"props") [Typ.any ()]
273188-
in
273189-
Exp.apply
273190-
(Exp.ident
273191-
{loc = Location.none; txt = Ldot (Lident "Jsx", "addKeyProp")})
273192-
[(nolabel, Exp.constraint_ props propsType); (nolabel, keyExpr)]
273193-
in
273194273185
match (!childrenArg, keyProp) with
273195273186
| None, (_, keyExpr) :: _ ->
273196273187
Exp.apply ~attrs
273197273188
(Exp.ident
273198-
{loc = Location.none; txt = Ldot (Lident "React", "createElement")})
273189+
{
273190+
loc = Location.none;
273191+
txt = Ldot (Lident "React", "createElementWithKey");
273192+
})
273199273193
[
273200273194
(nolabel, Exp.ident {txt = ident ~suffix:"make"; loc = callExprLoc});
273201-
(nolabel, keyAddedProps ~keyExpr);
273195+
(nolabel, props);
273196+
(nolabel, keyExpr);
273202273197
]
273203273198
| None, [] ->
273204273199
Exp.apply ~attrs
@@ -273213,12 +273208,13 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
273213273208
(Exp.ident
273214273209
{
273215273210
loc = Location.none;
273216-
txt = Ldot (Lident "React", "createElementVariadic");
273211+
txt = Ldot (Lident "React", "createElementVariadicWithKey");
273217273212
})
273218273213
[
273219273214
(nolabel, Exp.ident {txt = ident ~suffix:"make"; loc = callExprLoc});
273220-
(nolabel, keyAddedProps ~keyExpr);
273215+
(nolabel, props);
273221273216
(nolabel, children);
273217+
(nolabel, keyExpr);
273222273218
]
273223273219
| Some children, [] ->
273224273220
Exp.apply ~attrs

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274645,23 +274645,18 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
274645274645
]
274646274646
@ key)
274647274647
| _ -> (
274648-
let keyAddedProps ~keyExpr =
274649-
let propsType =
274650-
Typ.constr (Location.mknoloc @@ ident ~suffix:"props") [Typ.any ()]
274651-
in
274652-
Exp.apply
274653-
(Exp.ident
274654-
{loc = Location.none; txt = Ldot (Lident "Jsx", "addKeyProp")})
274655-
[(nolabel, Exp.constraint_ props propsType); (nolabel, keyExpr)]
274656-
in
274657274648
match (!childrenArg, keyProp) with
274658274649
| None, (_, keyExpr) :: _ ->
274659274650
Exp.apply ~attrs
274660274651
(Exp.ident
274661-
{loc = Location.none; txt = Ldot (Lident "React", "createElement")})
274652+
{
274653+
loc = Location.none;
274654+
txt = Ldot (Lident "React", "createElementWithKey");
274655+
})
274662274656
[
274663274657
(nolabel, Exp.ident {txt = ident ~suffix:"make"; loc = callExprLoc});
274664-
(nolabel, keyAddedProps ~keyExpr);
274658+
(nolabel, props);
274659+
(nolabel, keyExpr);
274665274660
]
274666274661
| None, [] ->
274667274662
Exp.apply ~attrs
@@ -274676,12 +274671,13 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
274676274671
(Exp.ident
274677274672
{
274678274673
loc = Location.none;
274679-
txt = Ldot (Lident "React", "createElementVariadic");
274674+
txt = Ldot (Lident "React", "createElementVariadicWithKey");
274680274675
})
274681274676
[
274682274677
(nolabel, Exp.ident {txt = ident ~suffix:"make"; loc = callExprLoc});
274683-
(nolabel, keyAddedProps ~keyExpr);
274678+
(nolabel, props);
274684274679
(nolabel, children);
274680+
(nolabel, keyExpr);
274685274681
]
274686274682
| Some children, [] ->
274687274683
Exp.apply ~attrs

lib/4.06.1/whole_compiler.ml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -285024,23 +285024,18 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
285024285024
]
285025285025
@ key)
285026285026
| _ -> (
285027-
let keyAddedProps ~keyExpr =
285028-
let propsType =
285029-
Typ.constr (Location.mknoloc @@ ident ~suffix:"props") [Typ.any ()]
285030-
in
285031-
Exp.apply
285032-
(Exp.ident
285033-
{loc = Location.none; txt = Ldot (Lident "Jsx", "addKeyProp")})
285034-
[(nolabel, Exp.constraint_ props propsType); (nolabel, keyExpr)]
285035-
in
285036285027
match (!childrenArg, keyProp) with
285037285028
| None, (_, keyExpr) :: _ ->
285038285029
Exp.apply ~attrs
285039285030
(Exp.ident
285040-
{loc = Location.none; txt = Ldot (Lident "React", "createElement")})
285031+
{
285032+
loc = Location.none;
285033+
txt = Ldot (Lident "React", "createElementWithKey");
285034+
})
285041285035
[
285042285036
(nolabel, Exp.ident {txt = ident ~suffix:"make"; loc = callExprLoc});
285043-
(nolabel, keyAddedProps ~keyExpr);
285037+
(nolabel, props);
285038+
(nolabel, keyExpr);
285044285039
]
285045285040
| None, [] ->
285046285041
Exp.apply ~attrs
@@ -285055,12 +285050,13 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
285055285050
(Exp.ident
285056285051
{
285057285052
loc = Location.none;
285058-
txt = Ldot (Lident "React", "createElementVariadic");
285053+
txt = Ldot (Lident "React", "createElementVariadicWithKey");
285059285054
})
285060285055
[
285061285056
(nolabel, Exp.ident {txt = ident ~suffix:"make"; loc = callExprLoc});
285062-
(nolabel, keyAddedProps ~keyExpr);
285057+
(nolabel, props);
285063285058
(nolabel, children);
285059+
(nolabel, keyExpr);
285064285060
]
285065285061
| Some children, [] ->
285066285062
Exp.apply ~attrs

0 commit comments

Comments
 (0)