Skip to content

Commit 7552d6e

Browse files
committed
Update changelog
1 parent e556137 commit 7552d6e

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#### :rocket: New Feature
2020

2121
- Support renaming fields in inline records with `@as` attribute. [#6391](https://github.com/rescript-lang/rescript-compiler/pull/6391)
22+
- Support renaming fields of object created by `@obj` ppx with `@as` attribute. [#6391](https://github.com/rescript-lang/rescript-compiler/pull/6412)
2223
- Add builtin abstract types for File and Blob APIs. https://github.com/rescript-lang/rescript-compiler/pull/6383
2324
- Untagged variants: Support `promise`, RegExes, Dates, File and Blob. https://github.com/rescript-lang/rescript-compiler/pull/6383
2425
- Support aliased types as payloads to untagged variants. https://github.com/rescript-lang/rescript-compiler/pull/6394

jscomp/syntax/tests/ppx/react/expected/mangleKeyword.res.txt

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
@@jsxConfig({version: 3})
22

3-
module C30 = {
4-
@obj external makeProps: (~_open: 'T_open, ~key: string=?, unit) => {"_open": 'T_open} = ""
3+
module C3A0 = {
4+
@obj
5+
external makeProps: (
6+
~_open: 'T_open,
7+
~_type: string,
8+
~key: string=?,
9+
unit,
10+
) => {"_open": 'T_open, "_type": string} = ""
511

6-
@react.component let make = @warning("-16") (~_open) => React.string(_open)
12+
@react.component
13+
let make =
14+
@warning("-16")
15+
(@as("open") ~_open) => @warning("-16") (@as("type") ~_type: string) => React.string(_open)
716
let make = {
8-
let \"MangleKeyword$C30" = (\"Props": {"_open": 'T_open}) => make(~_open=\"Props"["_open"])
9-
\"MangleKeyword$C30"
17+
let \"MangleKeyword$C3A0" = (\"Props": {"_open": 'T_open, "_type": string}) =>
18+
make(~_type=\"Props"["_type"], ~_open=\"Props"["_open"])
19+
\"MangleKeyword$C3A0"
1020
}
1121
}
12-
module C31 = {
13-
@obj external makeProps: (~_open: string, ~key: string=?, unit) => {"_open": string} = ""
14-
external make: React.componentLike<{"_open": string}, React.element> = "default"
22+
module C3A1 = {
23+
@obj
24+
external makeProps: (
25+
~_open: string,
26+
~_type: string,
27+
~key: string=?,
28+
unit,
29+
) => {"_open": string, "_type": string} = ""
30+
external make: @as("open")
31+
React.componentLike<{"_open": string, "_type": string}, React.element> = "default"
1532
}
1633

17-
let c30 = React.createElement(C30.make, C30.makeProps(~_open="x", ()))
18-
let c31 = React.createElement(C31.make, C31.makeProps(~_open="x", ()))
34+
let c3a0 = React.createElement(C3A0.make, C3A0.makeProps(~_open="x", ~_type="t", ()))
35+
let c3a1 = React.createElement(C3A1.make, C3A1.makeProps(~_open="x", ~_type="t", ()))
1936

2037
@@jsxConfig({version: 4, mode: "classic"})
2138

jscomp/syntax/tests/ppx/react/mangleKeyword.res

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
@@jsxConfig({version: 3})
22

3-
module C30 = {
3+
module C3A0 = {
44
@react.component
5-
let make = (~_open) => React.string(_open)
5+
let make =
6+
(@as("open") ~_open, @as("type") ~_type: string) => React.string(_open)
67
}
7-
module C31 = {
8+
module C3A1 = {
89
@react.component
9-
external make: (~_open: string) => React.element = "default"
10+
external make: (@as("open") ~_open: string, @as("type") ~_type: string) => React.element =
11+
"default"
1012
}
1113

12-
let c30 = <C30 _open="x" />
13-
let c31 = <C31 _open="x" />
14+
let c3a0 = <C3A0 _open="x" _type="t" />
15+
let c3a1 = <C3A1 _open="x" _type="t" />
1416

1517
@@jsxConfig({version: 4, mode: "classic"})
1618

0 commit comments

Comments
 (0)