Angular-cli: solutions style tsconfig disappeared after update to angular 10.1

Created on 26 Aug 2020  Β·  9Comments  Β·  Source: angular/angular-cli

🐞 Bug report

Command (mark with an x)


  • [x] new
  • [ ] build
  • [ ] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [x] 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

can be closed? faq

All 9 comments

That's because it has been intentionally removed, see https://github.com/angular/angular-cli/pull/18478

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.

@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.

@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?

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

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: https://github.com/microsoft/TypeScript/issues/39632#issuecomment-663220708

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?

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.

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._

Was this page helpful?
0 / 5 - 0 ratings