Caveman’s brief look into modern front-end

modern front-end

Well, it might seem surprising, given what this blog is usually about, but during most of my career my main focus was… in front-end development. Yup, JavaScript and friends. It wasn’t the only thing I did, but definitely the biggest one. After moving to Canada focus shifted a little bit: I still do occasional front-end tasks for our web project, which started back in 2009, but basically last 2 years I’m on a server side.

If your project started nine years ago and it’s about web, most of your tools are probably obsolete. It’s been before Angular (the first one!), before React, Vue or Ember. We did have jQuery, but promptly got rid of it several years later. We built our own toolkit and avoided rewriting the app for every new-and-finally-done-right library that came along. Not everyone was happy, but the product works and sells, so approach worked.

However, in order to understand where the industry headed, I still tried to at least take a tutorial or two for every major tool that came along. After two year pause for doing another things, I’m refreshing my front-end knowledge again, and this time it feels.. different.

Checking out Webpack

webpack-logoLast time I was actively front-end’ing, Webpack was already there. It wasn’t really clear, though, if it’s going to be a thing. Grunt, Gulp, TypeScript and SystemJS also could bring multiple JavaScript modules together, so why another tool? It looks like Webpack has won, and after taking a Pluralsight course in it I’m.. confused.

What exactly new value does it provide? Or old value, but in more efficient manner? That was supposed to be a thing, but seeing how more and more unrelated settings are going into webpack.config.js, all I see is a duck tape and glue trying to attach a cat to a potato. Why? Well, they happened to be nearby, so must be related.

I admit, my rant might be caused by aging brain forced to learn a thing it though it already knows. But it feels OK learning everything else! And indeed, why should it enjoy solving the same task – bundling modules – again? Wasn’t it solved few times already?

Amusing thing was that Webpack configuration examples I saw were written for version 3. It’s 6 months later and current Webpack version is 4.4, which… is not entirely compatible with v3.

Seriously? So it takes 5 years and 4 versions to find out how final configuration format should look like? That’s depressing.

Checking out Vue.js

vuejs-logoOn the bright side, I’m also taking a few courses in Vue.js and it’s surprisingly enjoyful tool to use. Vue also has been around for some time and it also wasn’t clear if it’s going to be a thing. It did become one, and in this case I feel that the industry actually made a noticeable step forward.

Somehow it’s harder to enumerate what I do like in Vue, but generally I appreciate that it stays simple for simple scenarios and adds new levels of abstraction only as they needed. It doesn’t feel like it’s trying to do some sort of black magic under the hood – it’s pretty easy to predict how code will behave. That’s not always the case with other frameworks.

And I really like how they managed to make declarative part of the framework to feel that natural. Declarative approach itself is not something new, but here my mind almost bent, because suddenly I could see another set of ideas and building blocks I could compose my solutions from. It’s like discovering functional programming all over again.

Conclusion

So far all this front-end refreshing endeavour feels a little bit confusing. On the one hand there’s Vue and I’m glad somebody made it. On the other hand there’s Webpack and it’s a reminder that some areas of our industry are going in circles, not in ascending spiral.

What I don’t understand is why it’s only now when it feels so weird. After all, front-end always was like this. Maybe I got spoiled by two years of solid back-end, containers and occasional DevOps, where the tools, even ones that are not quite production ready, kind of make sense both individually and when assembled together into the app. Never completely got that feeling with front-end.

Leave a Reply

Your email address will not be published. Required fields are marked *