You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
When components import types specific to them, sometimes exposed in public APIs, if any of these types happen to have a duplicate name, the generated types will rename conflicting imports successfully, but will only refer to one type in all component APIs that use the duplicate-named type.
For example, the following two components have a local same-named type Name used in a public method (boilerplate component code omitted):
// my-person.tsx
import { Name } from './resources';
@Method()
saySomething(name: Name): void {
console.log(name);
}
// my-pupper.tsx
import { Name } from './resources';
@Method()
saySomething(name: Name): void {
console.log(name);
}
Which produces the following in components.d.ts
import { Name } from "./components/my-person/resources";
import { Name as Name1 } from "./components/my-pupper/resources";
export namespace Components {
interface MyPerson {
"saySomething": (name: Name) => Promise<void>;
}
interface MyPupper {
"saySomething": (name: Name) => Promise<void>;
}
}
Expected behavior:
Can the compiler use namespacing, inline the types or something else to avoid having to rename the types unnecessarily?
Stencil version:
I'm submitting a:
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
When components import types specific to them, sometimes exposed in public APIs, if any of these types happen to have a duplicate name, the generated types will rename conflicting imports successfully, but will only refer to one type in all component APIs that use the duplicate-named type.
For example, the following two components have a local same-named type
Name
used in a public method (boilerplate component code omitted):Which produces the following in components.d.ts
Expected behavior:
Can the compiler use namespacing, inline the types or something else to avoid having to rename the types unnecessarily?
Related code:
Repo for repro case: https://github.com/jcfranco/stencil-duplicate-types-not-assigned-correctly-in-component-typings
The text was updated successfully, but these errors were encountered: