Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Retain imports in declaration emit if they augment an export of the importing file#37820

Merged
weswigham merged 3 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
weswigham:retain-imports-if-they-add-augmentationsweswigham/TypeScript:retain-imports-if-they-add-augmentationsCopy head branch name to clipboard
Apr 13, 2020
Merged

Retain imports in declaration emit if they augment an export of the importing file#37820
weswigham merged 3 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
weswigham:retain-imports-if-they-add-augmentationsweswigham/TypeScript:retain-imports-if-they-add-augmentationsCopy head branch name to clipboard

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes #32298

Technically this won't fix all possible augmentation-including scenarios, namely this will only capture augmentations of direct dependencies; augmentations provided by transitive dependencies are a whole other bag of problems. But I'm wondering if we actually need to preemptively fix that or not; in such scenarios we'd probably need to generate and add reference directives, which could be much more undesirable than the simple preservation of an existing import.

@sandersn

sandersn commented Apr 7, 2020

Copy link
Copy Markdown
Member

It would be nice to know how many projects have augmentations coming directly from dependencies vs transitive dependencies. But I can't think of an easy way to estimate that.

@weswigham

Copy link
Copy Markdown
Member Author

When it comes to preserving something already in the declaration file vs injecting something from the aether, I'm also just much more comfortable preserving the existing thing.

@sandersn

sandersn commented Apr 8, 2020

Copy link
Copy Markdown
Member

Agree!

@sandersn sandersn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggested one possible speedup, but I'm not sure it's valid.

Comment thread src/compiler/checker.ts Outdated
Comment thread src/compiler/checker.ts Outdated
@weswigham weswigham merged commit 141ee01 into microsoft:master Apr 13, 2020
@weswigham weswigham deleted the retain-imports-if-they-add-augmentations branch April 13, 2020 19:31
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merged declarations are not written to the parent

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.