Skip to content

Commit 6f2880e

Browse files
committed
Rename to promise
1 parent 69e9b95 commit 6f2880e

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

compiler/syntax/src/jsx_common.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ let async_component ~async expr =
5353
if async then
5454
let open Ast_helper in
5555
Exp.apply
56-
(Exp.ident
57-
{loc = Location.none; txt = Ldot (Lident "Jsx", "asyncComponent")})
56+
(Exp.ident {loc = Location.none; txt = Ldot (Lident "Jsx", "promise")})
5857
[(Nolabel, expr)]
5958
else expr

runtime/Jsx.res

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ type element
3030
external float: float => element = "%identity"
3131
external int: int => element = "%identity"
3232
external string: string => element = "%identity"
33-
3433
external array: array<element> => element = "%identity"
34+
external promise: promise<element> => element = "%identity"
3535

3636
type componentLike<'props, 'return> = 'props => 'return
3737
type component<'props> = componentLike<'props, element>
3838

3939
/* this function exists to prepare for making `component` abstract */
4040
external component: componentLike<'props, element> => component<'props> = "%identity"
41-
42-
external asyncComponent: promise<element> => element = "%identity"

tests/syntax_tests/data/ppx/react/expected/asyncAwait.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module C0 = {
99
ReactDOM.jsx("div", {children: ?ReactDOM.someElement({React.int(a)})})
1010
}
1111
let make = {
12-
let \"AsyncAwait$C0" = (props: props<_>) => Jsx.asyncComponent(make(props))
12+
let \"AsyncAwait$C0" = (props: props<_>) => Jsx.promise(make(props))
1313

1414
\"AsyncAwait$C0"
1515
}
@@ -26,7 +26,7 @@ module C1 = {
2626
}
2727
}
2828
let make = {
29-
let \"AsyncAwait$C1" = (props: props<_>) => Jsx.asyncComponent(make(props))
29+
let \"AsyncAwait$C1" = (props: props<_>) => Jsx.promise(make(props))
3030

3131
\"AsyncAwait$C1"
3232
}

tests/syntax_tests/data/ppx/react/expected/sharedPropsWithProps.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module V4A5 = {
4545
ReactDOM.jsx("div", {children: ?ReactDOM.someElement({React.int(a)})})
4646
}
4747
let make = {
48-
let \"SharedPropsWithProps$V4A5" = (props: props<_>) => Jsx.asyncComponent(make(props))
48+
let \"SharedPropsWithProps$V4A5" = (props: props<_>) => Jsx.promise(make(props))
4949
\"SharedPropsWithProps$V4A5"
5050
}
5151
}
@@ -59,7 +59,7 @@ module V4A6 = {
5959
}
6060
}
6161
let make = {
62-
let \"SharedPropsWithProps$V4A6" = (props: props<_>) => Jsx.asyncComponent(make(props))
62+
let \"SharedPropsWithProps$V4A6" = (props: props<_>) => Jsx.promise(make(props))
6363
\"SharedPropsWithProps$V4A6"
6464
}
6565
}

0 commit comments

Comments
 (0)