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(typescript): support for ESM variant of the Angular compiler plugin #2982

Conversation

devversion
Copy link
Contributor

As of v13, the @angular/compiler-cli package will come as strict ESM
package. This means that the import currently in tsc_wrapped does
not work for v13+ of Angular. This commit adds an interop allowing for
both the ESM variant, and CJS variant of the Angular compiler to work.

@google-cla google-cla bot added the cla: yes label Sep 27, 2021
@devversion devversion force-pushed the feat/support-for-v13-angular-compiler branch from d459ac9 to 24b7a10 Compare September 27, 2021 17:49
As of v13, the `@angular/compiler-cli` package will come as strict ESM
package. This means that the import currently in `tsc_wrapped` does
not work for v13+ of Angular. This commit adds an interop allowing for
both the ESM variant, and CJS variant of the Angular compiler to work.
@devversion devversion force-pushed the feat/support-for-v13-angular-compiler branch from 24b7a10 to 1bd3de1 Compare September 27, 2021 18:06
@devversion devversion marked this pull request as ready for review September 27, 2021 18:27
@@ -61,6 +61,7 @@ tsc(
data = _TSC_WRAPPED_SRCS + [
"//internal:tsconfig.json",
"@npm//@types/node",
"@npm//@angular/compiler-cli",
Copy link
Collaborator

Choose a reason for hiding this comment

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

it feels a bit undesirable to have a compile-time dependency, but it does reflect the actual types of the tsc_wrapped program where we added the layering violation

Copy link
Contributor Author

@devversion devversion Sep 27, 2021

Choose a reason for hiding this comment

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

It's only compiled when tsc_wrapped is built as part of the @bazel/typescript NPM package, so it doesn't have any impact on consumers. The benefit is just a little type-safety here, compared to relying onany

@alexeagle alexeagle merged commit 6f97a7c into bazel-contrib:stable Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants