-
-
Notifications
You must be signed in to change notification settings - Fork 433
[Performance]: .vue.d.ts are not used in TypeScript Project References #3526
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
Comments
Add |
It works but I don't think it is an acceptable solution. My understanding is that it defeats the purpose of separating tests from implementation. Your solution merge the test files with the implementation thus implementation can now depends on test files. Am I right or I am missing something? Also, why I don't have to do it with |
Ugh! Thanks for your clarification. This is likely a bug in volar. |
@so1ve, I tried the official vue scaffolding Why I don't have to do it with |
To prove that there is a performance hit, I did something silly but funny with only `tsc' If you checkout the So I think |
Also, if you use the cli option --dry, the .vue.d.ts files are not removed enforcing the idea that these files are generated but not used by referencing projects. |
Update when trying version 2.0.11 with typescript version 5.1.6. Error messages in the console has dissapeared but |
Update when trying version 2.0.11 with typescript version 5.4.4, there is now a error message in the console.
|
Did you find any way around this @vidal7? I'm getting the same error as you ("Output file has not been built from source file"). |
Not yet. I am still including vue files in the @DavidR95, what version of volar, vue-tsc and Vue are you using? |
@vidal7 Version 3.3.2 of Vue, and 2.0.21 of vue-tsc. All pure TS files work fine (i.e., don't generate the error mentioned above), seems to just be Vue files. If I hack around with the The workaround of As such, I've abandoned project references for now :/ |
@DavidR95 , thanks you for giving me the idea of hacking around the aliases to the Project references are very useful to us because it guides the developers of our team by forbiding certains imports in certain typescript project. In other words, this implements what projects can import and cannot import. Unfortunately, it comes at a great performance cost. Like you said, if it was just ts files, all will be fine but with vue files and vue-tsc, there is a performance cost of compiling many times the same vue file. |
Finally, hacking my way around aliases was more challenging that I tought because we use aliased imports and also relative imports. To make it works, I have to change all my relative imports with aliased imports and it will be too much of a burden to do. So this issue is still revelant to the following reasons :
|
I'm also getting the
|
So @gtbuchanan, you are confirming me that it doesn't works in the latest versions of vue, vue-tsc and typescript. |
With big monorepos vue files, is it frustating that there is a major performance hit. The situation for now is simply that monorepos with vue files can't scale. In my opinion, this is a very big drawback of adopting Vue in monorepos. How guys do you cope with that? In my opinion, this issue should be prioritized. @johnsoncodehk, is that something planned? It seems that it was planned in the 2.0 backlogs but later dropped. Since that, it seems that there is nothing. |
I've started adding |
Sorry it took so long, the problem should now be resolved by volarjs/volar.js#222. |
No problem @johnsoncodehk, I know you are working super hard. Thank you. Can't wait to test the new version. |
For your info, volarjs/volar.js#222 landed in vuejs/[email protected]. |
I just confirmed the new version of |
I can confirm that Big vue monorepos can now scale! Thank you. Compile time 67% reduction time! Thank you so much. |
When removing extraneous included vue files in |
@vidal7 For reproducibility's sake, I believe I see the same error in my example project, where I have
Meanwhile, before upgrading the extension from version 2.0.26 to 2.0.28, it reported: EDIT: It seems (with Vue extension v2.0.28) the error message actually seems to alternate a bit between the two messages from the screenshots. In my real-life project (not the playground I linked above) I sometimes see one, sometimes the other, depending on whether the import is relative or absolute (using a path alias set in |
Thank you @codethief, I believe that if a error is not reported with For now, my temporarily fix is to create two typescript configs : one for |
I fully agree!
I don't think I'm the right person to decide this but to me it sounds like the "fix" for the original issue was not an actual fix but just ended up replacing one error message with another. So I'd vote for re-opening the ticket. |
@johnsoncodehk Would you mind re-opening this ticket? |
I just ran into another interesting case in my real-life project where it's the other way around (somewhat):
EDIT: Please ignore this comment, I just realized my project was still on vue-tsc 2.0.7. Now that I've upgraded to vue-tsc 2.0.29, the CLI works as expected (just like in my example project). VSCode still complains about the imports, though. |
I have decided to create a new ticket, partially to raise awareness but also because I've come to think the issue we started discussing here might be different from the original issue #3526 (even though it's certainly related) since it only shows up in the IDE, not on the command line (see my edited previous comment). So let's continue this discussion in the new ticket. |
Thank you @codethief for creating the new issue. For now, the thing I did for working around the issue was creating two different typescript settings. One for But I am agree that we should not have different typescript settings. Maybe when your issue will be fixed, without extraneous included vue, we can gain some performance in |
Hello.
What I want to do
I want to better organize my codebase. So I began to introduce TypeScript Project References to help cope with performance problems in vscode and also separating tests from implementation thus it was not possible for the implementation files to import the test files. I was inspired by the official TypeScript Project References documentation on https://www.typescriptlang.org/docs/handbook/project-references.html#an-example-project.
What is my problem
However, I keep getting this TypeScript error in vscode and vue-tsc
What I expect to get
No errors in vscode, npm script build:vue is working the same way as build:ts
To reproduce
Details before reproducing
Is this a bug? Am I missing something?
Thank you.
The text was updated successfully, but these errors were encountered: