-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Updates to type reference directive resolution and module resolution when failed #51715
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is technically a breaking change, we should discuss whether we think we can get it in 5.0 or wait until 5.1.
@typescript-bot run dt |
Heya @andrewbranch, I've started to run the parallelized Definitely Typed test suite on this PR at 7d23697. You can monitor the build here. |
Heya @andrewbranch, I've started to run the diff-based top-repos suite on this PR at 7d23697. You can monitor the build here. |
@sheetalkamat I'm going through all the ready-to-merge PRs, and this one was intended either for 5.0 or 5.1, so I vote to merge it now that 5.1 development has started. |
This is a requirement relevant mainly for testing on DT; DT uses `typeRoots` to redirect packages like react to `@types/react`. But versions previous to 5.1 had a triple-slash resolution bug when typeRoots was set [that was only fixed in 5.1](microsoft/TypeScript#51715). An alternative fix is to move react/experimental.d.ts to react/experimental/index.d.ts (and the same for react-dom), but I doubt this bug affects anybody but people who need to change next-pwa on DT, so I think it's easier to change next-pwa instead.
This is a requirement relevant mainly for testing on DT; DT uses `typeRoots` to redirect packages like react to `@types/react`. But versions previous to 5.1 had a triple-slash resolution bug when typeRoots was set [that was only fixed in 5.1](microsoft/TypeScript#51715). An alternative fix is to move react/experimental.d.ts to react/experimental/index.d.ts (and the same for react-dom), but I doubt this bug affects anybody but people who need to change next-pwa on DT, so I think it's easier to change next-pwa instead.
Hi there, Just to notify something on this release. A behavior has changed for me on my monorepo orchestration. {
"extends": "@myapp/config/tsconfig/base.json",
"compilerOptions": {
"noEmit": false,
"outDir": "dist/",
"types": ["node"],
},
"include": ["./src/index.ts"],
"exclude": ["node_modules", "dist"]
}
Where my app includes in "compilerOptions" : "typeRoots": ["../../node_modules/@types"] After this release, I have to specify this typeRoots URL on each package. Is it on purpose? Thanks 🙏 |
Yes, it's mentioned in the Announcing TypeScript 5.1 blog post. Edit: Or do you mean that it's not picking it up from |
Yes indeed, sorry maybe it was not clear. Indeed this is not retrieving the value from |
@loick can you log a fresh issue please? Thanks! |
This is a requirement relevant mainly for testing on DT; DT uses `typeRoots` to redirect packages like react to `@types/react`. But versions previous to 5.1 had a triple-slash resolution bug when typeRoots was set [that was only fixed in 5.1](microsoft/TypeScript#51715). An alternative fix is to move react/experimental.d.ts to react/experimental/index.d.ts (and the same for react-dom), but I doubt this bug affects anybody but people who need to change next-pwa on DT, so I think it's easier to change next-pwa instead.
typeRoots
resolve the typeReference as file or directory instead of just directory resolution as before.1c2318d This is fix for issue
Bug 2
reported in typeRoots and types not working #37708typeRoots
stop looking intonode_modules/@types
containing file's ancestor directories to resolve type reference as secondary lookup.40bb75c This is fix for issue
Bug 1
reported in typeRoots and types not working #37708typeRoots
if user has supplied. This helps solve the issues with module augmentation etc if when types are included through typeRoots.a6fed14 This is fix for Type merging for imported types only works if the type is imported from "node_modules/@types/" dir #39691 and Folders from typesRoot should be used in looking up for types for imports as well as
@types
folder #37958Fixes #37708, #39691, #37958, #44270