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

Sort the paths for module specifier by closeness to importing file path #33567

Merged
merged 10 commits into from
Sep 25, 2019

Conversation

sheetalkamat
Copy link
Member

Fixes #32970

This uses #33566 to baseline tsc --d
Also added way to show redirects when listing files..

Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

I wonder if it would make sense to do this in getNewImportInfos (importFixes.ts) too? It currently sorts by string length, which feels kind of arbitrary.

@orta orta added the Update Docs on Next Release Indicates that this PR affects docs label Sep 23, 2019
@sheetalkamat
Copy link
Member Author

@andrewbranch Not sure if its needed or not, since that kind of also iterates over result from different symbols..

@sheetalkamat sheetalkamat force-pushed the baselining branch 2 times, most recently from 9cce6d0 to 382ff17 Compare September 25, 2019 15:09
@sheetalkamat sheetalkamat changed the base branch from baselining to master September 25, 2019 15:20
@@ -57,5 +57,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./keys"));


//// [keys.d.ts]
import { MetadataAccessor } from "@raymondfeng/pkg2";
export declare const ADMIN: MetadataAccessor<boolean, import("../../pkg1/dist").IdType>;
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure if this is better or not..
cc: @weswigham @DanielRosenwasser @RyanCavanaugh

Copy link
Member

Choose a reason for hiding this comment

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

It's probably not... I mean, technically it's correct, but when your code is seen in a structure like this (monorepo-y), you're not supposed to access sibling packages with a relative path, since the packages won't be siblings when shipped... The error was good in this case, since it called out that your types depended on a package you didn't directly depend on, which meant you needed to fix it in some way. Like this, it's.... Eck.

Copy link
Member Author

Choose a reason for hiding this comment

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

Turns out we resolve that only because of how these tests run (all the sources are included irrespective of tsconfig file) when I add test using the tsc baseline I retain the error so should be ok? appending that test as a separate commit for reference 91c66a0

Copy link
Member Author

Choose a reason for hiding this comment

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

Ping So this PR is good to go?

Copy link
Member

Choose a reason for hiding this comment

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

I guess, yeah.

@sheetalkamat sheetalkamat merged commit 3dd7b84 into master Sep 25, 2019
@sheetalkamat sheetalkamat deleted the resolution branch September 25, 2019 23:29
/lib/lib.d.ts
/src/plugin-one/node_modules/typescript-fsa/index.d.ts
/src/plugin-one/action.ts
/src/plugin-one/node_modules/plugin-two/node_modules/typescript-fsa/index.d.ts -> /src/plugin-one/node_modules/typescript-fsa/index.d.ts
Copy link
Member

Choose a reason for hiding this comment

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

So, I didn't notice it before, but isn't listFiles consumed by some VS MSBuild API, and isn't this chance to include mappings with -> probably going to break it?

Copy link
Member

Choose a reason for hiding this comment

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

cc ... @uniqueiniquity ?

@ericmdantas
Copy link

Apparently the bug still occurs. See #32970.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Docs on Next Release Indicates that this PR affects docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type resolution in linked packages
5 participants