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

When loading a module from node_modules, get packageId even in the loadModuleFromFile case #18185

Merged
2 commits merged into from
Sep 7, 2017

Conversation

ghost
Copy link

@ghost ghost commented Aug 31, 2017

Fixes #6496 (comment)

When loading a module like rxjs/Observer.d.ts, we need to remember to check package.json anyway so we can get the packageId.

Update: Now fixes #17716 (the deduplication side) too.

@ghost ghost requested review from aozgaa and amcasey August 31, 2017 18:45
@ghost ghost changed the title When loading a module from node_modules, get packageId even in the `l… When loading a module from node_modules, get packageId even in the loadModuleFromFile case Aug 31, 2017
@@ -1675,7 +1675,7 @@ namespace ts {
});

if (packageId) {
const packageIdKey = `${packageId.name}@${packageId.version}`;
const packageIdKey = `${packageId.name}/${packageId.subModuleName}@${packageId.version}`;
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm, we're fine with producing an ugly string when packageId.subModuleName is empty? It appears to only be used as a dictionary key, so I'm assuming we are.

@amcasey
Copy link
Member

amcasey commented Aug 31, 2017

@minestarks has more experience in this area and may be able to give better feedback.

@ghost ghost requested a review from minestarks September 1, 2017 15:35
@ghost ghost force-pushed the duplicatePackage_subModule branch from ecb7259 to 104a52b Compare September 5, 2017 17:31
@ghost ghost merged commit 2e02778 into master Sep 7, 2017
@ghost ghost deleted the duplicatePackage_subModule branch September 7, 2017 21:31
ghost pushed a commit that referenced this pull request Sep 7, 2017
…oadModuleFromFile` case (#18185)

* When loading a module from node_modules, get packageId even in the `loadModuleFromFile` case

* Support packageId for <reference types> too
mhegazy pushed a commit that referenced this pull request Sep 14, 2017
…oadModuleFromFile` case (#18185) (#18326)

* When loading a module from node_modules, get packageId even in the `loadModuleFromFile` case

* Support packageId for <reference types> too
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation hangs when using Bluebird promise library Duplicate type declarations with npm link
3 participants