Live data from Hacker News

Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

shopify.com

1–10 of 49 posts

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#2
While it's refreshing to see people talk about the things they did wrong and how they intelligently approached fixing them, building your own javascript framework from scratch (batman) is something I would have said no to from the start. Not for the faint of heart or those who have not suffered such an endeavor before.

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#3
post #2

While it's refreshing to see people talk about the things they did wrong and how they intelligently approached fixing them, building your own javascript framework from scratch (batman) is something I would have said no to from the start. Not for the faint of heart or those who have not suffered such an endeavor before.

If I had to guess, none of the solutions back then sufficed for them. Batman has been around for a while.

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#4
post #3
post #2

While it's refreshing to see people talk about the things they did wrong and how they intelligently approached fixing them, building your own javascript framework from scratch (batman) is something I would have said no to from the start. Not for the faint of heart or those who have not suffered such an endeavor before.

If I had to guess, none of the solutions back then sufficed for them. Batman has been around for a while.

You're dead on. We started work on Batman some time ago now - options then were quite limited.

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#5
Money quote from the article:

The new admin would make a return to more classic architecture with some modernizations. Our approach would be ERB views and server-side rendering, with the use of Turbolinks, and a lightweight custom JavaScript binding system. This allowed us to tackle problems of code duplication and developer productivity in a single blow.

As always, the devil is in the details and I'm looking forward to seeing what their JS binding system looks like, but the pendulum appears to be swinging back towards server-side rendering and models, even amongst the cool kids.

I have been working on a small library for doing HTML partial AJAX programming, using fairly straight-forward HTML attributes and traditional server side rendering (plus some goodies like custom HTTP header support, timers, etc.):

http://intercoolerjs.org

I'm using it successfully in a few projects and very much enjoy the simplicity of the whole approach when contrasted with full MVC systems.

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#7

Money quote from the article: The new admin would make a return to more classic architecture with some modernizations. Our approach would be ERB views and server-side rendering, with the use of Turbolinks, and a lightweight custom JavaScript binding system. This allowed us to tackle problems of code duplication and developer productivity in a single blow. As always, the devil is in the details and I'm looking forward…

Can we please drop the "cool kids" cliche? It's a tired generalization.

Clearly at this point both architectures work, it's childish to see this as an argument for server-side rendering. Obviously it works, so do client MVC systems.

The value in this article is the humble detailing of their mistakes that many of us also experience in our careers.

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#8
post #4
post #3

Earlier quoted context omitted.

If I had to guess, none of the solutions back then sufficed for them. Batman has been around for a while.

You're dead on. We started work on Batman some time ago now - options then were quite limited.

2 years ago I was exploring frameworks for an enterprise project. I tried Batman along with most others, I can easily see why building your own framework would have been an option any earlier than that.

Most frameworks weren't even at 1.0 stable yet. I initially wrote a fairly extensive prototype with Ember, but there were breaking changes so frequently I couldn't keep up with the learning curve. In the end I chose Angular because it had the best documentation, Google dogfooding, and testing was an obvious priority. Worked out so well we're on our 4th major Angular app now.

Re: Rebuilding the Shopify Admin: Deleting 28k lines of JavaScript

#9
My teammate and I compete to see not how much code we can write, but who can have the highest sum of lines deleted in all commits. Any old hack can write a lot of code, but to remove code while still adding functionality (or at least, not removing it) is the sign of a good developer, imho.
Post reply on HN