Skip to content

solutions style tsconfig disappeared after update to angular 10.1 #18616

Description

@xiaoxiangmoe

🐞 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

Activity

  1. SchnWalter commented on Aug 26, 2020

    @SchnWalter
    Contributor

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

  2. alan-agius4 commented on Aug 26, 2020

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

  3. xiaoxiangmoe commented on Aug 26, 2020

    @xiaoxiangmoe
    Author

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

  4. alan-agius4 commented on Aug 26, 2020

    @alan-agius4
    Collaborator

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

  5. xiaoxiangmoe commented on Aug 27, 2020

    @xiaoxiangmoe
    Author

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

  6. alan-agius4 commented on Aug 27, 2020

    @alan-agius4
    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)

  7. xiaoxiangmoe commented on Aug 27, 2020

    @xiaoxiangmoe
    Author

    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?

  8. alan-agius4 commented on Aug 28, 2020

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

  9. angular-automatic-lock-bot commented on Sep 28, 2020

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions