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.

Feb 17

Online Dojo workshops!

By on February 17, 2015 1:36 pm

We’ve offered our full line-up of public Dojo training workshops for over eight years at locations around the world. Attendee response is always positive because people love that our instructors are actual, web developers themselves! “Lively”, “engaging” and “wow” are just a few words that describe our team of instructors; JavaScript and Dojo experts who understand and relate to the pain and joy that you experience every day makes our training workshops that much more worth it.

We think it’s a real shame that there are developers that have to go it alone because they are in remote locations or can’t travel to one of our many in-person workshops. So we spent countless hours and many sleepless nights creating a way to ensure that no developer misses out on the opportunity to learn best practices building web apps with the Dojo Toolkit!

We’re very excited to announced that we are now offering…

Online, public workshops!

Dojo Core: The Essentials
Dojo Core: The Essentials
March 9-10, 2015
US$400
Dojo Widgets: The Essentials
Dojo Widgets: The Essentials
March 11-13, 2015
US$600

We will be using our very cool, Dojo-based workshop tool to deliver four hours of workshops each day, where you can expect to learn the essentials of using Dojo core, Dijit, and dgrid while watching expert developers live code all the while having the chance to try it yourself and ask questions, real time!

Are you In?

Register now! Demand for this workshop will dictate how soon we’ll hold the next one!

If you have any questions, ask in the comments or contact us.

Jan 28

Patching Modern Dojo

By on January 28, 2015 2:41 pm

DojoFAQ

While it will not happen often, there may be times when you need to patch your Dojo source. Perhaps you discovered a bug and are waiting for the fix to be committed or released, or your application uses an older version of Dojo but you want to use features found in newer releases. Dojo’s AMD plugin loader makes it possible to apply patches without resorting to modifying the source files themselves, making it easier to upgrade your version of Dojo.

As an example, Dojo 1.10 introduced dojo/throttle into the core—along with the extension event dojo/on/throttle—for ensuring that a function is fired only once during the specified interval. However, if you are developing with an earlier version of Dojo (for example, 1.9.6), you will either need to upgrade to 1.10.x or provide a patch to use it with 1.9.6. In this post, we will create patches for these modules.

Jan 22

The road to Intern 3

By on January 22, 2015 12:38 pm

Intern

We normally try to schedule new minor releases of Intern about once every four to six weeks, but when we are working on a major release, there will often be a larger than usual gap in the release cycle. In order to keep our users informed of what’s going on, we wanted to write about what we’ll be doing over the next six to twelve weeks for Intern 3, during which time there will be no new releases (except for possible critical patch releases).

Jan 21

Dojo FAQ: How can I handle recoverable server errors transparently with dojo/request?

By on January 21, 2015 10:10 am

DojoFAQ

A common scenario with web applications is accessing protected resources, which require authentication with the server in order to proceed. A common flow is as follows:

  1. User opens web site
  2. Web site presents authentication screen
  3. User enters credentials
  4. Web site presents protected information

Authentication workflows

This is simple enough to begin with, but what happens when the session times out? Or perhaps the application does not require authentication initially, but once the user initiates an action to access protected resources authentication is required? A common approach is to use redirects to an authentication page:

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!

Dec 1

Escape the Winter and Learn Dojo in Phoenix

By on December 1, 2014 12:29 pm

Good news everyone!

Now that summer is over, there’s no more heat to complain about! That just leaves, ah yes, the bitter cold. Sure, maybe you’ve been handling it well enough so far by staying busy with holiday planning, but what happens when the New Year comes? Suddenly nobody is “Dreaming of a white…” anything, anymore.

Your best hope is escape. And for that, we have a plan!

Winter Protection Program

Hello there, Brudolph

Pack your bags, leave it all behind and join us in the Phoenix area for sunshine, warm weather and, oh right, hands-on Dojo workshops.

Our expert approach and guided development by Dojo co-founder Dylan Schiemann, together with live code examples and tons of reference material go great with sunscreen and a cool beverage (Margarita, Señoras y Señors?).

Half the cost, twice the temperature

Register by December 31 with promo code HOLIDAY2014 and you’ll save 50%!