Book Image

React 16 Tooling

By : Adam Boduch, Christopher Pitt
Book Image

React 16 Tooling

By: Adam Boduch, Christopher Pitt

Overview of this book

React 16 Tooling covers the most important tools, utilities, and libraries that every React developer needs to know — in detail. As React has grown, the amazing toolset around it has also grown, adding features and enhancing the development workflow. Each of these essential tools is presented in a practical manner and in a logical order mirroring the development workflow. These tools will make your development life simpler and happier, enabling you to create better and more performant apps. Adam starts with a hand-picked selection of the best tools for the React 16 ecosystem. For starters, there’s the create-react-app utility that’s officially supported by the React team. Not only does this tool bootstrap your React project for you, it also provides a consistent and stable framework to build upon. The premise is that when you don’t have to think about meta development work, more focus goes into the product itself. Other React tools follow this same approach to automating and improving your development life. Jest makes unit testing quicker. Flow makes catching errors easier. Docker containers make deployment in a stack simpler. Storybook makes developing components straightforward. ESLint makes writing standardized code faster. The React DevTools plugin makes debugging a cinch. React 16 Tooling clears away the barriers so you can focus on developing the good parts. In this book, we’ll look at each of these powerful tools in detail, showing you how to build the perfect React ecosystem to develop your apps within.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
2
Efficiently Bootstrapping React Applications with Create React App
Index

Introducing tooling?


Tooling isn't unique to React. Every project has its own set of tools that handle tasks related to the core technology so that you don't have to. With frameworks, tooling is baked into the project for the most part. With libraries like React, you get to choose the tools you need versus those that don't play a role in your project.

Now that you know what the React core is, what makes up the rest of the React ecosystem?

Ancillary tasks outside of React

Framework bloat is a major turn-off for a lot of people. The reason it feels like bloat is because they have a lot of features that you'll likely never use. React handles this well because it has a clear distinction between the core library and anything else, including things that are essential for React development.

There are two observations I've made about React and the way it's positioned within its surrounding ecosystem:

  • It's easier to deploy apps that depend on a simple library instead of a framework where all batteries are included
  • It's easier to think about application development when you have tools that stay out of the way for the most part

In other words, you don't have to use the majority of React tools, but some of them are incredibly helpful.

Any given tool is external to the library you're working with; it's essential to remember this. Tools exist to automate something that would otherwise suck more development time out of our lives. Life is too short to manually do things that can be done for us. I repeat, life is too short for tasks that software can perform better than us. If you're a React developer, take comfort in the fact that there are tools out there for all of the important things that you need to do but don't have time to do.

A construction site analogy

Perhaps, the ultimate motivator for taking tooling seriously is thinking about what life would be like without the tools that we depend on as professionals. The construction industry is more mature than software and serves as a great example.

Imagine that you are part of a team that's responsible for building a house—an immensely complex undertaking with many moving parts. Now, think about everything that you have to work with. Let's start with the materials themselves. Anything that doesn't have to be assembled on site, isn't. When you're building a house, many components show up partially assembled. For example, sections of roof framing or mixed cement shows up when it's needed.

Then there are actual tools that builders use when putting the house together—simple screwdrivers, hammers, and measuring tapes are taken for granted. What would construction life be like without the ability to create components offsite or the availability of tools to work with everyday construction materials? Would it make the construction of a house impossible? No. Would the process of building it become some unbearably expensive and slow that it'd likely be cancelled before completed? Yes.

Unfortunately, in the software world, we're only beginning to understand how important tooling is. It doesn't matter that we have all the materials and knowledge to build the house of the future. If we don't have the right tooling, it might never be built.