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

Bug repro: Exports which shadow built-ins are incorrectly included in non-"complete" report variants #4761

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ export declare class Lib2Class {
export declare interface Lib2Interface {
}

/**
* Shadows of built-ins get aliased during rollup, which has resulted in tags being ignored when determining correct
* output for report variants.
* @internal
*/
declare const performance_2: Performance;
export { performance_2 as performance }

export { }
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ export class Lib2Class {
export interface Lib2Interface {
}

// Warning: (ae-internal-missing-underscore) The name "performance" should be prefixed with an underscore because the declaration is marked as @internal
export { performance_2 as performance }

```
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ export class Lib2Class {
export interface Lib2Interface {
}

// @internal
const performance_2: Performance;
export { performance_2 as performance }

```
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ export class Lib2Class {
prop: number;
}

export { performance_2 as performance }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the declaration of performance_2 was omitted, but the de-aliased export is still included.


```
7 changes: 7 additions & 0 deletions build-tests/api-extractor-lib2-test/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ export interface Lib2Interface {}

/** @public */
export default class DefaultClass {}

/**
* Shadows of built-ins get aliased during rollup, which has resulted in tags being ignored when determining correct
* output for report variants.
* @internal
*/
export const performance: Performance = globalThis.performance;
Loading