Issue 13 ~ 4/14/2017
It's been over 10 years since Rails popularized the MVC pattern. A lot has happened since then. Front-ends have grown and grown and grown. Clients who used to be happy with a few effects from script.aculo.us now want single-page applications (SPAs). In this brave new world, what are we to make of the pitiful little "V" in "MVC"?
La la I can't hear you!
Traditional page-based web apps still work. I feel silly saying this. But we've reached a point where new developers are surprised to hear that a performant website is just a website.
Moreover, the tools we have to progressively enhance web applications have gotten really good. Approaches like Turbolinks give us a lot of the benefits of SPAs at a fraction of the cost.
Granted, these approaches aren't "cool" anymore, and Turbolinks was definitely overhyped. But they do work very well and let small teams look like big teams, which is what Rails has always been about.
Learn how Basecamp uses Turbolinks to allow their small team to deliver SPA-like performance on web and mobile.http://confreaks.tv/videos/railsconf2016-turbolinks-5-i-can-t-believe-it-s-not-native
Fortunately Rails 5.1 has made this easy for us by integrating with Webpack . It's a little like bundler and the Asset Pipeline had a baby.
If you don't have a clear idea of what Webpack is, or why it might be useful to Rails developers, here's a great introduction.http://blog.andrewray.me/webpack-when-to-use-and-why/
This brand-new video shows you how to use Webpack in Rails. It's a little different from using it by itself.https://www.youtube.com/watch?v=Szs1DwEMhPg
The nice MVC pattern of Rails isn't very useful when 90% of your code lives in a single "view." In that case, we need to have a separate architecture just for the front-end.
This article lays out several of the challenges facing MVC.https://medium.freecodecamp.com/is-mvc-dead-for-the-frontend-35b4d1fe39ec
The team at Ember recently released their rendering engine, Glimmer, as a stand-alone project. This talk explains its architecture (which includes unidirectional data flow) and why it's better than what came before.http://confreaks.tv/videos/fullstackfest2015-inside-glimmer-what-makes-ember-s-rendering-engine-tick
MVC, championed by Rails, has come to dominate server-side web applications. It's still too early to tell if any architecture will come to dominate front-end web applications in the same way.
Next week we're going to dive to a lower level and talk about some of the protocols that make all of these new-fangled internet doohickeys work. Stay tuned!