-
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
.d.ts source map allowing go to def to jump to source directly #14479
Comments
See also #12358 (comment) |
My guess is that if you don't use .d.ts then the typings won't necessarily follow your .js source, which means IDE support will not be there when your codebase integrates with other codebases. that's my guess as a TS user, but I am not certain. |
We have discussed an option of a .d.ts source map that allows editors and other tools to go to the implementation if one is available. |
@svenefftinge this covers my reasons : #12358 (comment)
|
@mhegazy This idea of navigate to source is very interesting / appealing. Is this being tracked anywhere? |
I am assuming this issue is tracking that. |
Haha, Alright. :) I was just curious with respect to your note
|
Clarifying the title for better tracking. |
Any status on this? I guess this would be implemented as two separate tasks:
|
@mhegazy Any updates on this? - Single most wanted feature for me. |
This could solve a problem I'm currently facing. In our project we are using a stricter compilation options for Typescript, but some of the npm modules we use publish the Typescript source code, yet they are not as strict as we are. Which results in a compilation errors when we build our project. Having a d.ts sourcemap will also provide a solution for people with big repository that they wish to continuously migrate to stricter Typescript - They could create sourcemap to old Typescript and compile only the d.ts, which skips strict checks, while having a base with stricter checks that they can continuously enlarge. |
I think this would solve some pain points listed in #9448 |
I know it has been asked and discussed before, but I couldn't find an explanation why you recommend to export only the type definitions when publishing an npm package.
As a consumer of an npm package it is quite annoying to end up in d.ts files when browsing code. Especially because I have to switch to the generate, down-leveled JS code to read the actual implementation. It is not only much less readable but also no longer well supported by my editor (no types).
I understand that the tsconfig is important and that one doesn't want to recompile typescript code from npm packages, but the tools should really show the original source instead of the generated code.
I am working on a monorepo project with a bunch of local npm packages with references. We use synthetic links (learna) and in
package.json
we point tosrc/index.ts
instead of the usuallib/index.d.ts
. As a result I can nicely navigate between the local packages and never end up in generated files. With vscode that is, not so much with webstorm...So at least in our context it seem to be an improvement.
Could you explain what problems this could cause and why you generally seem to recommend not to it like this?
The text was updated successfully, but these errors were encountered: