Skip to content

Conversation

@stephanwlee
Copy link
Contributor

TensorBoard has been using custom Vulcanization to build the frontend
but we have plans to use better officially Bazel-team supported rule:
rules_nodejs. This adds the WORKSPACE dependency to the repo.

Also, to prove the correctness of the integration, this change also
Angular CLI generated (heavily trimmed down and modified) code with its
build rule.

TensorBoard has been using custom Vulcanization to build the frontend
but we have plans to use better officially Bazel-team supported rule:
rules_nodejs. This adds the WORKSPACE dependency to the repo.

Also, to prove the correctness of the integration, this change also
Angular CLI generated (heavily trimmed down and modified) code with its
build rule.
@@ -0,0 +1,18 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do note that, by default, ts_library and necessary rule use "//:tsconfig.json" as the default label for tsconfig field. https://github.com/bazelbuild/rules_nodejs/blob/432f88c8acc47b95ae6f368d3c5b7fe3e65baef7/packages/typescript/src/internal/build_defs.bzl#L424-L425

package.json Outdated
@@ -0,0 +1,49 @@
{
"name": "tensorboard",
"version": "1.14.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably we'll want some way to keep this number, at a minimum, in sync with our pip package version? Maybe we can add a presubmit check that verifies that this number always matches version.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can do that or we can make this version preposterous like 0. This number is mostly useful only when we are publishing a npm package which we are not (note, private: "true"). Which would you prefer?

# Keep this version in sync with the BAZEL environment variable defined
# in our .travis.yml config.
versions.check(minimum_bazel_version = "0.22.0")
versions.check(minimum_bazel_version = "0.26.1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify, is 0.26.1 the minimum for any reasonable version of rules_nodejs? Or if we went back a few versions on that, could we retain compatibility across more than one bazel version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to clarify, is 0.26.1 the minimum for any reasonable version of rules_nodejs?

0.26.0 is the minimum version required by rules_nodejs.

exports_files(["tsconfig.json"])


ts_config(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this level of the Bazel package hierarchy doesn't exist internally, do we know how we're going to sync this and the other files? Or do we not use any of these internally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or do we not use any of these internally?

This :)

@caisq
Copy link
Contributor

caisq commented Jul 29, 2019

Thanks for working on this, @stephanwlee .

cc'ing myself for notifications.

@stephanwlee
Copy link
Contributor Author

Okay, now, I am confident that everything will work as intended. I tried to transfer the new addition internally and I did get everything to build correctly! cl/260512283
image

@stephanwlee stephanwlee requested a review from nfelt July 29, 2019 17:48
@stephanwlee
Copy link
Contributor Author

Here is a small doc on how to manage dependency in the new world. #2003 (comment)

I will update it and keep it up-to-date.

Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

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

Onwards into the bright new Angular dawn! 📐 🌄

package.json Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we perhaps set this to "0.0.0-unused" just to be extra clear?

@stephanwlee stephanwlee merged commit 8cd4030 into tensorflow:master Aug 2, 2019
@stephanwlee stephanwlee deleted the ng branch August 2, 2019 23:20
@wchargin
Copy link
Contributor

wchargin commented Aug 2, 2019

🎉

@stephanwlee
Copy link
Contributor Author

💄 ?

wchargin added a commit that referenced this pull request Aug 5, 2019
Summary:
Since #2472, this is needed to alter frontend dependencies; since #2493,
it is needed to lint frontend code.

Test Plan:
Ask a guinea pig to follow these instructions.

wchargin-branch: docs-yarn
wchargin added a commit that referenced this pull request Aug 5, 2019
Summary:
Since #2472, this is needed to alter frontend dependencies; since #2493,
it is needed to lint frontend code.

wchargin-branch: docs-yarn
"@angular/cli": "^8.1.2",
"@angular/compiler": "^8.1.2",
"@angular/compiler-cli": "^8.1.2",
"@bazel/bazel": "^0.23.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR bumps the Bazel version in WORKSPACE from 0.22.0 to 0.26.1,
but adds a dependency in package.json at version 0.23.2. Is there any
reason for the discrepancy?

Cf. #2534 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants