diff --git a/src/Config_.ml b/src/Config_.ml index 69fa6e815..e9710494c 100644 --- a/src/Config_.ml +++ b/src/Config_.ml @@ -13,7 +13,6 @@ type bsVersion = int * int * int type config = { bsCurryPath : string option; bsDependencies : string list; - mutable emitFlowAny : bool; mutable emitImportCurry : bool; mutable emitImportPropTypes : bool; mutable emitImportReact : bool; @@ -36,7 +35,6 @@ let default = { bsCurryPath = None; bsDependencies = []; - emitFlowAny = false; emitImportCurry = false; emitImportPropTypes = false; emitImportReact = false; @@ -238,7 +236,6 @@ let readConfig ~bsVersion ~getBsConfigFile ~namespace = bsCurryPath; bsDependencies; suffix; - emitFlowAny = false; emitImportCurry = false; emitImportPropTypes = false; emitImportReact = false; diff --git a/src/EmitJs.ml b/src/EmitJs.ml index 29dcd3c0d..f3b140c22 100644 --- a/src/EmitJs.ml +++ b/src/EmitJs.ml @@ -225,7 +225,6 @@ let rec emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName type t = { propsType : type_; resolvedTypeName : ResolvedName.t; - retType : type_; typeVars : string list; } end in @@ -281,7 +280,7 @@ let rec emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName else ResolvedName.fromString name |> ResolvedName.dot "Props" in ( Function {function_ with componentName = Some hookName}, - Some {HookType.propsType; resolvedTypeName; retType; typeVars} ) + Some {HookType.propsType; resolvedTypeName; typeVars} ) | _ -> (type_, None) in diff --git a/src/EmitType.ml b/src/EmitType.ml index 49c9ba901..4121bd617 100644 --- a/src/EmitType.ml +++ b/src/EmitType.ml @@ -373,41 +373,6 @@ let require ~early = let emitImportReact ~emitters = "import * as React from 'react';" |> require ~early:true ~emitters -let emitPropTypes ~config ~emitters ~indent ~name fields = - let indent1 = indent |> Indent.more in - let prefix s = "PropTypes." ^ s in - let rec emitType ~indent (type_ : type_) = - match type_ with - | Array (t, _) -> prefix "arrayOf" ^ "(" ^ (t |> emitType ~indent) ^ ")" - | Ident {name = ("bool" | "number" | "string") as id} -> id |> prefix - | Function _ -> "func" |> prefix - | GroupOfLabeledArgs fields | Object (_, fields) | Record fields -> - let indent1 = indent |> Indent.more in - prefix "shape" ^ "({" - ^ Indent.break ~indent:indent1 - ^ (fields - |> List.filter (fun ({nameJS} : field) -> nameJS <> "children") - |> List.map (emitField ~indent:indent1) - |> String.concat ("," ^ Indent.break ~indent:indent1)) - ^ Indent.break ~indent ^ "})" - | Ident _ | Null _ | Nullable _ | Option _ | Promise _ | Tuple _ | TypeVar _ - | Variant _ -> - "any" |> prefix - and emitField ~indent ({nameJS; optional; type_} : field) = - nameJS ^ " : " - ^ (type_ |> emitType ~indent) - ^ match optional = Mandatory with true -> ".isRequired" | false -> "" - in - config.emitImportPropTypes <- true; - name ^ ".propTypes = " ^ "{" - ^ Indent.break ~indent:indent1 - ^ (fields - |> List.filter (fun ({nameJS} : field) -> nameJS <> "children") - |> List.map (emitField ~indent:indent1) - |> String.concat ("," ^ Indent.break ~indent:indent1)) - ^ Indent.break ~indent ^ "};" - |> Emitters.export ~emitters - let emitImportTypeAs ~emitters ~config ~typeName ~asTypeName ~typeNameIsInterface ~importPath = let typeName = sanitizeTypeName typeName in diff --git a/src/EmitType.mli b/src/EmitType.mli index 917e0d3e6..eed9d81a5 100644 --- a/src/EmitType.mli +++ b/src/EmitType.mli @@ -55,14 +55,6 @@ val emitImportValueAsEarly : ImportPath.t -> Emitters.t -val emitPropTypes : - config:config -> - emitters:Emitters.t -> - indent:Indent.t -> - name:string -> - field list -> - Emitters.t - val emitRequire : importedValueOrComponent:bool -> early:bool -> diff --git a/src/ImportPath.ml b/src/ImportPath.ml index e982a5035..6757ffaad 100644 --- a/src/ImportPath.ml +++ b/src/ImportPath.ml @@ -4,8 +4,6 @@ type t = string * string let propTypes = ("", "prop-types") -let react = ("", "react") - let bsCurryPath ~config = ("", Config_.getBsCurryPath ~config) let fromModule ~dir ~importExtension moduleName = diff --git a/src/ImportPath.mli b/src/ImportPath.mli index e4460500d..147bd12e2 100644 --- a/src/ImportPath.mli +++ b/src/ImportPath.mli @@ -14,6 +14,4 @@ val fromStringUnsafe : string -> t val propTypes : t -val react : t - val toCmt : config:config -> outputFileRelative:string -> t -> string diff --git a/src/ModuleName.ml b/src/ModuleName.ml index 209583d5d..da1122249 100644 --- a/src/ModuleName.ml +++ b/src/ModuleName.ml @@ -4,8 +4,6 @@ let curry = "Curry" let propTypes = "PropTypes" -let react = "React" - let reasonPervasives = "ReasonPervasives" let dotRegex = "." |> Str.quote |> Str.regexp diff --git a/src/ModuleName.mli b/src/ModuleName.mli index 20f533788..cd7c01193 100644 --- a/src/ModuleName.mli +++ b/src/ModuleName.mli @@ -13,8 +13,6 @@ val fromStringUnsafe : string -> t val propTypes : t -val react : t - val reasonPervasives : t val toString : t -> string