@@ -133,7 +133,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
133
133
match codeItem with
134
134
| ImportValue {asPath; importAnnotation; type_; valueName} ->
135
135
let importPath = importAnnotation.importPath in
136
- let importFile = importAnnotation.name in
137
136
let firstNameInPath, restOfPath =
138
137
match valueName = asPath with
139
138
| true -> (valueName, " " )
@@ -159,11 +158,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
159
158
as function_)
160
159
when retType |> EmitType. isTypeFunctionComponent ~fields ->
161
160
(* JSX V3 *)
162
- let componentName =
163
- match importFile with
164
- | "." | ".." -> None
165
- | _ -> Some importFile
166
- in
167
161
let fields =
168
162
fields
169
163
|> List. map (fun (field : field ) ->
@@ -180,7 +174,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
180
174
argTypes = [{aType = Object (closedFlag, fields); aName}];
181
175
}
182
176
in
183
- Function { function_ with componentName}
177
+ Function function_
184
178
| Function
185
179
({argTypes = [{aType = Ident {name} as propsType; aName}]; retType} as
186
180
function_)
@@ -189,11 +183,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
189
183
match inlineOneLevel propsType with
190
184
| Object (closedFlags , fields ) ->
191
185
(* JSX V3 *)
192
- let componentName =
193
- match importFile with
194
- | "." | ".." -> None
195
- | _ -> Some importFile
196
- in
197
186
let fields =
198
187
Ext_list. filter_map fields (fun (field : field ) ->
199
188
match field.nameJS with
@@ -210,7 +199,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
210
199
argTypes = [{aType = Object (closedFlags, fields); aName}];
211
200
}
212
201
in
213
- Function { function_ with componentName}
202
+ Function function_
214
203
| _ -> type_)
215
204
| _ -> type_
216
205
in
@@ -276,26 +265,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
276
265
typeVars : string list ;
277
266
}
278
267
end in
279
- let getHookName () =
280
- let chopSuffix suffix =
281
- match resolvedNameStr = suffix with
282
- | true -> " "
283
- | false -> (
284
- match Filename. check_suffix resolvedNameStr (" _" ^ suffix) with
285
- | true -> Filename. chop_suffix resolvedNameStr (" _" ^ suffix)
286
- | false -> resolvedNameStr)
287
- in
288
- let suffix =
289
- if originalName = default then chopSuffix default
290
- else if originalName = make then chopSuffix make
291
- else resolvedNameStr
292
- in
293
- (fileName |> ModuleName. toString)
294
- ^
295
- match suffix = " " with
296
- | true -> suffix
297
- | false -> " _" ^ suffix
298
- in
299
268
let type_, hookType =
300
269
match type_ with
301
270
| Function
@@ -331,7 +300,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
331
300
ResolvedName. fromString " Props" )
332
301
else ResolvedName. fromString name |> ResolvedName. dot " Props"
333
302
in
334
- ( Function { function_ with componentName = Some (getHookName () )} ,
303
+ ( Function function_,
335
304
Some {HookType. propsType; resolvedTypeName; typeVars} )
336
305
| Function
337
306
({argTypes = [{aType = Ident {name} as propsType}]; retType} as
@@ -359,7 +328,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
359
328
let function_ =
360
329
{function_ with argTypes = [{aName = " " ; aType = propsType}]}
361
330
in
362
- Function { function_ with componentName = Some (getHookName () )}
331
+ Function function_
363
332
| _ -> type_
364
333
in
365
334
(compType, None )
0 commit comments