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

Upgrade angular from v12 to v14 #628

Closed
wants to merge 0 commits into from
Closed

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented May 19, 2023

Upgrade angular from v12 to v14

Few changes:

  • upgrade rules_nodejs to 5.7.0 (this will extend the nodejs versions available for installation, while we are installing the default nodejs version here with the 5.7.0 rules_nodejs toolchain)
    • following this, upgrade all bazel toolchain to 5..7.0
  • correspondingly upgrade rules_sass version to 1.55.0 (I can only find rules_sass github codebase with given version tag, but not sure how to find its hash..etc. Here we are basically following tensorboard team's current setup)
  • upgrade angular (and all relative packages) to v14, correspondingly upgrade ngrx to v14, and bump up rxjs.
  • upgrade typescript to 4.7.4
  • upgrade zone.js to 0.12.0
  • import ts_library (used for bazel build) from concatjs instead of typescript, as the module is moved to concatjs. (Also added concatjs into data field of tsc_wrapped_with_angular target)
  • added name field to the output of rollup.config.js, as it is a required field now for iife output type
  • Added node_modules into include_paths of sass_binary build rule when building the styles.css file for frontend. This is because angular v14 changed to import angular/cdk from using a relative path to an new one like @angular/cdk, so we need to include the node_modules int the the searching paths to enable sassCompiler to find the theming file.
  • yarn_install's exports_directories_only property now defaults to True. We must set this to False in order to remain compatible with ts_library
    See: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0#exports_directories_only
  • No longer need to override node_version as rules_nodejs default version of node is now 16.12.0.
    See: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0#updated-defaults
    We were overriding this only because rules_nodejs defaul version of node was too old.

References

Notes
Since then, the tensorboard_plugin_profiler build process mostly follows tensorboard's setup, but we are diverging moving forward as following:
(1) The tensorboard team changed to use esbuild to bundle the js file instead of rollup (see tensorflow/tensorboard#5829). We may consider switching to esbuild in the future as well given its potential better performance, but now since it's not blocking us, we remain to use rollup.
(2) The tensorboard team uses angular teams internal toolchain to build angular with bazel for angular v13+ (see tensorflow/tensorboard#6049). Since we turns out don't have the issue tensorboard is facing when upgrading angular, we are fine to go forward without changing our bundling rules. And we tend not to because the toolchain is not publicly used and there's no guarantee on supporting in the future.

@copybara-service copybara-service bot force-pushed the test_533374699 branch 6 times, most recently from daf9344 to 35692b6 Compare May 19, 2023 21:56
@copybara-service copybara-service bot force-pushed the test_533374699 branch 3 times, most recently from 05d9a97 to fbb480f Compare May 31, 2023 23:09
@copybara-service copybara-service bot changed the title upgrade to angular v14 Upgrade angular from v12 to v14 Jun 1, 2023
@copybara-service copybara-service bot closed this Jun 5, 2023
@copybara-service copybara-service bot deleted the test_533374699 branch June 5, 2023 19:58
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.

0 participants