Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
33f6068
Add temporary angular.json for ng update workaround
cdavalos7 Feb 12, 2026
3f28b0b
Ignoring files temporary for angular upgrade
cdavalos7 Feb 12, 2026
263e502
Updated CLI angular version to 16
cdavalos7 Feb 12, 2026
07fe3ff
Updated @angular/core@16 @angular/cli@16
cdavalos7 Feb 12, 2026
91c5a92
Updated yarn.lock with latest versions in Angular 16
cdavalos7 Feb 13, 2026
2c06191
Fixed multiple issues in build. New patch for bazel/concatjs for comp…
cdavalos7 Feb 16, 2026
fdbafa2
Updated build errors caused by Angular upgrade to 16. Update definiti…
cdavalos7 Feb 16, 2026
892a847
Yarn compatibility for consistency across platforms
cdavalos7 Feb 16, 2026
a8911c2
Updated types for router outlet component. Removed temporary angular.…
cdavalos7 Feb 17, 2026
546e9df
Fix complaining linter in CI about trailing spaces
cdavalos7 Feb 17, 2026
3d18ad4
Fixed unit test breaking by Angular upgrade to v16
cdavalos7 Feb 19, 2026
4e3b0b7
Merge branch 'tensorflow:master' into feature/upgrade15-16
cdavalos7 Feb 23, 2026
60e6d6f
Fixed internal build errors
cdavalos7 Feb 24, 2026
6f2123c
Removed failed solutions in internal build for orbitControl.js depend…
cdavalos7 Feb 24, 2026
b984292
Returned fix with extension .js to OrbitControls script from three l…
cdavalos7 Feb 26, 2026
29f809f
Remove runtime pkg_resources dependency in default and server_ingeste…
0xmagnus91 Mar 5, 2026
a00b763
Add temporary angular.json for ng update workaround
cdavalos7 Feb 12, 2026
b02fda5
Ignoring files temporary for angular upgrade
cdavalos7 Feb 12, 2026
91c98f6
Updated CLI angular version to 16
cdavalos7 Feb 12, 2026
6ba9975
Updated @angular/core@16 @angular/cli@16
cdavalos7 Feb 12, 2026
0d3b6ea
Updated yarn.lock with latest versions in Angular 16
cdavalos7 Feb 13, 2026
70f2ad4
Fixed multiple issues in build. New patch for bazel/concatjs for comp…
cdavalos7 Feb 16, 2026
51a7169
Updated build errors caused by Angular upgrade to 16. Update definiti…
cdavalos7 Feb 16, 2026
c2cbf17
Yarn compatibility for consistency across platforms
cdavalos7 Feb 16, 2026
7f530da
Updated types for router outlet component. Removed temporary angular.…
cdavalos7 Feb 17, 2026
06c7996
Fix complaining linter in CI about trailing spaces
cdavalos7 Feb 17, 2026
5264495
Fixed unit test breaking by Angular upgrade to v16
cdavalos7 Feb 19, 2026
1d9e029
Fixed internal build errors
cdavalos7 Feb 24, 2026
9cfb9ec
Removed failed solutions in internal build for orbitControl.js depend…
cdavalos7 Feb 24, 2026
5363ed4
Returned fix with extension .js to OrbitControls script from three l…
cdavalos7 Feb 26, 2026
ad12bd4
Merge branch 'feature/upgrade15-16' of github.com:cdavalos7/tensorboa…
cdavalos7 Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"devDependencies": {
"@angular-devkit/build-angular": "^15.2.9",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#fb42478534df7d48ec23a6834fea94a776cb89a0",
"@angular/cli": "^15.2.9",
"@angular/compiler": "15.2.9",
"@angular/compiler-cli": "^15.2.9",
"@angular/cli": "^16.2.0",
"@angular/compiler": "16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@babel/core": "^7.16.12",
"@bazel/concatjs": "5.7.0",
"@bazel/esbuild": "5.7.0",
Expand Down Expand Up @@ -65,16 +65,16 @@
"yarn-deduplicate": "^5.0.0"
},
"dependencies": {
"@angular/animations": "^15.2.9",
"@angular/cdk": "^15.2.9",
"@angular/common": "15.2.9",
"@angular/core": "^15.2.9",
"@angular/forms": "^15.2.9",
"@angular/localize": "^15.2.9",
"@angular/material": "^15.2.9",
"@angular/platform-browser": "^15.2.9",
"@angular/platform-browser-dynamic": "^15.2.9",
"@angular/router": "^15.2.9",
"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.14",
"@angular/common": "16.2.12",
"@angular/core": "^16.2.12",
"@angular/forms": "^16.2.12",
"@angular/localize": "^16.2.12",
"@angular/material": "^16.2.14",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12",
"@angular/router": "^16.2.12",
"@ngrx/effects": "^15.4.0",
"@ngrx/store": "^15.4.0",
"@polymer/decorators": "^3.0.0",
Expand Down Expand Up @@ -131,6 +131,15 @@
"three": "~0.137.0",
"umap-js": "^1.3.2",
"web-animations-js": "^2.3.2",
"zone.js": "^0.12.0"
}
"zone.js": "^0.13.3"
},
"resolutions": {
"@types/d3-brush": "1.1.8",
"@types/d3-axis": "1.0.19",
"@types/d3-transition": "1.3.6",
"@types/d3-zoom": "1.8.7",
"@types/d3-drag": "1.2.8",
"@types/d3-scale-chromatic": "1.5.4"
},
"packageManager": "yarn@1.22.22"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
diff --git a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel b/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel
index d5a8645..4b57378 100755
--- a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel
+++ b/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/BUILD.bazel
@@ -23,6 +23,7 @@ js_library(
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.

],
)

diff --git a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/esbuild-plugin.mjs b/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/esbuild-plugin.mjs
index 57cd2b9..2e5eaf1 100755
--- a/node_modules/@angular/build-tooling/shared-scripts/angular-optimization/esbuild-plugin.mjs
Expand Down
30 changes: 30 additions & 0 deletions patches/@bazel+concatjs+5.7.0.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
diff --git a/node_modules/@bazel/concatjs/internal/common/compilation.bzl b/node_modules/@bazel/concatjs/internal/common/compilation.bzl
index fed787a..377915a 100755
--- a/node_modules/@bazel/concatjs/internal/common/compilation.bzl
+++ b/node_modules/@bazel/concatjs/internal/common/compilation.bzl
@@ -160,25 +160,11 @@ def _outputs(ctx, label, srcs_files = []):
closure_js_file = ctx.actions.declare_file(basename + ".mjs")
closure_js_files.append(closure_js_file)

- # Temporary until all imports of ngfactory/ngsummary files are removed
- # TODO(alexeagle): clean up after Ivy launch
- 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

if not is_dts:
devmode_js_file = ctx.actions.declare_file(basename + ".js")
devmode_js_files.append(devmode_js_file)
transpilation_infos.append(struct(closure = closure_js_file, devmode = devmode_js_file))
declaration_files.append(ctx.actions.declare_file(basename + ".d.ts"))
-
- # Temporary until all imports of ngfactory/ngsummary files are removed
- # TODO(alexeagle): clean up after Ivy launch
- if getattr(ctx.attr, "use_angular_plugin", False):
- devmode_js_files.append(ctx.actions.declare_file(basename + ".ngfactory.js"))
- devmode_js_files.append(ctx.actions.declare_file(basename + ".ngsummary.js"))
- declaration_files.append(ctx.actions.declare_file(basename + ".ngfactory.d.ts"))
- declaration_files.append(ctx.actions.declare_file(basename + ".ngsummary.d.ts"))
return struct(
closure_js = closure_js_files,
devmode_js = devmode_js_files,
diff --git a/node_modules/@bazel/concatjs/web_test/karma.conf.js b/node_modules/@bazel/concatjs/web_test/karma.conf.js
index 90a03ef..28778c9 100755
--- a/node_modules/@bazel/concatjs/web_test/karma.conf.js
Expand Down
4 changes: 4 additions & 0 deletions patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
We use [patch-package](https://www.npmjs.com/package/patch-package) to apply
TensorBoard-specific patches to some of our npm/yarn dependencies.

After creating or updating a patch, ensure there is no trailing whitespace on
any line (CI runs `./tensorboard/tools/whitespace_hygiene_test.py`). You can
strip it with `sed -i '' 's/[[:space:]]*$//' patches/<patch-file>.patch`.

To regenerate @bazel/concatjs patch:
* `vi node_modules/@bazel/concatjs/web_test/karma.conf.js`
* make edits
Expand Down
12 changes: 5 additions & 7 deletions tensorboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ py_library(
srcs = ["default.py"],
srcs_version = "PY3",
deps = [
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard/backend:experimental_plugin",
"//tensorboard/plugins/audio:audio_plugin",
"//tensorboard/plugins/core:core_plugin",
Expand Down Expand Up @@ -347,7 +346,6 @@ py_test(
deps = [
":default",
":test",
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard/plugins:base_plugin",
],
)
Expand All @@ -367,7 +365,7 @@ py_test(
deps = [
":test",
":version",
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard:expect_packaging_installed",
],
)

Expand Down Expand Up @@ -461,10 +459,10 @@ py_library(name = "expect_absl_logging_installed")
# `pip install absl-py`
py_library(name = "expect_absl_testing_absltest_installed")

# This is a dummy rule used as a pkg-resources dependency in open-source.
# We expect pkg-resources to already be installed on the system, e.g., via
# `pip install setuptools`.
py_library(name = "expect_pkg_resources_installed")
# This is a dummy rule used as a packaging dependency in open-source.
# We expect packaging to already be installed on the system, e.g. via
# `pip install packaging`.
py_library(name = "expect_packaging_installed")

# This is a dummy rule used as a pandas dependency in open-source.
# We expect pandas to already be installed on the system, e.g. via
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ py_library(
":grpc_provider",
":ingester",
"//tensorboard:expect_grpc_installed",
"//tensorboard:expect_pkg_resources_installed",
"//tensorboard:expect_packaging_installed",
"//tensorboard/data/proto:protos_all_py_pb2",
"//tensorboard/util:tb_logging",
],
Expand Down
11 changes: 4 additions & 7 deletions tensorboard/data/server_ingester.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
import time

import grpc
import pkg_resources
from packaging import version as packaging_version

from tensorboard.data import grpc_provider
from tensorboard.data import ingester
from tensorboard.data.proto import data_provider_pb2
from tensorboard.util import tb_logging


logger = tb_logging.get_logger()

# If this environment variable is non-empty, it will be used as the path to the
Expand Down Expand Up @@ -202,7 +201,7 @@ def _maybe_read_file(path):


def _make_stub(addr, channel_creds_type):
(creds, options) = channel_creds_type.channel_config()
creds, options = channel_creds_type.channel_config()
options.append(("grpc.max_receive_message_length", 1024 * 1024 * 256))
channel = grpc.secure_channel(addr, creds, options=options)
return grpc_provider.make_stub(channel)
Expand Down Expand Up @@ -231,9 +230,7 @@ def __init__(self, path, version):
"""
self._path = path
self._version = (
pkg_resources.parse_version(version)
if version is not None
else version
packaging_version.parse(version) if version is not None else version
)

@property
Expand All @@ -260,7 +257,7 @@ def at_least_version(self, required_version):
"""
if self._version is None:
return True
return self._version >= pkg_resources.parse_version(required_version)
return self._version >= packaging_version.parse(required_version)


def get_server_binary():
Expand Down
22 changes: 14 additions & 8 deletions tensorboard/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
for less repetition.
"""


import logging

import pkg_resources
from importlib import metadata

from tensorboard.plugins.audio import audio_plugin
from tensorboard.plugins.core import core_plugin
Expand All @@ -46,7 +44,6 @@
from tensorboard.plugins.mesh import mesh_plugin
from tensorboard.plugins.wit_redirect import wit_redirect_plugin


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -119,8 +116,17 @@ def get_dynamic_plugins():
[1]: https://packaging.python.org/specifications/entry-points/
"""
return [
entry_point.resolve()
for entry_point in pkg_resources.iter_entry_points(
"tensorboard_plugins"
)
entry_point.load()
for entry_point in _iter_entry_points("tensorboard_plugins")
]


def _iter_entry_points(group):
"""Returns entry points for a given group across Python versions."""
entry_points = metadata.entry_points()
# In newer Python versions, `metadata.entry_points()` returns an
# `EntryPoints` object with a `select()` method.
# Before "selectable" entry points existed, it would return a dictionary.
if hasattr(entry_points, "select"):
return entry_points.select(group=group)
return entry_points.get(group, ())
40 changes: 9 additions & 31 deletions tensorboard/default_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,30 @@
# ==============================================================================
"""Unit tests for `tensorboard.default`."""


from unittest import mock

import pkg_resources

from tensorboard import default
from tensorboard.plugins import base_plugin
from tensorboard import test


class FakePlugin(base_plugin.TBPlugin):
"""FakePlugin for testing."""

plugin_name = "fake"


class FakeEntryPoint(pkg_resources.EntryPoint):
"""EntryPoint class that fake loads FakePlugin."""

@classmethod
def create(cls):
"""Creates an instance of FakeEntryPoint.

Returns:
instance of FakeEntryPoint
"""
return cls("foo", "bar")

def resolve(self):
"""Returns FakePlugin instead of resolving module.
class FakeEntryPoint:
def __init__(self, value):
self._value = value

Returns:
FakePlugin
"""
return FakePlugin
def load(self):
return self._value


class DefaultTest(test.TestCase):
@mock.patch.object(pkg_resources, "iter_entry_points")
@mock.patch.object(default, "_iter_entry_points")
def test_get_dynamic_plugin(self, mock_iter_entry_points):
mock_iter_entry_points.return_value = [FakeEntryPoint.create()]
fake_plugin = object()
mock_iter_entry_points.return_value = [FakeEntryPoint(fake_plugin)]

actual_plugins = default.get_dynamic_plugins()

mock_iter_entry_points.assert_called_with("tensorboard_plugins")
self.assertEqual(actual_plugins, [FakePlugin])
self.assertEqual(actual_plugins, [fake_plugin])


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions tensorboard/defs/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ def tf_ng_web_test_suite(name, deps = [], **kwargs):
name = name,
bootstrap =
[
"@npm//:node_modules/zone.js/dist/zone-evergreen.js",
"@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

],
# The only dependency is the esbuild bundle from spec_bundle().
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/plugins/mesh/tf_mesh_dashboard/mesh-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
*/

import * as THREE from 'three';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls.js';

interface LayerConfig {
showBoundingBox?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/plugins/projector/vz_projector/scatterPlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as THREE from 'three';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls.js';
import {ProjectorEventContext} from './projectorEventContext';
import {CameraType, LabelRenderParams, RenderContext} from './renderContext';
import {
Expand Down
23 changes: 6 additions & 17 deletions tensorboard/version_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


import pkg_resources
from packaging import version as packaging_version

from tensorboard import test as tb_test
from tensorboard import version
Expand All @@ -22,22 +22,11 @@
class VersionTest(tb_test.TestCase):
def test_valid_pep440_version(self):
"""Ensure that our version is PEP 440-compliant."""
# pkg_resources.parse_version() doesn't have a public return type,
# so we get a handle to it by parsing known good and bad versions.
#
# Note: depending on the version of the module (which is bundled
# with setuptools), when called with a non-compliant version, it
# either returns a `LegacyVersion` (setuptools < 66) or raises an
# `InvalidVersion` exception (setuptools >= 66). Handle both cases.
compliant_version = pkg_resources.parse_version("1.0.0")
try:
legacy_version = pkg_resources.parse_version("arbitrary string")
except Exception:
legacy_version = None
self.assertNotEqual(type(compliant_version), type(legacy_version))

tensorboard_version = pkg_resources.parse_version(version.VERSION)
self.assertIsInstance(tensorboard_version, type(compliant_version))
with self.assertRaises(packaging_version.InvalidVersion):
packaging_version.parse("arbitrary string")

tensorboard_version = packaging_version.parse(version.VERSION)
self.assertIsInstance(tensorboard_version, packaging_version.Version)


if __name__ == "__main__":
Expand Down
Loading
Loading