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.
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.
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.
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!