From 3b7410f542670d17b30924abe283fd7935eb2dfd Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 30 Oct 2024 16:49:08 +0100 Subject: [PATCH] (Js.)Dict.t -> dict --- runtime/Dict.res | 2 +- runtime/Dict.resi | 6 +++--- runtime/JSON.res | 10 +++++----- runtime/JSON.resi | 10 +++++----- runtime/Js_json.resi | 4 ++-- .../super_errors/expected/dict_coercion.res.expected | 2 +- .../typescript-react-example/package-lock.json | 2 +- .../typescript-react-example/src/Core.res | 4 ++-- .../typescript-react-example/src/Dict.res | 2 +- .../typescript-react-example/src/nested/Types.res | 2 +- .../data/idempotency/bs-css/CssEmotion.res | 2 +- .../data/idempotency/bs-css/CssEmotionJs.res | 2 +- .../syntax_tests/data/idempotency/bs-css/Css_Core.res | 2 +- .../idempotency/bs-webapi/src/Webapi/Webapi__Url.res | 2 +- .../data/idempotency/covid-19charts.com/src/Data.res | 2 +- .../covid-19charts.com/src/SerializeQueryParam.res | 4 ++-- .../data/idempotency/nook-exchange/Item.res | 6 +++--- .../data/idempotency/nook-exchange/User.res | 2 +- .../data/idempotency/nook-exchange/Utils.res | 6 +++--- .../data/idempotency/reasonml.org/bindings/Next.res | 2 +- .../reasonml.org/layouts/BeltDocsLayout.res | 2 +- .../reasonml.org/layouts/CommunityLayout.res | 2 +- .../reasonml.org/layouts/GenTypeDocsLayout.res | 2 +- .../idempotency/reasonml.org/layouts/JsDocsLayout.res | 2 +- .../reasonml.org/layouts/ManualDocsLayout.res | 2 +- .../reasonml.org/layouts/ReasonCompilerDocsLayout.res | 2 +- .../reasonml.org/layouts/ReasonReactDocsLayout.res | 2 +- .../idempotency/wildcards-world-ui/UserProvider.res | 4 ++-- .../data/parsing/grammar/typexpr/es6Arrow.res | 2 +- .../parsing/grammar/typexpr/expected/es6Arrow.res.txt | 2 +- tests/syntax_tests/data/printer/typexpr/arrow.res | 2 +- .../data/printer/typexpr/expected/arrow.res.txt | 2 +- tests/tests/src/UntaggedVariants.res | 10 +++++----- tests/tests/src/bs_qualified.res | 2 +- tests/tests/src/js_json_test.res | 2 +- tests/tests/src/reactDOMRe.res | 2 +- 36 files changed, 58 insertions(+), 58 deletions(-) diff --git a/runtime/Dict.res b/runtime/Dict.res index c56ecdc783..2c238f4f93 100644 --- a/runtime/Dict.res +++ b/runtime/Dict.res @@ -1,4 +1,4 @@ -type t<'a> = Js.Dict.t<'a> +type t<'a> = dict<'a> @get_index external getUnsafe: (t<'a>, string) => 'a = "" @get_index external get: (t<'a>, string) => option<'a> = "" diff --git a/runtime/Dict.resi b/runtime/Dict.resi index 2850a12d20..921be2817b 100644 --- a/runtime/Dict.resi +++ b/runtime/Dict.resi @@ -6,7 +6,7 @@ Compiles to a regular JavaScript object.*/ /** Type representing a dictionary of value `'a`. */ -type t<'a> = Js.Dict.t<'a> +type t<'a> = dict<'a> /** `getUnsafe(dict, key)` Returns the `value` at the provided `key`. @@ -71,7 +71,7 @@ let delete: (t<'a>, string) => unit ## Examples ```rescript -let dict1: Dict.t = Dict.make() // You can annotate the type of the values of your dict yourself if you want +let dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want let dict2 = Dict.make() // Or you can let ReScript infer it via usage. dict2->Dict.set("someKey", 12) @@ -99,7 +99,7 @@ external fromArray: array<(string, 'a)> => t<'a> = "Object.fromEntries" // Pretend we have an iterator of the correct shape @val external someIterator: Iterator.t<(string, int)> = "someIterator" -let dict = Dict.fromIterator(someIterator) // Dict.t +let dict = Dict.fromIterator(someIterator) // dict ``` */ @val diff --git a/runtime/JSON.res b/runtime/JSON.res index b9ee231e8c..f31d94be14 100644 --- a/runtime/JSON.res +++ b/runtime/JSON.res @@ -4,7 +4,7 @@ type rec t = Js.Json.t = | @as(null) Null | String(string) | Number(float) - | Object(Dict.t) + | Object(dict) | Array(array) @unboxed @@ -47,7 +47,7 @@ module Classify = { | Null | String(string) | Number(float) - | Object(Dict.t) + | Object(dict) | Array(array) @val external _internalClass: 'a => string = "Object.prototype.toString.call" @@ -55,7 +55,7 @@ module Classify = { external _asString: 'a => string = "%identity" external _asFloat: 'a => float = "%identity" external _asArray: 'a => array = "%identity" - external _asDict: 'a => Dict.t = "%identity" + external _asDict: 'a => dict = "%identity" let classify = value => { switch _internalClass(value) { @@ -75,7 +75,7 @@ module Encode = { external string: string => t = "%identity" external int: int => t = "%identity" external float: float => t = "%identity" - external object: Dict.t => t = "%identity" + external object: dict => t = "%identity" external array: array => t = "%identity" } @@ -86,7 +86,7 @@ module Decode = { let float = (json: t) => Type.typeof(json) === #number ? Some((Obj.magic(json): float)) : None let object = (json: t) => if Type.typeof(json) === #object && !Array.isArray(json) && !(Obj.magic(json) === Null.null) { - Some((Obj.magic(json): Dict.t)) + Some((Obj.magic(json): dict)) } else { None } diff --git a/runtime/JSON.resi b/runtime/JSON.resi index eeccc56bad..02f8b8793f 100644 --- a/runtime/JSON.resi +++ b/runtime/JSON.resi @@ -11,7 +11,7 @@ type rec t = Js.Json.t = | @as(null) Null | String(string) | Number(float) - | Object(Dict.t) + | Object(dict) | Array(array) @unboxed @@ -578,7 +578,7 @@ module Classify: { | Null | String(string) | Number(float) - | Object(Dict.t) + | Object(dict) | Array(array) /** @@ -660,7 +660,7 @@ module Encode: { JSON.Encode.object(dict) ``` */ - external object: Dict.t => t = "%identity" + external object: dict => t = "%identity" /** Returns an array as a JSON object. @@ -733,7 +733,7 @@ module Decode: { let float: t => option /** - Decodes a single JSON value. If the value is an object, it will return `Some(Dict.t)` - otherwise it will return `None`. + Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`. ## Examples ```rescript @@ -744,7 +744,7 @@ module Decode: { // None ``` */ - let object: t => option> + let object: t => option> /** Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`. diff --git a/runtime/Js_json.resi b/runtime/Js_json.resi index 0043b1cbdd..b5fb381a72 100644 --- a/runtime/Js_json.resi +++ b/runtime/Js_json.resi @@ -118,7 +118,7 @@ external number: float => t = "%identity" /** `boolean(b)` makes a JSON boolean of the `bool` `b`. */ external boolean: bool => t = "%identity" -/** `object_(dict)` makes a JSON object of the `Js.Dict.t` `dict`. */ +/** `object_(dict)` makes a JSON object of the `dict`. */ external object_: Js_dict.t => t = "%identity" /** `array_(a)` makes a JSON array of the `Js.Json.t` array `a`. */ @@ -178,7 +178,7 @@ let getIds = s => { switch Js.Json.classify(json) { | Js.Json.JSONObject(value) => - /* In this branch, compiler infer value : Js.Json.t Js.Dict.t */ + /* In this branch, compiler infer value : Js.Json.t dict */ switch Js.Dict.get(value, "ids") { | Some(ids) => switch Js.Json.classify(ids) { diff --git a/tests/build_tests/super_errors/expected/dict_coercion.res.expected b/tests/build_tests/super_errors/expected/dict_coercion.res.expected index 5e7889860a..2fac6a7a2a 100644 --- a/tests/build_tests/super_errors/expected/dict_coercion.res.expected +++ b/tests/build_tests/super_errors/expected/dict_coercion.res.expected @@ -7,4 +7,4 @@ 7 │ let d = (dict :> fakeDict) 8 │ - Type Js.Dict.t = dict is not a subtype of fakeDict \ No newline at end of file + Type dict = dict is not a subtype of fakeDict \ No newline at end of file diff --git a/tests/gentype_tests/typescript-react-example/package-lock.json b/tests/gentype_tests/typescript-react-example/package-lock.json index 3d1726bcb8..090c2be357 100644 --- a/tests/gentype_tests/typescript-react-example/package-lock.json +++ b/tests/gentype_tests/typescript-react-example/package-lock.json @@ -22,7 +22,7 @@ }, "../../..": { "name": "rescript", - "version": "12.0.0-alpha.4", + "version": "12.0.0-alpha.5", "dev": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", diff --git a/tests/gentype_tests/typescript-react-example/src/Core.res b/tests/gentype_tests/typescript-react-example/src/Core.res index 491d106c88..51a9ddcb90 100644 --- a/tests/gentype_tests/typescript-react-example/src/Core.res +++ b/tests/gentype_tests/typescript-react-example/src/Core.res @@ -17,10 +17,10 @@ let undefined0 = (x: Js.undefined) => x let undefined1 = (x: Undefined.t) => x @genType -let dict0 = (x: Js.Dict.t) => x +let dict0 = (x: dict) => x @genType -let dict1 = (x: Dict.t) => x +let dict1 = (x: dict) => x @genType let promise0 = (x: promise) => x diff --git a/tests/gentype_tests/typescript-react-example/src/Dict.res b/tests/gentype_tests/typescript-react-example/src/Dict.res index 444e46d661..1f55b2f8b4 100644 --- a/tests/gentype_tests/typescript-react-example/src/Dict.res +++ b/tests/gentype_tests/typescript-react-example/src/Dict.res @@ -1 +1 @@ -type t<'a> = Js.Dict.t<'a> +type t<'a> = dict<'a> diff --git a/tests/gentype_tests/typescript-react-example/src/nested/Types.res b/tests/gentype_tests/typescript-react-example/src/nested/Types.res index 54fa80803c..9e1658e248 100644 --- a/tests/gentype_tests/typescript-react-example/src/nested/Types.res +++ b/tests/gentype_tests/typescript-react-example/src/nested/Types.res @@ -60,7 +60,7 @@ type opaqueVariant = @gentype type genTypeMispelled = int -@genType type dictString = Js.Dict.t +@genType type dictString = dict @genType let jsonStringify = Js.Json.stringify diff --git a/tests/syntax_tests/data/idempotency/bs-css/CssEmotion.res b/tests/syntax_tests/data/idempotency/bs-css/CssEmotion.res index 97b2eed304..8370d2919e 100644 --- a/tests/syntax_tests/data/idempotency/bs-css/CssEmotion.res +++ b/tests/syntax_tests/data/idempotency/bs-css/CssEmotion.res @@ -14,7 +14,7 @@ include Css_Legacy_Core.Make({ external injectRaw: (. string) => unit = "injectGlobal" @module("emotion") - external makeKeyFrames: (. Js.Dict.t) => string = "keyframes" + external makeKeyFrames: (. dict) => string = "keyframes" }) type cache diff --git a/tests/syntax_tests/data/idempotency/bs-css/CssEmotionJs.res b/tests/syntax_tests/data/idempotency/bs-css/CssEmotionJs.res index 8e711f25f5..2a32d7095e 100644 --- a/tests/syntax_tests/data/idempotency/bs-css/CssEmotionJs.res +++ b/tests/syntax_tests/data/idempotency/bs-css/CssEmotionJs.res @@ -14,7 +14,7 @@ include Css_Js_Core.Make({ external injectRaw: (. string) => unit = "injectGlobal" @module("emotion") - external makeKeyFrames: (. Js.Dict.t) => string = "keyframes" + external makeKeyFrames: (. dict) => string = "keyframes" }) type cache diff --git a/tests/syntax_tests/data/idempotency/bs-css/Css_Core.res b/tests/syntax_tests/data/idempotency/bs-css/Css_Core.res index 11a23eceb6..6c9b577056 100644 --- a/tests/syntax_tests/data/idempotency/bs-css/Css_Core.res +++ b/tests/syntax_tests/data/idempotency/bs-css/Css_Core.res @@ -3,5 +3,5 @@ module type CssImplementationIntf = { let injectRule: (. Js.Json.t) => unit let injectRaw: (. string) => unit let make: (. Js.Json.t) => string - let makeKeyFrames: (. Js.Dict.t) => string + let makeKeyFrames: (. dict) => string } diff --git a/tests/syntax_tests/data/idempotency/bs-webapi/src/Webapi/Webapi__Url.res b/tests/syntax_tests/data/idempotency/bs-webapi/src/Webapi/Webapi__Url.res index 1af44c7a6c..9ce5ee9216 100644 --- a/tests/syntax_tests/data/idempotency/bs-webapi/src/Webapi/Webapi__Url.res +++ b/tests/syntax_tests/data/idempotency/bs-webapi/src/Webapi/Webapi__Url.res @@ -2,7 +2,7 @@ module URLSearchParams = { type t @new external make: string => t = "URLSearchParams" - @new external makeWithDict: Js.Dict.t => t = "URLSearchParams" + @new external makeWithDict: dict => t = "URLSearchParams" @new external makeWithArray: array<(string, string)> => t = "URLSearchParams" } diff --git a/tests/syntax_tests/data/idempotency/covid-19charts.com/src/Data.res b/tests/syntax_tests/data/idempotency/covid-19charts.com/src/Data.res index 4d0c1abac0..1711269c2a 100644 --- a/tests/syntax_tests/data/idempotency/covid-19charts.com/src/Data.res +++ b/tests/syntax_tests/data/idempotency/covid-19charts.com/src/Data.res @@ -10,7 +10,7 @@ module Map: { let set: (t<'key, 'value>, 'key, 'value) => unit let empty: unit => t<'key, 'value> } = { - type t<'key, 'value> = Js.Dict.t<'value> constraint 'key = string + type t<'key, 'value> = dict<'value> constraint 'key = string let keys = Js.Dict.keys let get = Js.Dict.unsafeGet let get_opt = Js.Dict.get diff --git a/tests/syntax_tests/data/idempotency/covid-19charts.com/src/SerializeQueryParam.res b/tests/syntax_tests/data/idempotency/covid-19charts.com/src/SerializeQueryParam.res index 368607047b..f12085be0a 100644 --- a/tests/syntax_tests/data/idempotency/covid-19charts.com/src/SerializeQueryParam.res +++ b/tests/syntax_tests/data/idempotency/covid-19charts.com/src/SerializeQueryParam.res @@ -24,8 +24,8 @@ type locationFragments = { } @module("serialize-query-params") -external updateInLocation: (Js.Dict.t>, Window.location) => locationFragments = +external updateInLocation: (dict>, Window.location) => locationFragments = "updateInLocation" @module("serialize-query-params") -external parse: string => Js.Dict.t = "parse" +external parse: string => dict = "parse" diff --git a/tests/syntax_tests/data/idempotency/nook-exchange/Item.res b/tests/syntax_tests/data/idempotency/nook-exchange/Item.res index dcf0826489..da96303879 100644 --- a/tests/syntax_tests/data/idempotency/nook-exchange/Item.res +++ b/tests/syntax_tests/data/idempotency/nook-exchange/Item.res @@ -243,7 +243,7 @@ let getCanonicalVariant = (~item, ~variant) => type variantNames = | NameOneDimension(array) | NameTwoDimensions((array, array)) -let variantNames: Js.Dict.t = variantsJson |> { +let variantNames: dict = variantsJson |> { open Json.Decode dict( oneOf(list{ @@ -261,8 +261,8 @@ type translationItem = { variants: option, } type translations = { - items: Js.Dict.t, - materials: Js.Dict.t, + items: dict, + materials: dict, } let translations: ref> = ref(None) let setTranslations = json => { diff --git a/tests/syntax_tests/data/idempotency/nook-exchange/User.res b/tests/syntax_tests/data/idempotency/nook-exchange/User.res index fa33238944..5ab6bfb2c2 100644 --- a/tests/syntax_tests/data/idempotency/nook-exchange/User.res +++ b/tests/syntax_tests/data/idempotency/nook-exchange/User.res @@ -72,7 +72,7 @@ type t = { id: string, username: string, email: option, - items: Js.Dict.t, + items: dict, profileText: string, enableCatalogCheckbox: bool, followeeIds: option>, diff --git a/tests/syntax_tests/data/idempotency/nook-exchange/Utils.res b/tests/syntax_tests/data/idempotency/nook-exchange/Utils.res index 9a001827b7..679cf60f21 100644 --- a/tests/syntax_tests/data/idempotency/nook-exchange/Utils.res +++ b/tests/syntax_tests/data/idempotency/nook-exchange/Utils.res @@ -1,8 +1,8 @@ @val @scope("Object") -external objectAssign: (Js.Dict.t<'a>, Js.Dict.t<'a>) => unit = "assign" +external objectAssign: (dict<'a>, dict<'a>) => unit = "assign" @val @scope("Object") @variadic -external objectAssignMany: array> => unit = "assign" +external objectAssignMany: array> => unit = "assign" let cloneJsDict = dict => { let clone = Js.Dict.empty() @@ -20,7 +20,7 @@ type any let _internalDeleteJsDictKey: (any, string) => unit = %raw( "function(dict, key) { delete dict[key]; }" ) -external convertToAny: Js.Dict.t<'a> => any = "%identity" +external convertToAny: dict<'a> => any = "%identity" let deleteJsDictKey = (dict, key) => _internalDeleteJsDictKey(convertToAny(dict), key) diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/bindings/Next.res b/tests/syntax_tests/data/idempotency/reasonml.org/bindings/Next.res index caf5f45eb5..113bdabfe9 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/bindings/Next.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/bindings/Next.res @@ -1,4 +1,4 @@ -type getInitialPropsFn<'a> = {"query": Js.Dict.t, "req": Js.Nullable.t<'a>} => Js.Promise.t< +type getInitialPropsFn<'a> = {"query": dict, "req": Js.Nullable.t<'a>} => Js.Promise.t< 'a, > diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/BeltDocsLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/BeltDocsLayout.res index 0b5180591e..ec9033e0a8 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/BeltDocsLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/BeltDocsLayout.res @@ -1,7 +1,7 @@ module Link = Next.Link // Structure defined by `scripts/extract-indices.js` -let indexData: Js.Dict.t<{ +let indexData: dict<{ "moduleName": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/CommunityLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/CommunityLayout.res index dbcc4fd5e9..cedc2c184e 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/CommunityLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/CommunityLayout.res @@ -1,7 +1,7 @@ module Link = Next.Link // Structure defined by `scripts/extract-tocs.js` -let tocData: Js.Dict.t<{ +let tocData: dict<{ "title": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/GenTypeDocsLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/GenTypeDocsLayout.res index 484144aeed..99f5258a67 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/GenTypeDocsLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/GenTypeDocsLayout.res @@ -15,7 +15,7 @@ hljs.registerLanguage('json', jsonHighlightJs); module Link = Next.Link // Structure defined by `scripts/extract-tocs.js` -let tocData: Js.Dict.t<{ +let tocData: dict<{ "title": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/JsDocsLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/JsDocsLayout.res index 33225d11b2..67b07b0ff9 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/JsDocsLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/JsDocsLayout.res @@ -1,7 +1,7 @@ module Link = Next.Link // Structure defined by `scripts/extract-indices.js` -let indexData: Js.Dict.t<{ +let indexData: dict<{ "moduleName": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ManualDocsLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ManualDocsLayout.res index e321ad5256..f6a0897dcc 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ManualDocsLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ManualDocsLayout.res @@ -1,7 +1,7 @@ module Link = Next.Link // Structure defined by `scripts/extract-tocs.js` -let tocData: Js.Dict.t<{ +let tocData: dict<{ "title": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonCompilerDocsLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonCompilerDocsLayout.res index 833a22424e..5a709d8ef9 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonCompilerDocsLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonCompilerDocsLayout.res @@ -1,7 +1,7 @@ module Link = Next.Link // Structure defined by `scripts/extract-tocs.js` -let tocData: Js.Dict.t<{ +let tocData: dict<{ "title": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonReactDocsLayout.res b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonReactDocsLayout.res index 7b97e34ca7..a9c78c2b4b 100644 --- a/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonReactDocsLayout.res +++ b/tests/syntax_tests/data/idempotency/reasonml.org/layouts/ReasonReactDocsLayout.res @@ -1,7 +1,7 @@ module Link = Next.Link // Structure defined by `scripts/extract-tocs.js` -let tocData: Js.Dict.t<{ +let tocData: dict<{ "title": string, "headers": array<{ "name": string, diff --git a/tests/syntax_tests/data/idempotency/wildcards-world-ui/UserProvider.res b/tests/syntax_tests/data/idempotency/wildcards-world-ui/UserProvider.res index 57021e7491..8ec3d33081 100644 --- a/tests/syntax_tests/data/idempotency/wildcards-world-ui/UserProvider.res +++ b/tests/syntax_tests/data/idempotency/wildcards-world-ui/UserProvider.res @@ -6,7 +6,7 @@ open Globals type threeBoxImageData = { @as("@type") imageType: string, - contentUrl: Js.Dict.t, + contentUrl: dict, } type threeBoxImage = array type threeBoxTwitterVerification = { @@ -32,7 +32,7 @@ type threeBoxUserInfo = { type userVerification = {threeBox: threeBoxUserInfo} type userInfo = { - userInfo: Js.Dict.t, + userInfo: dict, update: (string, bool) => unit, } diff --git a/tests/syntax_tests/data/parsing/grammar/typexpr/es6Arrow.res b/tests/syntax_tests/data/parsing/grammar/typexpr/es6Arrow.res index 82cc49579e..fe9cf0b24a 100644 --- a/tests/syntax_tests/data/parsing/grammar/typexpr/es6Arrow.res +++ b/tests/syntax_tests/data/parsing/grammar/typexpr/es6Arrow.res @@ -40,7 +40,7 @@ type t = @attrBeforeLblA ((~a: int) => (@attrBeforeLblB ((~b: int) => (@attr fl type t = @attr ~a: int => unit type getInitialPropsFn<'a> = { - "query": Js.Dict.t, + "query": dict, "req": Js.Nullable.t>, } => Js.Promise.t> diff --git a/tests/syntax_tests/data/parsing/grammar/typexpr/expected/es6Arrow.res.txt b/tests/syntax_tests/data/parsing/grammar/typexpr/expected/es6Arrow.res.txt index 44c8a7b3ba..3fbf63b11a 100644 --- a/tests/syntax_tests/data/parsing/grammar/typexpr/expected/es6Arrow.res.txt +++ b/tests/syntax_tests/data/parsing/grammar/typexpr/expected/es6Arrow.res.txt @@ -72,6 +72,6 @@ type nonrec t = [ `Has_arity1 ]) function$)[@attrBeforeLblA ]) type nonrec t = ((a:((int)[@res.namedArgLoc ]) -> unit)[@attr ]) type nonrec 'a getInitialPropsFn = - (< query: string Js.Dict.t ;req: 'a Js.t Js.Nullable.t > -> + (< query: string dict ;req: 'a Js.t Js.Nullable.t > -> 'a Js.t Js.Promise.t, [ `Has_arity1 ]) function$ \ No newline at end of file diff --git a/tests/syntax_tests/data/printer/typexpr/arrow.res b/tests/syntax_tests/data/printer/typexpr/arrow.res index 78aaa06835..40993fbc5a 100644 --- a/tests/syntax_tests/data/printer/typexpr/arrow.res +++ b/tests/syntax_tests/data/printer/typexpr/arrow.res @@ -102,7 +102,7 @@ type arrows = (int, (float => unit) => unit, float) => unit let prepare_expansion: ((type_expr, type_expr)) => (type_expr, type_expr) = f type getInitialPropsFn<'a> = { - "query": Js.Dict.t, + "query": dict, "req": Js.Nullable.t>, } => Js.Promise.t> diff --git a/tests/syntax_tests/data/printer/typexpr/expected/arrow.res.txt b/tests/syntax_tests/data/printer/typexpr/expected/arrow.res.txt index d350436648..cd0180e929 100644 --- a/tests/syntax_tests/data/printer/typexpr/expected/arrow.res.txt +++ b/tests/syntax_tests/data/printer/typexpr/expected/arrow.res.txt @@ -222,7 +222,7 @@ type arrows = (int, (float => unit) => unit, float) => unit let prepare_expansion: ((type_expr, type_expr)) => (type_expr, type_expr) = f type getInitialPropsFn<'a> = { - "query": Js.Dict.t, + "query": dict, "req": Js.Nullable.t>, } => Js.Promise.t> diff --git a/tests/tests/src/UntaggedVariants.res b/tests/tests/src/UntaggedVariants.res index 2644c010d6..4e177b77a1 100644 --- a/tests/tests/src/UntaggedVariants.res +++ b/tests/tests/src/UntaggedVariants.res @@ -144,7 +144,7 @@ module Json = { | @as(null) Null | String(string) | Number(float) - | Object(Js.Dict.t) + | Object(dict) | Array(array) type tagged_t = @@ -153,7 +153,7 @@ module Json = { | JSONNull | JSONString(string) | JSONNumber(float) - | JSONObject(Js.Dict.t) + | JSONObject(dict) | JSONArray(array) let classify = (x: t) => @@ -319,7 +319,7 @@ module ComplexPattern = { | @as(null) Null | String(string) | Number(float) - | Object(Js.Dict.t) + | Object(dict) | Array(array) type tagged_t = @@ -328,7 +328,7 @@ module ComplexPattern = { | JSONNull | JSONString(string) | JSONNumber(float) - | JSONObject(Js.Dict.t) + | JSONObject(dict) | JSONArray(array) let someJson: t = %raw(`'[{"name": "Haan"}, {"name": "Mr"}, false]'`)->Obj.magic @@ -417,7 +417,7 @@ module AllInstanceofTypes = { } module Aliased = { - type dict = Js.Dict.t + type dict = dict type fn = unit => option @unboxed type t = Object(dict) | String(string) | Function(fn) diff --git a/tests/tests/src/bs_qualified.res b/tests/tests/src/bs_qualified.res index 425bf2fedc..279e418197 100644 --- a/tests/tests/src/bs_qualified.res +++ b/tests/tests/src/bs_qualified.res @@ -5,7 +5,7 @@ type param @scope("commands") @module("vscode") @variadic external executeCommands: (string, array) => unit = "executeCommands" -@scope("process") @val external env: Js.Dict.t = "env" +@scope("process") @val external env: dict = "env" let f = (a, b, c) => { executeCommands("hi", [a, b, c]) diff --git a/tests/tests/src/js_json_test.res b/tests/tests/src/js_json_test.res index a3478fbca7..7656d4568d 100644 --- a/tests/tests/src/js_json_test.res +++ b/tests/tests/src/js_json_test.res @@ -24,7 +24,7 @@ let () = { let ty = J.classify(v) switch ty { | J.JSONObject(x) => - /* compiler infer x : J.t Js.Dict.t */ + /* compiler infer x : J.t dict */ switch Js.Dict.get(x, "x") { | Some(v) => let ty2 = J.classify(v) diff --git a/tests/tests/src/reactDOMRe.res b/tests/tests/src/reactDOMRe.res index 1b3801d6dd..334f11c70c 100644 --- a/tests/tests/src/reactDOMRe.res +++ b/tests/tests/src/reactDOMRe.res @@ -2573,7 +2573,7 @@ module Style = { @val external combine: (@as(json`{}`) _, style, style) => t = "Object.assign" - external _dictToStyle: Js.Dict.t => style = "%identity" + external _dictToStyle: dict => style = "%identity" let unsafeAddProp = (style, key, value) => { let dict = Js.Dict.empty()