Skip to content

fix(bazel/rules_angular): fix 'NgtscCompilerHost' type incompatibility#3529

Merged
alan-agius4 merged 2 commits intoangular:mainfrom
alan-agius4:fix-rules_angular_resolutions
Mar 13, 2026
Merged

fix(bazel/rules_angular): fix 'NgtscCompilerHost' type incompatibility#3529
alan-agius4 merged 2 commits intoangular:mainfrom
alan-agius4:fix-rules_angular_resolutions

Conversation

@alan-agius4
Copy link
Contributor

This change fixes an issue where the 'NgtscCompilerHost' was not assignable to 'CompilerHost'
due to incompatible 'SourceFile' types from different TypeScript versions.

The fix involves ensuring that the Angular compiler worker uses the user-configured
TypeScript dependency instead of a potentially different version from the root.
As part of this, the 'typescript-local' dependency alias is renamed to 'typescript'
and the symlinking logic is moved to the worker package.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request renames the typescript-local dependency to typescript across the project. This involved updating package.json and pnpm-lock.yaml to reflect the new dependency name and directly reference typescript. Corresponding changes were made in MODULE.bazel and BUILD.bazel files to adjust the TypeScript dependency configuration and symlinking, ensuring all Bazel modules correctly reference the renamed typescript package. Additionally, internal tooling in ng-dev/misc/sync-module-bazel was updated to correctly parse the TypeScript version based on the new naming convention.

@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Mar 13, 2026
@alan-agius4 alan-agius4 force-pushed the fix-rules_angular_resolutions branch from 2f91132 to 3f90950 Compare March 13, 2026 11:56
This change fixes an issue where the 'NgtscCompilerHost' was not assignable to 'CompilerHost'
due to incompatible 'SourceFile' types from different TypeScript versions.

The fix involves ensuring that the Angular compiler worker uses the user-configured
TypeScript dependency instead of a potentially different version from the root.
As part of this, the 'typescript-local' dependency alias is renamed to 'typescript'
and the symlinking logic is moved to the worker package.
…-bazel'

Removes the logic and interface definitions for handling the 'typescript-local'
dependency alias, as it is no longer used.
@alan-agius4 alan-agius4 force-pushed the fix-rules_angular_resolutions branch from 3f90950 to 315b182 Compare March 13, 2026 12:00
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

We should keep an eye out to make sure this behaves as expected once its used elsewhere, it looks correct, but I know we have also run into alot of weirdness/edges with having the user provided versions of the packages coupled with multiple instances of the rules_angular module being set up within repositories.

@alan-agius4 alan-agius4 removed the request for review from devversion March 13, 2026 13:48
@alan-agius4 alan-agius4 merged commit 9f2c9ff into angular:main Mar 13, 2026
13 checks passed
@alan-agius4
Copy link
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the fix-rules_angular_resolutions branch March 13, 2026 13:48
@alan-agius4
Copy link
Contributor Author

alan-agius4 commented Mar 13, 2026

LGTM

We should keep an eye out to make sure this behaves as expected once its used elsewhere, it looks correct, but I know we have also run into alot of weirdness/edges with having the user provided versions of the packages coupled with multiple instances of the rules_angular module being set up within repositories.

For context, the issue was that angular/angular was broken. I did link it and tested it in both patch and main prior to opening the PR and it does seem to behave as expected.

angular/angular#67677
angular/angular#67681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants