Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3c7dc9d

Browse files
committedSep 24, 2022
add test changes
1 parent 6cae1ba commit 3c7dc9d

14 files changed

+88
-24
lines changed
 

‎tests/ppx/react/expected/commentAtTop.res.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
type props<'msg> = {msg: 'msg} // test React JSX file
1+
type props<'msg> = { // test React JSX file
2+
msg: 'msg,
3+
}
24

35
@react.component
46
let make = ({msg, _}: props<'msg>) => {

‎tests/ppx/react/expected/externalWithCustomName.res.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ let t = React.createElement(Foo.component, Foo.componentProps(~a=1, ~b={"1"}, ()
1313
@@jsxConfig({version: 4, mode: "classic"})
1414

1515
module Foo = {
16-
type props<'a, 'b> = {a: 'a, b: 'b}
16+
type props<'a, 'b> = {
17+
a: 'a,
18+
b: 'b,
19+
}
1720

1821
@module("Foo")
1922
external component: React.componentLike<props<int, string>, React.element> = "component"
@@ -24,7 +27,10 @@ let t = React.createElement(Foo.component, {a: 1, b: "1"})
2427
@@jsxConfig({version: 4, mode: "automatic"})
2528

2629
module Foo = {
27-
type props<'a, 'b> = {a: 'a, b: 'b}
30+
type props<'a, 'b> = {
31+
a: 'a,
32+
b: 'b,
33+
}
2834

2935
@module("Foo")
3036
external component: React.componentLike<props<int, string>, React.element> = "component"

‎tests/ppx/react/expected/externalWithRef.res.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ module V3 = {
1818
@@jsxConfig({version: 4, mode: "classic"})
1919

2020
module V4C = {
21-
type props<'x, 'ref> = {x: 'x, ref?: 'ref}
21+
type props<'x, 'ref> = {
22+
x: 'x,
23+
ref?: 'ref,
24+
}
2225

2326
@module("componentForwardRef")
2427
external make: React.componentLike<props<string, ReactDOM.Ref.currentDomRef>, React.element> =
@@ -28,7 +31,10 @@ module V4C = {
2831
@@jsxConfig({version: 4, mode: "automatic"})
2932

3033
module V4C = {
31-
type props<'x, 'ref> = {x: 'x, ref?: 'ref}
34+
type props<'x, 'ref> = {
35+
x: 'x,
36+
ref?: 'ref,
37+
}
3238

3339
@module("componentForwardRef")
3440
external make: React.componentLike<props<string, ReactDOM.Ref.currentDomRef>, React.element> =

‎tests/ppx/react/expected/externalWithTypeVariables.res.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ module V3 = {
1616
@@jsxConfig({version: 4, mode: "classic"})
1717

1818
module V4C = {
19-
type props<'x, 'children> = {x: 'x, children: 'children}
19+
type props<'x, 'children> = {
20+
x: 'x,
21+
children: 'children,
22+
}
2023

2124
@module("c")
2225
external make: React.componentLike<props<t<'a>, React.element>, React.element> = "component"
@@ -25,7 +28,10 @@ module V4C = {
2528
@@jsxConfig({version: 4, mode: "automatic"})
2629

2730
module V4C = {
28-
type props<'x, 'children> = {x: 'x, children: 'children}
31+
type props<'x, 'children> = {
32+
x: 'x,
33+
children: 'children,
34+
}
2935

3036
@module("c")
3137
external make: React.componentLike<props<t<'a>, React.element>, React.element> = "component"

‎tests/ppx/react/expected/fileLevelConfig.res.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ module V3 = {
1717
@@jsxConfig({version: 4, mode: "classic"})
1818

1919
module V4C = {
20-
type props<'msg> = {msg: 'msg}
20+
type props<'msg> = {
21+
msg: 'msg,
22+
}
2123

2224
@react.component
2325
let make = ({msg, _}: props<'msg>) => {
@@ -33,7 +35,9 @@ module V4C = {
3335
@@jsxConfig({version: 4, mode: "automatic"})
3436

3537
module V4A = {
36-
type props<'msg> = {msg: 'msg}
38+
type props<'msg> = {
39+
msg: 'msg,
40+
}
3741

3842
@react.component
3943
let make = ({msg, _}: props<'msg>) => {

‎tests/ppx/react/expected/interface.res.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module A = {
2-
type props<'x> = {x: 'x}
2+
type props<'x> = {
3+
x: 'x,
4+
}
35
@react.component let make = ({x, _}: props<'x>) => React.string(x)
46
let make = {
57
let \"Interface$A" = (props: props<_>) => make(props)

‎tests/ppx/react/expected/interface.resi.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module A: {
2-
type props<'x> = {x: 'x}
2+
type props<'x> = {
3+
x: 'x,
4+
}
35
let make: React.componentLike<props<string>, React.element>
46
}
57

‎tests/ppx/react/expected/interfaceWithRef.res.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
type props<'x, 'ref> = {x: 'x, ref?: 'ref}
1+
type props<'x, 'ref> = {
2+
x: 'x,
3+
ref?: 'ref,
4+
}
25
@react.component
36
let make = (
47
{x, _}: props<string, ReactDOM.Ref.currentDomRef>,
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
type props<'x, 'ref> = {x: 'x, ref?: 'ref}
1+
type props<'x, 'ref> = {
2+
x: 'x,
3+
ref?: 'ref,
4+
}
25
let make: React.componentLike<props<string, ReactDOM.Ref.currentDomRef>, React.element>

‎tests/ppx/react/expected/newtype.res.txt

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ module V3 = {
2424
@@jsxConfig({version: 4, mode: "classic"})
2525

2626
module V4C = {
27-
type props<'a, 'b, 'c> = {a: 'a, b: 'b, c: 'c}
27+
type props<'a, 'b, 'c> = {
28+
a: 'a,
29+
b: 'b,
30+
c: 'c,
31+
}
2832

2933
@react.component
3034
let make = ({a, b, c, _}: props<'\"type-a", array<option<[#Foo('\"type-a")]>>, 'a>) =>
@@ -39,7 +43,11 @@ module V4C = {
3943
@@jsxConfig({version: 4, mode: "automatic"})
4044

4145
module V4A = {
42-
type props<'a, 'b, 'c> = {a: 'a, b: 'b, c: 'c}
46+
type props<'a, 'b, 'c> = {
47+
a: 'a,
48+
b: 'b,
49+
c: 'c,
50+
}
4351

4452
@react.component
4553
let make = ({a, b, c, _}: props<'\"type-a", array<option<[#Foo('\"type-a")]>>, 'a>) =>

‎tests/ppx/react/expected/removedKeyProp.res.txt

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
@@jsxConfig({version: 4, mode: "classic"})
22

33
module Foo = {
4-
type props<'x, 'y> = {x: 'x, y: 'y}
4+
type props<'x, 'y> = {
5+
x: 'x,
6+
y: 'y,
7+
}
58

69
@react.component let make = ({x, y, _}: props<'x, 'y>) => React.string(x ++ y)
710
let make = {
@@ -12,7 +15,9 @@ module Foo = {
1215
}
1316

1417
module HasChildren = {
15-
type props<'children> = {children: 'children}
18+
type props<'children> = {
19+
children: 'children,
20+
}
1621

1722
@react.component
1823
let make = ({children, _}: props<'children>) => ReactDOM.createElement(React.fragment, [children])

‎tests/ppx/react/expected/topLevel.res.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ module V3 = {
1919
@@jsxConfig({version: 4, mode: "classic"})
2020

2121
module V4C = {
22-
type props<'a, 'b> = {a: 'a, b: 'b}
22+
type props<'a, 'b> = {
23+
a: 'a,
24+
b: 'b,
25+
}
2326

2427
@react.component
2528
let make = ({a, b, _}: props<'a, 'b>) => {
@@ -36,7 +39,10 @@ module V4C = {
3639
@@jsxConfig({version: 4, mode: "automatic"})
3740

3841
module V4A = {
39-
type props<'a, 'b> = {a: 'a, b: 'b}
42+
type props<'a, 'b> = {
43+
a: 'a,
44+
b: 'b,
45+
}
4046

4147
@react.component
4248
let make = ({a, b, _}: props<'a, 'b>) => {

‎tests/ppx/react/expected/typeConstraint.res.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ module V3 = {
1717
@@jsxConfig({version: 4, mode: "classic"})
1818

1919
module V4C = {
20-
type props<'a, 'b> = {a: 'a, b: 'b}
20+
type props<'a, 'b> = {
21+
a: 'a,
22+
b: 'b,
23+
}
2124

2225
@react.component
2326
let make = ({a, b, _}: props<'\"type-a", '\"type-a">) =>
@@ -32,7 +35,10 @@ module V4C = {
3235
@@jsxConfig({version: 4, mode: "automatic"})
3336

3437
module V4A = {
35-
type props<'a, 'b> = {a: 'a, b: 'b}
38+
type props<'a, 'b> = {
39+
a: 'a,
40+
b: 'b,
41+
}
3642

3743
@react.component let make = ({a, b, _}: props<'\"type-a", '\"type-a">) => ReactDOM.jsx("div", {})
3844
let make = {

‎tests/ppx/react/expected/v4.res.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
type props<'x, 'y> = {x: 'x, y: 'y} // Component with type constraint
1+
type props<'x, 'y> = { // Component with type constraint
2+
x: 'x,
3+
y: 'y,
4+
}
25
@react.component let make = ({x, y, _}: props<string, string>) => React.string(x ++ y)
36
let make = {
47
let \"V4" = (props: props<_>) => make(props)
58
\"V4"
69
}
710

811
module AnotherName = {
9-
type props<'x> = {x: 'x}
12+
type // Component with another name than "make"
13+
props<'x> = {
14+
x: 'x,
15+
}
1016

11-
// Component with another name than "make"
1217
@react.component let anotherName = ({x, _}: props<'x>) => React.string(x)
1318
let anotherName = {
1419
let \"V4$AnotherName$anotherName" = (props: props<_>) => anotherName(props)

0 commit comments

Comments
 (0)
This repository has been archived.