Musings regarding the current state of React.js development

I've been developing React.js applications for a few years now and I find it impressive how the architecture React promotes works so well for large scale and long term app development, even today within the turmoil that web development has become.

I'm going to skim over the library hell that is Javascript in general (recently spent over 2 weeks stabilizing a migration from Material UI 0.x to 1.x beta where I had to replace nearly 60% of the code written), since it affects most mainstream JS dev environments anyway, not just React environments.

The reason I keep going to React.js for my day-to-day and the main sauce of why I keep promoting it is the fact that I like to work in big projects with big budgets. It's that plain and simple.

When combined with an appropriate packaging and repo management strategy (i.e. currently loving the mono-repo model promoted by Babel's lerna which plays wonderfully with Webpack), React's ability to create reusable digital legos is what web development had been trying to achieve for almost two decades prior (remember MVC? *shudders*) and is still currently unable to top.

This ability to create reusable components makes it easy not only to scale apps, but development teams as well.

Another big factor in the "why i currently love React" equation is the ease with which a web app can be translated to mobile with React Native.

I should clarify that in the past I had overestimated that ease, React Native is not the "write javascript, get native" solution we all had hoped for. But if you're realistic and you plan ahead a good division between data layers and UI components (basically keep all redux stores and back-end calls behind well thought-out abstractions which can be later re-used in React Native), while keeping in mind that you'll still have to build and maintain most of the UI separately, you're solid gold.

Still, React.js' worst enemy is itself, or rather how steep its learning curve is.

I still meet hopeful junior developers who've tried jumping in the deep-end of JS development by attempting to create a "simple hello world" in React only to find themselves drowning under the sea of info needed in order for $ webpack build to yield a proper (error free) result.

Just think about it:

  • Hello world in Node:
    1. head on over to Node.js website, download node and install it
    2. run $ node in your terminal of choice
    3. type console.log('hello world') and hit ENTER
  • Hello world in React:
    1. Install Node
    2. Install Babel (wait what is that?)
    3. Install Webpack and configure it using the webpack.config (wait, config? what does webpack do again? is it the web server?)
    4. Install Yarn and add your dependencies (Yarn? why not just $ npm install --save?)
    5. etc...

You're probably catching my drift.

Most seasoned devs have already created their own flavor of the infamous React.js boilerplate (myself included), and most of the times the reasoning behind that effort is simple enough:

"I never want to have to deal with configuring a React app from scratch ever again."

I've even gone as far as to use my boilerplate to setup a "playground" in my machine to be the "one React app to rule them all", which I use to create both useful and frugal components in my spare time. Someday I might even move it online.

But even then, sometimes I have a simple idea which I want to publish quickly. Then React.js actually gets in the way. The most recent example was an audio player I wanted to have online to share songs from my music project Steady Noise Machine. I ended up just making it in plain HTML, CSS, and vanilla JS using AmplitudeJS.

The previous experience being such an epiphany that I'm seriously considering writing an article titled "How I published my app online in 10 minutes, by avoiding mainstream Javascript libraries".

In all seriousness, even to this day I try not to marry any given framework. I'll just as easily build an app using Angular, Vue, Ember, Meteor, etc. But at the end of the day, I'll keep favoring React.js, if only to have some peace of mind about the long-term effectiveness of my code in this world.

Show Comments