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

Solution style tsconfig impact in Angular 10 #39632

Closed
alan-agius4 opened this issue Jul 17, 2020 · 6 comments
Closed

Solution style tsconfig impact in Angular 10 #39632

alan-agius4 opened this issue Jul 17, 2020 · 6 comments
Assignees
Labels
Discussion Issues which may not have code impact

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Jul 17, 2020

Use Cases

In TypeScript 3.9, the concept of solutions style tsconfig was introduced, in Angular we saw the potentiation and possibility of fixing long outstanding issues such as incorrectly having test typings in components files. In Angular CLI version 10 we adopted scaffolded new and migrated existing workspaces to use solution-style Typescript configuration.

After Angular version 10 stable was rolled out to the community, we received more feedback about this and previously unforeseen consequences of using this feature.

Suggestion

We have put together a document that goes a bit in more detail about these issues and also possible actions and solutions.

We'd like to share this document with you: https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing

If you have any questions, feel free to ping me here or in #ts-core slack channel.

Thank you.

//cc @kyliau


Edit: From the TS team, we'd like a confirmation and any recommandations they might have on the proposed changes that we'd like to introduce in our projects and if creating auxiliary programs to address the auto-import issue is something that will be considered.

@sheetalkamat
Copy link
Member

  1. Unreferenced files don’t inherit compiler options
  2. Unreferenced files cannot be automatically imported
    While we can fix this problem by adding more complex globbing in the spec and server TypeScript configuration files, we feel that it would best that this is tackled upstream.

For unreferenced files and its auto import not working i think the main issue is that there is no clear way to tell which project this new file should belong to.. Auxiliary program is not going to help because it helps with files from package json but here user is adding new file to their app/spec/test program.
The best way to solve this is to have three separate folders for spec, app and test so the files will be added to correct project irrespective of name. If thats not something that works for compatibility or other reasons, globbing to exclude and include everything else is much better than listing files to include so that new files will get included in correct program.

The proposed change is to move away from a single workspace level solution style tsconfig and add a project level solutions style tsconfig.

Definitely recommend this since its much cleaner and will not have to include world /load world to know where the file should belong and what to do with it.
Having said that if you think its loading multiple project where it shouldn't have, i recommend creating issue with logs and repro steps to investigate that.

@sheetalkamat sheetalkamat removed the Needs Investigation This issue needs a team member to investigate its status. label Jul 23, 2020
@RyanCavanaugh RyanCavanaugh added the Discussion Issues which may not have code impact label Jul 23, 2020
@RyanCavanaugh RyanCavanaugh removed this from the TypeScript 4.0.1 milestone Jul 23, 2020
@smlombardi
Copy link

I have this problem as well, with multiple tsconfig.json files extening a root-level tsconfig.base.json and editors like VScode no longer providing intellisense or error checking.

I followed this advice: angular/vscode-ng-language-service#876 (comment)

And for now I've gotten it back.

@ShimiShimson
Copy link

Updating Angular and all @angular packages worked for me. Auto-suggestion for imports works now.

@alan-agius4
Copy link
Contributor Author

In Angular CLI 10.1 we added a migration that opts-out of solutions tsconfig following a meeting with @DanielRosenwasser.

@DavidMarquezF
Copy link

Are there any plans to solve this issue? It's a bit confusing that this does not work. If I set up paths in my tsconfig.app.json it works on compilation time but the IDE doesn't help me at all. If I add them to the root tsconfig.json, it works in the IDE but not when compiling. Basically I need to maintain the paths in the root tsconfig.json and tsconfig.app.json in the projects

@Trevortni
Copy link

Trevortni commented Jul 22, 2022

Are there any plans to solve this issue? It's a bit confusing that this does not work. If I set up paths in my tsconfig.app.json it works on compilation time but the IDE doesn't help me at all. If I add them to the root tsconfig.json, it works in the IDE but not when compiling. Basically I need to maintain the paths in the root tsconfig.json and tsconfig.app.json in the projects

Thanks for that, that led me to a much simpler (temporary) solution: I made a tsconfig.json consisting solely of { "extends": "./tsconfig.base.json" }.

It seems to initially be working, though I don't know enough about these things to know if there will be any adverse side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issues which may not have code impact
Projects
None yet
Development

No branches or pull requests

7 participants