Skip to content

Webapp Angular upgrade 15 to 16#7056

Merged
cdavalos7 merged 31 commits intotensorflow:masterfrom
cdavalos7:feature/upgrade15-16
Mar 5, 2026
Merged

Webapp Angular upgrade 15 to 16#7056
cdavalos7 merged 31 commits intotensorflow:masterfrom
cdavalos7:feature/upgrade15-16

Conversation

@cdavalos7
Copy link
Contributor

@cdavalos7 cdavalos7 commented Feb 17, 2026

Motivation for features / changes

This PR is the first step in a planned major Angular upgrade cycle, where each major version will be delivered in a separate PR, incrementally progressing until the project reaches Angular 20.

This specific PR upgrades TensorBoard from Angular 15 to Angular 16, initiating the migration path toward Angular 20+.

Keeping the framework and aligned dependencies (NgRx, TypeScript, RxJS, zone.js, etc.) up to date ensures continued compatibility, security support, and maintainability, while preparing the project for future Angular features and ecosystem improvements.

Technical description of changes

Upgrade the TensorBoard web application from Angular 15 to Angular 16 following TensorBoard’s DEVELOPMENT.md guidelines and the official Angular migration guide.

Detailed steps to verify changes work correctly (as executed by you)

deps = [
"@npm//@babel/core",
"@npm//@babel/helper-annotate-as-pure",
+ "@npm//@babel/helper-split-export-declaration",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only change in this file. The newer version of @angular-devkit/build-angular: 15.2.11 (resolved in yarn.lock) explicitly added @babel/helper-split-export-declaration as its own dependency. The BUILD.bazel for the optimization scripts can not find it, so needs to be added.

- if getattr(ctx.attr, "use_angular_plugin", False):
- closure_js_files.append(ctx.actions.declare_file(basename + ".ngfactory.mjs"))
- closure_js_files.append(ctx.actions.declare_file(basename + ".ngsummary.mjs"))
-
Copy link
Contributor Author

@cdavalos7 cdavalos7 Feb 17, 2026

Choose a reason for hiding this comment

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

In this Angular version Ivy is already available so these lines can be removed. @todos resolved.

Copy link

Choose a reason for hiding this comment

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

Do you think we should try to upgrade @bazel/concatjs to avoid having to maintain this patch file? Low priority -- im fine with this as it is now but it might be sort of kicking a can down the road that we can avoid if we just upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you @nattySP , the plan is to upgrade to the latest version of @bazel/concatjs once we migrate to Angular 21. Since we are currently on a transitional version and there is no official compatibility table for this library, patching it was the most efficient temporary solution

Copy link
Member

Choose a reason for hiding this comment

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

Am I understanding correctly that these lines are present in the standard concatjs 5.7.0 package, and this patch is removing them? (So this TODO is likely removed in a later version of that library?)

Do you know what happens if we don't remove these lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, most probably this will be fixed in newer version of this patch.
If we don't remove these lines, Angular builds can't be done within Bazel. This was one of the issues in the debugging process in the build

"@npm//:node_modules/zone.js/dist/zone-testing.js",
"@npm//:node_modules/zone.js/bundles/zone.umd.js",
"@npm//:node_modules/zone.js/bundles/zone-testing.umd.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
Copy link
Contributor Author

@cdavalos7 cdavalos7 Feb 17, 2026

Choose a reason for hiding this comment

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

New paths for zone.js

@cdavalos7 cdavalos7 changed the title Feature/upgrade15 16 Webapp Angular upgrade 15 to 16 Feb 17, 2026
@cdavalos7 cdavalos7 marked this pull request as ready for review February 17, 2026 23:03
@cdavalos7 cdavalos7 requested a review from bmd3k February 18, 2026 17:33
@cdavalos7 cdavalos7 assigned cdavalos7 and unassigned arcra and cdavalos7 Feb 18, 2026
@cdavalos7 cdavalos7 requested a review from arcra February 18, 2026 17:34
* providers: [{
* provide: CustomizableButton,
* useClass: MyCustomButtonComponent,
* useValue: MyCustomButtonComponent,
Copy link

Choose a reason for hiding this comment

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

useValue is an odd configuration for this; useClass would be the expected configuration and i don't expect this to change for an angular version upgrade. What was the reason for this change -- what were the test failures?

Copy link
Contributor Author

@cdavalos7 cdavalos7 Feb 24, 2026

Choose a reason for hiding this comment

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

Thank you for pointing this out @nattySP . I forgot to add the justification:

  • useClass creates an instance of the component.
  • useValue provides the class as-is without instantiating it.

CustomizableComponent now expects a class reference so it can create it dynamically itself via viewContainerRef.createComponent().

Triggered by the removal of ComponentFactoryResolver in Angular 16, which had been deprecated since Angular 13.

Copy link

Choose a reason for hiding this comment

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

Thank you so much for the explanation, makes sense! I missed that createComponent() was being used.

- if getattr(ctx.attr, "use_angular_plugin", False):
- closure_js_files.append(ctx.actions.declare_file(basename + ".ngfactory.mjs"))
- closure_js_files.append(ctx.actions.declare_file(basename + ".ngsummary.mjs"))
-
Copy link
Member

Choose a reason for hiding this comment

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

Am I understanding correctly that these lines are present in the standard concatjs 5.7.0 package, and this patch is removing them? (So this TODO is likely removed in a later version of that library?)

Do you know what happens if we don't remove these lines?

@cdavalos7 cdavalos7 enabled auto-merge (squash) March 4, 2026 21:26
0xmagnus91 and others added 16 commits March 4, 2026 18:30
tensorflow#7057)

## Motivation for features / changes

Fixes tensorflow#7003.

`pkg_resources` is removed in newer setuptools, which can break
TensorBoard at import/runtime. This change removes runtime reliance on
`pkg_resources` in the two affected code paths.

## Technical description of changes

- Replaced dynamic plugin discovery in `tensorboard/default.py`:
  - from `pkg_resources.iter_entry_points(...)`
- to `importlib.metadata.entry_points(...)` with compatibility handling
for different Python return shapes.
- Replaced version parsing in `tensorboard/data/server_ingester.py`:
  - from `pkg_resources.parse_version(...)`
  - to `packaging.version.parse(...)`.
- Updated related tests:
- `tensorboard/default_test.py` now patches `_iter_entry_points` and
uses `load()`-style fake entry points.
- `tensorboard/version_test.py` now validates PEP 440 behavior using
`packaging.version`.
- Updated Bazel deps to use `expect_packaging_installed` where
`packaging` is now required.

## Detailed steps to verify changes work correctly (as executed by you)

Executed locally in an isolated venv:

- `python -m py_compile tensorboard/default.py
tensorboard/default_test.py tensorboard/data/server_ingester.py
tensorboard/version_test.py`
- `PYTHONPATH=. python tensorboard/version_test.py` (passes)

Attempted but environment-limited locally:

- `bazel test //tensorboard:version_test //tensorboard:default_test
//tensorboard/data:server_ingester_test` (bazel not available in local
shell)
- Direct execution of `default_test.py` and `server_ingester_test.py`
without Bazel-generated artifacts hit local environment/import
constraints.

## Alternate designs / implementations considered (or N/A)

- N/A
…atibility Angular 16. Path updates in libraries and new package.lock
…brary. Fix will be applied in internal build
@cdavalos7 cdavalos7 merged commit 994708e into tensorflow:master Mar 5, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants