Newsletter: The Front End

Datetime:2017-04-18 05:52:26         Topic: Ruby on Rails  JavaScript          Share        Original >>
Here to See The Original Article!!!

Front End

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"?

I think the answer is that it's still up in the air. You need only look at the JavaScript framework churn of recent years. But a few patterns have started to emerge and I think it will be interesting to examine them.

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.

BRANDON HILKERT

Organizing JavaScript With Turbolinks

Turbolinks works well as long as you organize your JavaScript the right way. This article shows you a very simple approach.

http://brandonhilkert.com/blog/organizing-javascript-in-rails-application-with-turbolinks/

SAM STEPHENSON

Turbolinks 5: I Can’t Believe It’s Not Native!

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

JIM JONES

Your Front End Framework is Overkill - Server Side Javas Script w/ Rails

By combining Rails' unobtrusive JavaScript system with server-side JS views, you can very easily ajaxify normal CRUD operations.

http://confreaks.tv/videos/railsconf2015-your-front-end-framework-is-overkill-server-side-javascript-w-rails

Growing JavaScript

No matter what kind of application you have, as the amount of JavaScript you maintain grows you'll need to come up with a way to manage it.

The Rails Asset Pipeline provides a way to concatenate and minify JS assets. But at some point you may want to switch to a JavaScript module bundler.

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.

ANDREW RAY

Webpack: When and why to use it

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/

GORAILS

Using Webpack with Rails

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

Front-end achitecture

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.

Early JavaScript frameworks tended to follow a MVC approach, or its close cousin, MVP . More recently, we've begun to see the ascendence of a new group of "unidirectional" architectures.

ALEX MOLDOVAN

Is MVC dead 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

ANDRÉ STALTZ

Unidirectional User Interface Architecture

Many of the more recent JavaScript frameworks, such as React, use a 'unidirectional' architecture instead of an MVC approach. This article explains what that means and what its advantages are.

https://staltz.com/unidirectional-user-interface-architectures.html

TOM DALE

Inside Glimmer: Ember's Rendering Engine

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

Parting words

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.

I suspect that the answer is that there won't be. The variety of use-cases for front-end JavaScript seems to be too great for any one approach to win. In either case it'll be entertaining to watch!

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!








New