BlogsShopifyClient-side JavaScript Framework (Batman.js)

Client-side JavaScript Framework (Batman.js)

Client-side JavaScript Framework (Batman.js)

3
posts
2011–2014

Shopify's client-side JavaScript framework, Batman.js, is written in CoffeeScript. This post details the benefits of using CoffeeScript for writing JavaScript, including more concise code, fewer errors, and improved debugging workflows. It highlights how CoffeeScript compiles to JavaScript, allowing for standard minification and debugging processes. The workflow involves using a `coffee --watch --compile` command to automatically convert .coffee files to .js files, which are then committed to git.

2014

Rebuilding the Shopify Admin: Deleting 28,000 lines of JavaScript to Improve Dev Productivity - Shopify

10/28/2014

This post details the decision to deprecate and replace the in-house JavaScript framework Batman.js. The primary drivers for this decision were performance issues (memory leaks, response time regressions), significant code duplication between client-side and server-side logic, and poor developer onboarding due to the framework's complexity and lack of documentation. The team opted for a new architecture involving ERB views, server-side rendering, Turbolinks, and a custom JavaScript binding system to address these challenges, aiming to improve developer productivity and reduce codebase complexity.

2011

Three Months of CoffeeScript - Shopify

11/7/2011

This post details the author's positive experience using CoffeeScript for three months while working on the Batman.js framework. It provides a code example comparing JavaScript and CoffeeScript for object iteration, highlighting CoffeeScript's conciseness and reduced error potential. It also addresses debugging concerns, explaining that compiled JavaScript can be examined and optimized, and discusses the workflow integration of CoffeeScript compilation into the development process.

How Batman can Help you Build Apps - Shopify

9/19/2011

This post introduces Batman.js, Shopify's open-source CoffeeScript framework for building single-page applications. It details the framework's core features, including a runtime layer for observing data changes and computed properties using deep keypaths, a view system that leverages direct data binding to HTML elements for efficient updates, and a model layer for data persistence. The post highlights the framework's advantages over existing solutions by focusing on developer experience, boilerplate reduction, and performance through surgical DOM manipulation.