Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): prefer localName over originalName by running an empty check on originalName #5943

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/compiler/types/generate-app-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const generateComponentTypesFile = (
return `{ ${typeData
.sort(sortImportNames)
.map((td) => {
if (td.originalName === td.importName) {
if (td.originalName === '') {
return `${td.localName}`;
} else if (td.originalName === td.importName) {
return `${td.originalName}`;
} else {
return `${td.originalName} as ${td.importName}`;
Expand Down
7 changes: 7 additions & 0 deletions src/compiler/types/tests/generate-app-types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,11 @@ declare module "@stencil/core" {
location: 'import',
path: '@utils',
},
Fragment: {
location: 'import',
path: '@stencil/core',
id: '',
},
},
},
}),
Expand All @@ -1767,7 +1772,9 @@ declare module "@stencil/core" {
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { MyType as UserImplementedPropType } from "@utils";
import { Fragment } from "@stencil/core";
export { MyType as UserImplementedPropType } from "@utils";
export { Fragment } from "@stencil/core";
export namespace Components {
/**
* docs
Expand Down