fix(bazel/rules_angular): update worker to use user-configured TypeScript instead of npm version#3597
Conversation
…ript instead of npm version Ensure that the users typescript version is used.
There was a problem hiding this comment.
Code Review
This pull request modifies the bazel/rules/rules_angular/src/worker/BUILD.bazel file to ensure that a user-configured TypeScript version is used for compilation instead of the default npm version. The review feedback suggests making the inline comment for this change more concise for better readability and consistency with other comments in the file.
| # output, but it's still necessary for some foundational utils like virtual FS. | ||
| "//:node_modules/@angular/compiler-cli", # compiler from npm. | ||
| "//:node_modules/typescript", # typescript from npm. | ||
| ":node_modules/typescript", # user-configured typescript. Ensure that the users TypeScript version is always used for the compilation. |
There was a problem hiding this comment.
I think this was previously using the version from npm because we can cause mismatches between the expected typescript types for the local envinronment (the users TS version) and the version that @angular/compiler-cli expects from npm.
Is that not a concern? Or I am misunderstanding?
There was a problem hiding this comment.
The problem with that approach is that any usage of ts_project will use the built-in version of the TypeScript instead of what is supplied by the users.
In the case of having mismatches, I think we need to come up with a better solution or use an @angular/compiler-cli version that supports the TypeScript versions that are used in both main and patch.
One other alternative would be not using the the @angular/compiler-cli FS for plain TS compilations but that is a larger task.
There was a problem hiding this comment.
Okay, If we are okay with moving the "error point" to the angular compiler-cli version like this, thats fine with me.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Ensure that the users typescript version is used.