...

/

Front-End Options

Front-End Options

Learn which front-end option we will be adding to our Rails app.

JavaScript and Webpacker

We are living in a JavaScript renaissance—no longer is it the whipping boy of language purists. Rails has embraced modern JavaScript technologies like React through its inclusion of Webpacker, a gem that brings webpack support.

As Rails developers, it is important to be able to incorporate these technologies into our apps as needed, so our Docker environment needs to support us in that endeavor.

We will explore the options for working with JavaScript as part of our Rails development. We will also see how to include a React front-end in our Rails app by installing and configuring Webpacker. By the end of this chapter, our Docker-based development environment will play nice with all this modern JavaScript goodness.

The JavaScript front-end options

There are a number of different options when it comes to combining JavaScript into the front-end for your Rails apps. Perhaps the biggest choice is whether your Rails app will serve up the front-end or not. Both are equally valid options, and each way has some advantages and disadvantages and will lead to different setups. If your Rails app is not serving up your front-end, that ...