From 5990f814f6b335917a10dbce7611d134f95cc0ab Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Tue, 1 Jun 2021 16:34:23 +0200 Subject: [PATCH] dce --- src/Config_.ml | 3 --- src/EmitJs.ml | 3 +-- src/ImportPath.ml | 2 -- src/ImportPath.mli | 2 -- src/ModuleName.ml | 4 +--- src/ModuleName.mli | 4 +--- 6 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Config_.ml b/src/Config_.ml index 2ba05c8f1..bf5988ed7 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; @@ -33,7 +32,6 @@ let default = { bsCurryPath = None; bsDependencies = []; - emitFlowAny = false; emitImportCurry = false; emitImportPropTypes = false; emitImportReact = false; @@ -220,7 +218,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 74ba5dc79..191b205b5 100644 --- a/src/EmitJs.ml +++ b/src/EmitJs.ml @@ -241,7 +241,6 @@ let rec emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName type t = { propsType : type_; resolvedTypeName : ResolvedName.t; - retType : type_; typeVars : string list; } end in @@ -297,7 +296,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/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 1b2e8a8a3..da1122249 100644 --- a/src/ModuleName.ml +++ b/src/ModuleName.ml @@ -4,9 +4,7 @@ let curry = "Curry" let propTypes = "PropTypes" -let react = "React" - -let rescriptPervasives = "RescriptPervasives" +let reasonPervasives = "ReasonPervasives" let dotRegex = "." |> Str.quote |> Str.regexp diff --git a/src/ModuleName.mli b/src/ModuleName.mli index b922a7875..cd7c01193 100644 --- a/src/ModuleName.mli +++ b/src/ModuleName.mli @@ -13,9 +13,7 @@ val fromStringUnsafe : string -> t val propTypes : t -val react : t - -val rescriptPervasives : t +val reasonPervasives : t val toString : t -> string