diff --git a/pages/docs/gentype/latest/supported-types.mdx b/pages/docs/gentype/latest/supported-types.mdx index b1bcf95cc..f2121baaa 100644 --- a/pages/docs/gentype/latest/supported-types.mdx +++ b/pages/docs/gentype/latest/supported-types.mdx @@ -55,13 +55,6 @@ Since objects are immutable by default, their fields will be exported to readonl It is possible to mix object and option types, so for example the ReScript type `{. "x":int, "y":option(string)}` exports to JS type `{x:number, ?y: string}`, requires no conversion, and allows option pattern matching on the ReScript side. -Object field names follow ReScript's mangling convention (so e.g. `_type` in ReScript represents `type` in JS): - -``` -Remove trailing "__" if present. -Otherwise remove leading "_" when followed by an uppercase letter, or keyword. -``` - ## Tuples ReScript tuple values of type e.g. `(int, string)` are exported as identical JS values of type `[number, string]`. This requires no conversion, unless one of types of the tuple items does. @@ -123,20 +116,6 @@ Function components are exported and imported exactly like normal functions. For let make = (~name) => React.string(name); ``` -For renaming, named arguments follow ReScript's mangling convention: - -``` -Remove trailing "__" if present. -Otherwise remove leading "_" when followed by an uppercase letter, or keyword. -``` - -For example: - -```res -@genType -let exampleFunction = (~_type) => "type: " ++ _type -``` - ## Imported Types It's possible to import an existing TS/Flow type as an opaque type in ReScript. For example, diff --git a/pages/docs/gentype/latest/usage.mdx b/pages/docs/gentype/latest/usage.mdx index f8cc0b08f..fa61f9502 100644 --- a/pages/docs/gentype/latest/usage.mdx +++ b/pages/docs/gentype/latest/usage.mdx @@ -110,12 +110,14 @@ type persons = array; ## Renaming, @genType.as, and object mangling convention. -By default, entities with a given name are exported/imported with the same name. However, you might wish to change the appearence of the name on the JS side. - **NOTE:** Starting from ReScript 7.0.0, `@genType.as` on record fields will be discouraged, -as it incurs a runtime conversion cost. Instead `@bs.as` will be supported and incur zero cost. +as it incurs a runtime conversion cost. Use a runtime free `@as` instead. + +**NOTE:** Starting from ReScript 11.0.0, the object mangling is removed. + +By default, entities with a given name are exported/imported with the same name. However, you might wish to change the appearence of the name on the JS side. -For example, in case of a record field whose name is a keyword, such as `type`: +For example, to use a reserved keyword `type` as a record field: ```res @genType