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

feat(compiler-cli): support multiple configuration files in extends #49125

Closed
wants to merge 4 commits into from

Conversation

alan-agius4
Copy link
Contributor

TypeScript 5 support extends to be an array, this commit adds support to allow extending angularCompilerOptions from multiple config files.

See: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#supporting-multiple-configuration-files-in-extends

@alan-agius4 alan-agius4 added state: blocked target: major This PR is targeted for the next major release area: compiler Issues related to `ngc`, Angular's template compiler labels Feb 17, 2023
@alan-agius4 alan-agius4 added this to the v16-candidates milestone Feb 17, 2023
@alan-agius4
Copy link
Contributor Author

Blocked on #49107

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Feb 17, 2023
@alan-agius4 alan-agius4 force-pushed the tsconfig-extends-array branch 3 times, most recently from f95b4c1 to 7785571 Compare February 17, 2023 15:29
TypeScript 5 support `extends` to be an array, this commit adds support to allow extending `angularCompilerOptions` from multiple config files.

See: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#supporting-multiple-configuration-files-in-extends
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 1, 2023
@alan-agius4 alan-agius4 requested a review from JoostK March 1, 2023 10:19
@alan-agius4 alan-agius4 marked this pull request as ready for review March 1, 2023 10:19
@@ -194,4 +194,52 @@ describe('perform_compile', () => {
debug: false,
}));
});

it('should merge tsconfig "angularCompilerOptions" when extends is an array', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what the behavior here should be for nested options, extendedDiagnostics being the primary example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn’t change with this change. Complex objects such as paths and extendedDiagnostics ste not merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a test to that effect? I realise it's more about extends in general than having multiple extends per se, but wouldn't hurt to explicitly capture this behavior in a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not, but I can add it if you wish.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capturing that behavior would be valuable, IMO

packages/compiler-cli/src/perform_compile.ts Outdated Show resolved Hide resolved
packages/compiler-cli/src/perform_compile.ts Outdated Show resolved Hide resolved
packages/compiler-cli/src/perform_compile.ts Outdated Show resolved Hide resolved
@@ -194,4 +194,52 @@ describe('perform_compile', () => {
debug: false,
}));
});

it('should merge tsconfig "angularCompilerOptions" when extends is an array', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capturing that behavior would be valuable, IMO

This commit adds a test case for validate that we do not deep merge objects like like 'paths' and `extendedDiagnostics`.
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 6, 2023
@jessicajaniuk
Copy link
Contributor

This PR was merged into the repository by commit 1418d19.

jessicajaniuk pushed a commit that referenced this pull request Mar 6, 2023
This commit adds a test case for validate that we do not deep merge objects like like 'paths' and `extendedDiagnostics`.

PR Close #49125
@alan-agius4 alan-agius4 deleted the tsconfig-extends-array branch March 6, 2023 19:04
@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 Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler detected: feature PR contains a feature commit target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants