Blog

Feb 27

Optimized Navigation: Isomorphic Resources

By on February 27, 2015 8:14 am

When building web applications, developers often face the dilemma of whether to use traditional server-side rendered pages, or client-centric applications that rely on Ajax/JSON data requests, with client-side rendering of data. These two approaches also tend to dictate navigation (among other things), leading to traditional page navigation or a single-page application (perhaps with hash-based navigation). With the traditional approach, content is delivered in HTML form, relying on browser-driven page loads for different views. However, modern applications with more sophisticated user interfaces, often use a single-page style, controlling events, view updates, and relying on Ajax-style communication with the server to load additional content, typically in structured object format, like JSON. The traditional approach naturally works well with search engines, and browser navigation and can be quickly rendered by the browser. Single-page applications facilitate well structured user interfaces, with clean separation of presentation and data. But is there a way to combine the best of both worlds?

Feb 18

From DOH to Intern: Updating Dojo core’s tests

By on February 18, 2015 10:11 am

Intern

One of the primary motivations for creating Intern was to make support for continuous integration testing much easier to achieve with JavaScript-based application development. We recently converted the vast majority of the unit tests in Dojo core from DOH to Intern, in order to streamline the process of regression testing patches for Dojo 1.x.

This was a very large amount of work, and we learned a number of interesting things along the way that should be useful to you in writing your own tests.

Jan 14

Dojo FAQ: Testable store-backed widget

By on January 14, 2015 1:11 pm

DojoFAQ

As object stores are frequently used in Dojo-based applications, developers often ask about a good way to utilize stores in their custom widgets. Here we present a common pattern for doing just that in a two-stage approach, starting simple.

A store-based widget needs two things at minimum: a way to set the store and a way to render items from the store. We start with a mixin that provides those elements. Note that standard documentation is omitted for brevity.

define([
  'dojo/_base/declare',
  'dojo/dom-construct'
], function(declare, domConstruct) {
  return declare(null, {
    store: null,

    _setStoreAttr: function (store) {
      this._set('store', store);

      if (store) {
        this._renderItems(this.store.query({}));
      }
    },

    _renderItems: function (queryResults) {
      queryResults.forEach(function (item) {
        var renderedItem = this._renderItem(item);
        domConstruct.place(
          renderedItem,
          this.containerNode || this.domNode
        );
      }, this);
    },

    _renderItem: function (item) {
      // render the item and return its DOM node
    }
  });
});
Jan 8

Robust JavaScript Application Architecture

By on January 8, 2015 1:11 pm

In October, 2014, I was coerced invited to deliver a talk at the first FullStack conference in London, a conference focused on Node.js, JavaScript and hackable electronics. The conference was an interesting cross-section of all things related to JavaScript.

A topic that’s been on my mind lately is how to choose a robust architecture that’s right for your application. The point of the talk was to encourage people to challenge assumptions and not just choose whatever is popular or whatever they know best. I’m sure some attendees in the audience just wanted to be told which framework to use, but the point was to make people really challenge themselves, and find solutions that work now, but are flexible enough to change later.

The talk is now available online:

JavaScript architecture assistance

JavaScript Application architecture is something we specialize in at SitePen, as we see far too many organizations struggling in this area. If you need assistance, please contact us to talk more about your application and how we can help.

Dec 5

Intern 2.2 released

By on December 5, 2014 12:24 pm

Today we’re pleased to announce the release of Intern 2.2. Along with improvements to existing functionality and a few bug fixes, this release includes a new console-mode reporter that provides a more detailed view of the testing process and improved rendering of differences between objects. Full details are in the release notes; read on for some of the highlights!

Nov 17

Introducing dstore

By on November 17, 2014 1:24 pm

dstore 1.0

Dojo has long distinguished itself with a robust and complete application architecture. And the foundation of this architecture has been the store interface, providing clean separation and consistent interface between presentation and data sources. We are committed to continuing to improve this architecture, and in this pursuit, we now releasing dstore, a next generation object store interface and set of data modeling components.

dstore is an exciting new package that provides a number of significant improvements over the prior data store framework, including a more fluent querying API, improved event notification, advanced cross-store filtering, and a more modular mixin system that allows us to easily combine components with alternate format support, advanced querying support, and more. In this post, we want take a brief look at these new features and improvements. From there, you can explore the tutorials and documentation that we have written for this new package.

Sep 24

EdgeConf San Francisco 2014

By on September 24, 2014 9:57 am

At many conferences, the hallway track is more interesting than the track during presentations. It’s the serendipity of a small group of people interested in solving a similar problem that run into each other and just start talking through it that makes the hallway track the most interactive experience at most conferences.
edge
EdgeConf capitalizes on these discussions by turning the hallway track into what the conference is all about! There are a selected set of topics covering emerging trends in web technologies and a panel of 5-6 people take the stage with one stepping forward to bring the audience quickly up to speed. The discussion begins!

The panelists work through a set of curated questions and there’s a system for the audience to participate and join the debate. Everyone is encouraged to spend less than a minute at a time talking, ideally 30 seconds or less. If the speaker goes over 2 minutes, there’s a nice warning across the screen on stage that tells the speaker that their time’s up. Oh, and the whole thing was streamed live! You can watch all 10 hours of coverage or read the gist below!

Sep 12

Intern 2.1 released

By on September 12, 2014 9:06 pm

Today we’re happy to announce the release of Intern 2.1. This release contains several bugfixes and improvements to existing functionality, as well as new features to make running tests and handling test results easier. The full list of enhancements and bugfixes is available in the release notes. Here are some of the highlights!

More output options

Two new reporters have been added to Intern: an HTML reporter for the browser client and a JUnit XML reporter.

The HTML reporter is a new default reporter for Intern’s browser client runner (client.html). It displays at the end of a test run, summarizing the test results and presenting them in an easy-to-read format:

The output of the JUnit reporter, on the other hand, is meant for machine consumption. It aggregates test results and outputs them in a report.xml file that follows generally accepted standards for JUnit-compatible XML. This makes it much easier to plug Intern into tools that accept JUnit reports, like Jenkins.

Sep 9

On YUI, Dojo 2, and long-term JavaScript toolkits

By on September 9, 2014 9:20 am

In late August, YUI surprised the JavaScript world by announcing that, effective immediately, development efforts on YUI have been suspended. YUI was a well respected peer of Dojo over the years, and we were surprised to hear this news from Yahoo. The JavaScript community can be very fickle, with new projects created every day. It’s very easy to create open source software, but it’s difficult to create projects that last.

Aug 22

Advanced TypeScript concepts: Classes and types

By on August 22, 2014 8:38 am

While TypeScript is very simple to understand when performing basic tasks, having a deeper understanding of how its type system works is critical to unlocking advanced language functionality. Once we know more about how TypeScript really works, we can leverage this knowledge to write cleaner, well-organised code.

If you find yourself having trouble with some of the concepts discussed in this article, try reading through the Definitive Guide to TypeScript first to make sure you’ve got a solid understanding of all the basics.

JavaScript Workshops