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

solutions style tsconfig disappeared after update to angular 10.1 #18616

Closed
2 of 15 tasks
xiaoxiangmoe opened this issue Aug 26, 2020 · 9 comments
Closed
2 of 15 tasks

solutions style tsconfig disappeared after update to angular 10.1 #18616

xiaoxiangmoe opened this issue Aug 26, 2020 · 9 comments

Comments

@xiaoxiangmoe
Copy link

xiaoxiangmoe commented Aug 26, 2020

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

I'm using solutions style tsconfig to add types for scripts.

// tsconfig.json

{
  "files": [],
  "references": [
    {
      "path": "./projects/my-app/tsconfig.app.json"
    },
    {
      "path": "./projects/my-app/tsconfig.spec.json"
    },
    {
      "path": "./tsconfig.scripts.json"
    }
  ]
}

// tsconfig.scripts.json

{
  "compilerOptions": {
    "strict": true,
    "target": "ESNext",
    "module": "CommonJS",
    "esModuleInterop": true,
    "types": ["node"],
    "allowJs": true
  },
  "include": ["./extra-webpack.config.ts","./build-script.ts"]
}

Update to ng 10.1 remove my solutions style tsconfig. So "./tsconfig.scripts.json" will not work after update to 10.1.0-next.7

@SchnWalter
Copy link
Contributor

That's because it has been intentionally removed, see #18478

@alan-agius4
Copy link
Collaborator

Hi @xiaoxiangmoe,
Following numerous issues, we have discussed this internally and with the TypeScript team at Microsoft decided that for a better DX it's best to revert and remove solution style tsconfig.

We are not excluding that in the future we re-introduce solution tsconfig.

@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Aug 26, 2020

@alan-agius4 Can you add options to skip remove solutions tsconfig? We need keep solution style tsconfig. This is a breaking change for the solutions tsconfig users.

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Aug 26, 2020

@xiaoxiangmoe, can you please elaborate why this is a breaking change for you?

Is it because you have different compilerOptions from your root level tsconfig.json?

What do you mean by so "./tsconfig.scripts.json" will not work after update to 10.1.0-next.7?

@alan-agius4 alan-agius4 reopened this Aug 26, 2020
@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Aug 26, 2020
@xiaoxiangmoe
Copy link
Author

Yes.
The ts files in the root dir have different compilerOptions. Update to ng 10.1 will break "./tsconfig.scripts.json".

@alan-agius4
Copy link
Collaborator

We understand that there might be a subset of users IDE experience might be effected by reverting the solutions style tsconfig.

At this stage, the recommended approach if you want to use different compiler options would be to place these files in a separate directory, rename tsconfig.scripts.json to tsconfig.json and move it inside the new directory.

This is also something which the TypeScript team suggested to address some issues being experienced with solutions style tsconfig see: microsoft/TypeScript#39632 (comment)

@alan-agius4 alan-agius4 added flag: can be closed? type: faq and removed needs: more info Reporter must clarify the issue labels Aug 27, 2020
@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Aug 27, 2020

Can we keep solution style tsconfig manually?
Will it still be removed in the future?(For example,update from ng 10.1 to ng 11)

(Another infomation: we start use solution style tsconfig in angular 8, but it was removed in ng 10.1)
Can we only remove solution style tsconfig if it was updated from angular 10.0?

@alan-agius4
Copy link
Collaborator

Can we keep solution style tsconfig manually?

Will it still be removed in the future?
No, but using solutions style tsconfig at this point might result in broken journeys such as when new generate a new application, library etc, therefore I wouldn't recommend keeping solutions style tsconfig.

(Another infomation: we start use solution style tsconfig in angular 8, but it was removed in ng 10.1) Can we only remove solution style tsconfig if it was updated from angular 10.0?
Solutions tsconfig was introduced in version 10 and will be removed in version 10.1.

In future we might reconsider adding and supporting solutions style tsconfig but we need some changes on the TypeScript side. We, together with the TypeScript at Microsoft decided that for the best DX, it's best to rollback solutions style tsconfig and offer the same IDE experience that we did pre version 10.

In many cases, there are other approaches to solutions style tsconfig's. Such as create a sub-directory with a tsconfig.json inside it, which at this point in time would be my recommended approach.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants