I have created a simple demo where I show how to use Bazel to build a full stack application written in React and Java. This is just a simple POC, but it illustrates the concept of using Bazel as the single build tool in a mixed programming language envrionment.

Bazel

Bazel is a tool chain created to build applications at scale. Bazel’s incremental approach to building code makes it well suited for large code bases.

Another key features is support for a wide range of programming languages. This means you can build code written in multiple languages in the same build.

In this demo I take advantage of this by using Bazel to build an application written in React and Java.

The application is made up of a React frontend, written in Typescript, and a Java backend.

Using a single tool chain is not only about the convenience of fewer tools. It also opens up the door to type sharing between code written in different programming languages.

Wouldn’t it be nice if you could synchronize the objects shared between backend and frontend at compile time?

Instead of catching mismatches between server and client as runtime errors, you would catch it at compile time.

For more details about how this works you may want to read my article about language neutral types with Bazel.

Demo

Download my repo from Github if you are interested in trying it yourself.

Please note: This example currently only shows how to do a dev environment build