BT

Box Releases T3 JavaScript Framework

| by David Iffland Follow 4 Followers on Apr 23, 2015. Estimated reading time: 2 minutes |

The online storage and content platform, Box, open-sourced a new front-end JavaScript framework. Dubbed T3, the framework attempts to solve problems that large applications encounter by decoupling code into small, discrete pieces.

In a post introducing T3, Box Principal Architect Nicholas Zakas says that his team built it to solve internal issues with multiple developers working on a huge code base. "There aren't any existing options that did what we needed," says Zakas in an interview with InfoQ.

Most existing solutions are geared towards MVC-based architectures, and we wanted to go in a different direction. Some other abstractions exist, there just weren't enough already-existing pieces to make what we have in T3.

These components come in one of three types:

  • Services
  • Modules
  • Behaviors

In a typical ToDo List example, the project not only shows the code, but also provides an explanation of what each piece of code does. For example, in describing the code that maintains item status, the description says:

While all modules are independent, each module talks to a service that maintains todo status. The todos-db service manages adding, removing, and marking tasks throughout the apps lifecycle.

T3's concept of services is similar to that of Angular, for example. Developers register a service with the Application:

Application.addService('router', function(application) {
    return {
        route: function(url, state) {
            history.pushState(state, '', url);
        }
    };
});

Unlike Angular, which uses dependency injection, services in T3 are accessed through a request on the Application global:

var router = Application.getService('router');
router.route('/home', {});

Like React, using T3 does not preclude the use of other frameworks. "There's nothing preventing us from using Backbone, React or another framework in addition to T3. T3 really just helps better organize individual code while allowing our engineers to piece together a full client-side stack out of whatever they want," says Zakas.

In a discussion on Hacker News, developers have praised the team's credentials, but have made comparisons between T3's components to those of Ember, Angular, and Meteor. User DigitalSea complains that T3 offers nothing new:

I just do not see why Box needed to create another Javascript framework. Am I missing something here? As a front-end developer I get excited about this stuff, but I just do not see what T3 brings to the table that other frameworks do not.

Zakas says that T3 excels in certain types of apps. "It will work with other approaches as well, including MVC architectures and single-page apps, but it's strength is definitely in progressive enhancement." Box uses T3 on both the desktop and mobile web applications.

T3 is available on GitHub

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT