GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — For editing experience, use source instead of .d.ts files from project references by sheetalkamat · Pull Request #32028 · microsoft/TypeScript Conversation
|
|
I'm pretty excited about this. Editing experience is the only thing stopping me from using project references. Here are some edge cases that might need to be handled:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…o to source generated position
…ect path so that module symbol is correctly resolved
There was an error while loading. Please reload this page.
|
I have a question. Is this a thing for composite projects? If so, I think it's possible for your editor to say that you've reached the max instantiation depth, but when building, it'll build fine. Especially if the editor is looking at source files and compiler is looking at The editor would have to "go deeper" to resolve types, while the compiler would not. It would also break my current workaround for avoiding the max instantiation depth, If whatever I just said isn't relevant at all.. Just ignore me =x |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So this still requires generating |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sheetal Nandi (@sheetalkamat) I've opened an issue to report a failure in error underlining: This started happening after the switch to using source files as per this PR. I have captured some logs, although there is no 'Err' line as far as I can tell. But I the offending files are listed in the logs so that may help. Let me know where to mail them. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sheetal Nandi (@sheetalkamat) , we have been depending on this feature for a few months now and all is very nice and fast, thanks again. It seems like we have forgotten to update the wiki about Project References, it says that is work is still work in progress and that we need to check in .d.ts files. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
I'm not sure that's a good idea, because types from source are different than types from declarations, and they are not compatible in various ways. See here for a non-exhaustive list of issues: #35822 Something that could happen is, a new user is happy-go-lucky writing code, and it all works perfectly (because the editor says so). Then later they go and try to publish their code as a library (with declaration files) and it all breaks. It's a very bad experience (believe me from experience!). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Joe Pea (@trusktr) this is a perfectly good idea for the large number of companies writing in-house-only code. Ideally, we don't want to work with We have found this implementation a huge help. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Noel Abrahams (@NoelAbrahams) I can see how that can be helpful if all sources are consumed directly (yay, class-factory mixins work in this case). Using source files directly may lead to other issues, f.e.: #35744. The downside of this is that if any dependencies were compiled with different settings than the consumer project, then they may fail to be compiled in the consumer project. In your case, it may be fine, as I assume all your in-house projects all use the exact same tsconfig configuration. It's just something people should be aware of, and unless those issues have been fixed, then in the general case the change of this PR isn't necessarily a final solution. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Sheetal Nandi (@sheetalkamat) Wait a second, based on #40431 (comment) by Ryan Cavanaugh (@RyanCavanaugh), this PR compiles to If so, I think that can be the solution for #35744 if it isn't already. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As mentioned in PR description this PR includes source files from the referenced project instead of generated .d.ts file. We do not generate in memory d.ts files. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dimitri (@dko-slapdash) you posted the same question on three different issues/PRs (here, #39267 (comment), #34677 (comment)) within the course of an hour, before anyone had a chance to respond. That makes it incredibly difficult for us, and for future users who might have similar questions, to keep track of the conversation. I’m going to mark these off-topic, except for the one here, to avoid confusion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Do we still need |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi! I have a question about monorepo+project reference settings. The example I have the folder structure below: These two projects are configured to use project references. My question is: Do I need to add I worry about if TypeScript does not resolve Can Sheetal Nandi (@sheetalkamat) help? Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As long as you don’t have |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks, but I still have a question, what about the following case? In this case, even if TypeScript can resolve |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, I think that should work. The reference to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It's just hypothetical. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.