Repository navigation
TB Angular upgrade to v22 #7160
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,27 @@ tb_proto_library( | |
| ts_library( | ||
| name = "strict_types", | ||
| srcs = ["strict_type_check.d.ts"], | ||
| compiler = ":tsc_wrapped", | ||
| ) | ||
|
|
||
| # Custom ts_library compiler for non-Angular targets. | ||
| # | ||
| # Bazel's generated tsc_wrapped binary needs the `typescript` package at runtime, | ||
| # but does not include it in its runfiles. This may work locally because the | ||
| # execroot's node_modules directory is available, but fails in the sandbox. | ||
| # Define the binary here and add `typescript` explicitly so the compiler works | ||
| # reliably in both local and sandboxed builds. | ||
| # | ||
| # Angular targets use tsc_wrapped_with_angular below, which declares the Angular | ||
| # compiler dependencies separately. | ||
| nodejs_binary( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To keep consistency with the last Bazel8 PR could you update this lines (62-69) to be like this?: (just add This is not a blocker and the current code is not going to break anything but this update should be good to use the templated_args. |
||
| name = "tsc_wrapped", | ||
| data = [ | ||
| "@npm//@bazel/concatjs", | ||
| "@npm//typescript", | ||
| ], | ||
| entry_point = "@npm//:node_modules/@bazel/concatjs/internal/tsc_wrapped/tsc_wrapped.js", | ||
| visibility = ["//tensorboard:__subpackages__"], | ||
| ) | ||
|
|
||
| # Isolated canary for the modern rules_ts/rules_js stack. Production | ||
|
|
@@ -67,6 +88,7 @@ nodejs_binary( | |
| "@npm//@angular/compiler-cli", | ||
| "@npm//@bazel/concatjs", | ||
| "@npm//@bazel/typescript", | ||
| "@npm//typescript", | ||
| ], | ||
| entry_point = "@npm//:node_modules/@bazel/concatjs/internal/tsc_wrapped/tsc_wrapped.js", | ||
| # Disables the Bazel node modules linker. The node module linker is unreliable for the | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,9 @@ | |
| "emitDecoratorMetadata": true, | ||
| "exactOptionalPropertyTypes": true, | ||
| "experimentalDecorators": true, | ||
| // TODO(@cdavalos): Remove this after migrating from @bazel/concatjs to rules_js/rules_ts. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I think your username has a 7 at the end? Same below for any other TODOs you added. |
||
| // TypeScript 6.0 rejects deprecated options added by concatjs. | ||
| "ignoreDeprecations": "6.0", | ||
| "importHelpers": true, | ||
| "inlineSourceMap": true, | ||
| "lib": ["dom", "es2021", "dom.iterable"], | ||
|
|
@@ -23,11 +26,13 @@ | |
| "plugins": [ | ||
| { | ||
| "name": "@bazel/tsetse", | ||
| // disabled: concatjs pins tsutils to 3.21.0, which predates TS 5.9 and | ||
| // is incompatible with these two rules. ban-promise-as-condition | ||
| // crashes the compiler, must-use-promises misfires on the one | ||
| // awaited call in alert_display_snackbar_container.ts. | ||
| "disabledRules": ["ban-promise-as-condition", "must-use-promises"] | ||
| // TODO(@cdavalos): Re-enable these rules after upgrading concatjs and tsutils. | ||
| // The current versions are incompatible with TypeScript 6.0. | ||
| "disabledRules": [ | ||
| "ban-promise-as-condition", | ||
| "must-use-promises", | ||
| "ban-expect-truthy-promise" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe Pablo's PR about Bazel 8 mentioned something about this, but the details are not very clear to me. You might want to sync with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!