Solvedangular Tracking issue: Angular BuildTools Convergence (ABC)

We are open-sourcing the toolchain we use internally at Google to build Angular apps at scale.

One-pager: http://g.co/ng/abc

This issue will be used to give updates on progress.

FAQ: how does this relate to Angular CLI? We will evaluate this toolchain with some early adopters first, if it goes well, we will evaluate whether to use it inside the CLI. So long as you haven't ejected from the CLI, such a change should be transparent to users.

45 Answers

✔️Accepted Answer

We have two major Bazel updates for you today!

🎉 Bazel 1.0 is out!

Few key features of the 1.0 release are:

  • Semantic Versioning
  • Long-Term Support
  • Well-rounded features for Angular, Android, Java, and C++

You can read more in the official announcement on the Google Open Source blog. Additionally, you can find a gentle introduction to Bazel and its experimental integration with the CLI in this community post by Ignacio Le Fluk "Angular + Bazel: Getting ready!".

📣 Enhanced JavaScript support

Talking about well-rounded features for Angular, Bazel can now run pretty much any module with an executable from npm! You can directly load the binary in your BUILD file and execute an automatically generated rule. For example, you can start an http server with the following short snippet:

load("@npm//http-server:index.bzl", "http_server")

http_server(
    name = "server",
    data = [
        "index.html",
        "app.es5.js",
    ],
    templated_args = ["."],
)

Read more about the first-class JavaScript support in this post by @alexeagle.

Other Answers:

Update: we are starting to accept enterprises in an Early Access Program, to try this out with support from our team.
If you are willing to tolerate risk, missing documentation, and commit to giving feedback, then we'd like to have you use this soon. Fill out https://goo.gl/forms/Tv8lMdH0N3D4yo8Q2 and I'll get in touch once we are ready to support your use cases.

🥇 Here's the final update 🥇

I started this project three years ago with two ambitious requirements:

  1. Provide a scalable toolchain for big companies like Google with massive apps beyond the limits of existing OSS tooling
  2. Angular team maintains only one toolchain

I think we have reached the first goal. Angular + Bazel has left Angular Labs and has some production usage. We have been maturing this and just reached 2.0 of rules_nodejs, where this support is maintained, demonstrated, and documented.

However the second requirement is much harder. Angular must maintain the CLI and keep all users updated to the latest. Switching this to Bazel required making it adoptable by the most novice users on small projects. This is the "Convergence" in the project title. It's very hard and was only ever staffed by one engineer (@gregmagolan who's awesome), plus me in part-time.

We didn't achieve Convergence, so Angular team will continue to maintain only the CLI (and the underlying build system called "Architect" aka CLI Builders). You can choose to layer Bazel on top of that underlying build system, continuing to use Architect for compatibility as documented here; that means you can still use Angular-team-supported tooling under Bazel (though with limited benefits). Big thanks to @alan-agius4 for volunteering to support this option.

What should you do?

If your project fits in Angular CLI, you should use it. Convergence isn't happening. Novice developers will never get the easy turnkey documentation and tools to switch. Bazel will never be the default, so we can close this issue.

Bazel has an on-ramp that requires understanding your build process in detail, and learning some new things like Bazel's configuration language. It's only suitable for projects where someone is willing to take the role of a build system engineer. I believe that extra-large-sized projects already have someone staffed to deal with deficiencies in the OSS toolchains, so in practice if you really need Bazel, you're probably a good fit to adopt it.

You can continue to follow our development in rules_nodejs, or join the #angular channel in http://slack.bazel.build

Thanks Angular community you are all awesome. Much ❤️

Another launch announcement: we have a rollup_bundle rule you can use to create a production bundle. See https://github.com/bazelbuild/rules_nodejs#bundlingoptimizing for the doc and https://github.com/alexeagle/angular-bazel-example for an example usage.

At this point we are just missing code-splitting/lazy-loading and Windows support, to have feature parity with Angular CLI (for features I'm aware of :) )

Updates from April & May:

💥 Angular CLI Bazel opt-in preview

On ng-conf Alex Eagle announced the official opt-in preview of Bazel in Angular CLI! You can give it a try today with the @angular/bazel schematics. For more information, check our new guide on angular.io.

💬 Conference presentations

Support program

We resumed the enterprise support program! If your company is building a large Angular application and you think that Bazel might be a good fit for you, let us know! We’d love to look at your use case and help you get started. If you want to join, fill this form or respond to this email directly.

💫 New landing page

We created a landing page for Bazel with Angular and published it at https://bazel.angular.io. There you can find links to documentation, resources, examples, and more! The latest version of the Angular Bazel example is available at bazel.angular.io/example.

👌 Smaller binary

The Bazel team has been working hard to reduce the binary size to improve install times on slow networks. The latest Bazel release is 45MB, down from 160MB a year ago.

More Issues: