90

Full Stack Development with React and Bazel

 5 years ago
source link: https://www.tuicool.com/articles/hit/BRzAJnI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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

If you liked this article, share it with your friends on social media:

We also have a new Facebook group about advanced Angular topics.

Bzyuqi.png!web

I invite you to follow me on twitter Follow @helgevold


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK