angular-docs-cn/packages/bazel/src/schematics
Keen Yee Liau 08ff8aa055 docs(bazel): Mention Architect prototype and Slack Channel (#37190)
This commit adds a link to the Bazel prototype for orchestrating
multiple CLI architects and also adds a link to the #angular channel in
the Bazel Slack workspace.

PR Close #37190
2020-05-28 21:35:40 -04:00
..
ng-add refactor(bazel): Remove Schematics for Bazel Builder (#37190) 2020-05-28 21:35:40 -04:00
ng-new refactor(bazel): Remove Schematics for Bazel Builder (#37190) 2020-05-28 21:35:40 -04:00
utility refactor(bazel): Remove Schematics for Bazel Builder (#37190) 2020-05-28 21:35:40 -04:00
README.md docs(bazel): Mention Architect prototype and Slack Channel (#37190) 2020-05-28 21:35:40 -04:00

README.md

Schematics for Bazel

Bazel builder for Angular CLI has been deprecated in version 10.

We believe that a lot of projects would benefit from using Bazel, the same way we do in the Angular repository. We still believe that is true in many cases. However, after experimenting with Bazel schematics for Angular CLI in Angular Labs for the past year, we concluded that invoking Bazel from within CLI is not the best approach to encourage adoption of the technology. Instead, we recommend developers to explore using Bazel directly, and refer to the canonical example repository for latest updates and best practices.

In the beginning of this project, we thought it would make Bazel easier for users to adopt if we abstracted the BUILD files management and tooling orchestration within Angular CLI. However, we have come to realize that such abstraction does not encourage users to use Bazel to its full potential. There is currently a prototype that showcases how multiple architects within CLI could be orchestrated by Bazel.

There are a few other reasons for this deprecation:

  1. Bazel ecosystem for the Web is still evolving at a rapid pace.
  2. The introduction of the Angular Ivy compiler enables new ways to use Bazel in a faster and more efficient manner (see below).
  3. Feature parity with Webpack-based Angular CLI is difficult to achieve without trade-offs that would not be acceptable for many Angular users.

Migrate from @angular/bazel

For users who are currently using Bazel builder, there are a few migration options.

Eject the BUILD files

You could leave the Bazel files in your workspace, and manage them manually:

ng build --leaveBazelFilesOnDisk

If you're using Ivy, in your BUILD files replace ng_module with the ng_ts_library rule. This new rule leverages ngtsc plugin supported by ts_library, and it is much faster.

For the latest recommendations, please refer to the canonical Angular Bazel repo.

For questions, please ask in the #angular channel in http://slack.bazel.build/.

Angular CLI

If you'd like to revert to the default Angular CLI builder, you could restore the original Angular config from backup by replacing angular.json with angular.json.bak.