The techniques involved in creating modern web applications are continually evolving. It can be difficult to separate out the ones that are truly improving how web applications are developed from those experiments that, while often interesting, are ultimately not worth investing in.
It’s been a while since we’ve dove into Dojo’s Deferred module on the SitePen blog—the last time was back in 2010 when we introduced the promise-inspired improvements that landed with Dojo 1.5. Quite a lot has happened since on the topic, including a ground-up rewrite of Dojo’s asynchronous foundations in 1.8+, so it’s about time we take another look at deferreds and promises and how it all fits together in Dojo.
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: User opens web site Web site presents authentication screen User enters credentials Web site presents protected information 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: User’s authentication session times out Any action on user’s part redirects to authentication screen After successful authentication, user is redirected to the results of the initial action This model works well enough with applications architected around the full page request-response model, but becomes less pleasant with single-page applications that provide a persistent and responsive user interface.
When writing tests for an application, it’s prudent to add mock or stub data in order to allow code to be properly tested in isolation from other parts of the system. Within a normal Dojo application, there are typically three places where mocking will occur: I/O requests, stores, and module dependencies.
Dojo’s store API is a common interface for providing data to user interface widgets, such as dgrid, Dijit Select, and Dojo Charting. The beauty of having a consistent API is that once you’ve defined an interface for a data source, that data becomes easily available to all widgets that support the store API.
As Dojo moves toward its 2.0 release, our focus has been on giving developers tools that will help them be productive in any JavaScript environment. This means creating consistent APIs across all environments.
We have been providing JavaScript and Dojo support to freelancers, start-ups and Fortune 500 companies for nearly a decade. As we intently watch enterprise organizations everywhere begin to roll out AMD (read about why AMD matters) and the associated code improvements, we are thrilled with the industry’s direction toward toolkit interoperability! Why? Because! Our masterful engineering team, consisting of influential members of various open source communities, positions SitePen perfectly to offer full-on, front-end web development support to the world! Getting right to the point, (The Official Point!), we are pleased to announce the expansion of SitePen Support to officially include more than fifteen popular open-source JavaScript toolkits! Now supporting the following JavaScript toolkits: Dojo Persevere packages dgrid Curl.js CometD Twine jQuery Backbone underscore RequireJS PhoneGap/Cordova MooTools jQueryUI Wire Socket.IO Express In addition to toolkits, we will continue to support your custom JavaScript source code, as well as key underlying technologies and formats, including JSON, HTML5, WebSockets, SVG/Canvas, Mobile Web, Server-Side JavaScript, AMD, Node.js and many more.
Dojo 1.4 sports a fantastic tree widget, complete with ARIA compliance, keyboard accessibility, and internationalization (including right-to-left layout for appropriate countries and languages). For large tree data sets, we want to be able to only load the necessary data for the visible nodes of the tree.
The Dojo-based Bespin project has added collaboration and social features so developers can more easily share code in real-time! Finally, a truly productive use of social networking for developers! By combining the benefits of SubEthaEdit and many of the social features you find on networking sites, the project is headed in a very useful direction that should significantly improve the way software is developed. Bespin has huge potential for open source projects…
As part of our series on how we built Queued, today we’re going to talk about theming the Queued application, and touch on a few examples of what made putting the skin on Queued so much fun. The foundation for the beautiful theme for Queued was laid down by colleagues Damon Dimmick and Torrey Rice, and their amazing wireframe and mockup work (respectively) provided the building blocks for laying down Queued’s skin.
Dojo is a very flexible toolkit; it doesn’t dictate how you organize your code or create your widgets. It simply provides tools, and it’s up to you to decide how you want to fit them together.
Last month, we announced Queued, an open-source application for managing your Netflix Queue. Queued is a desktop application created with web technologies and techniques including the Dojo Toolkit, and it is distributed as an Adobe AIR application to provide several performance boosting benefits from living on the desktop.
Persevere stores structured data in the same way data is represented in JavaScript and JSON. Various different data types can be persisted including numbers, strings, booleans, objects, arrays, dates, functions, and even binary data.
Dijit has a tremendous wealth of high quality and feature-rich form elements providing key functionality including validation, time calculation, spinner controls, calendars, and much more. Furthermore, Dijit gives you a set of themes to choose from: Tundra, Soria, Noir, and Nihilo.
Silicon Valley Web Builder has a series of monthly panels on topics of interest to web application developers. I had the opportunity to attend a pair of events recently, once as a speaker, once as an attendee, and the contrast between the two was intriguing.
With the proliferation of real web browsers on mobile devices (iPhone, Android, Palm Pre, Nokia), an increasing number of browsers (Chrome) or browser-like platforms (AIR, Titanium, Jaxer), portal standards for widgets and gadgets (Caja, AdSafe, work by the OpenAjax Alliance, and much more), are the days numbered for a JavaScript toolkit that uses the same code base across all platforms without a compile step numbered? Consider the following: “We hear your words. Why another JavaScript framework?! When development of PhoneGap was under way we noticed slow load times for modern JavaScript frameworks (such as Prototype, MooTools, YUI, Ext and (yes) even jQuery.
With their announcement of the Pre last week, Palm has placed their bet that great mobile applications can be built using the same open web technologies that drive the desktop environment today. Web applications that run on modern desktop browsers are constantly pushing the envelope of the types of applications that no longer require a proprietary platform-specific SDK.
As 2008 wraps up, there are a number of announcements and noteworthy items surrounding Dojo, DWR, Persevere, and SitePen services. Dojo was recently updated to version 1.2.3.
I’ve just completed the upgrade of the DojoX FileUploader to make it compatible with Flash Player 10. The FileUploader widget allows for the uploading of more than one file at a time, which is surprisingly still not supported natively by any web browser on the market today.
I’m excited to announce a new BSD-licensed project created by SitePen and co-sponsored by Adobe: Dojo Extensions for Adobe AIR. This new effort creates a new namespace, dair, making it even easier to create rich desktop apps, such as the Dojo Toolbox, using the Dojo Toolkit and Adobe AIR.
Security in Ajax web applications is of growing importance. While the client-server model is very useful for architecting web applications, the web security is model is not client-server, but rather a client-deputy-server model.
Recently, using the Deft project, I created a multi-file uploader Flash component for DojoX. It uses a typical design pattern: embed a hidden SWF in the web page, and with the ExternalInterface, trigger the FileReference’s browse() method to open a system dialog.
Google and Yahoo have JavaScript APIs that let you perform searches. Wikipedia has a JavaScript API that lets you grab data from its pages.
The window.name transport is a new technique for secure cross-domain browser based data transfer, and can be utilized for creating secure mashups with untrusted sources. window.name is implemented in Dojo in the new dojox.io.windowName module, and it is very easy to make web services available through the window.name protocol.
Prior to the popularity of the web, client/server applications often involved the creation of native applications which were deployed to clients. In this model, developers had a great deal of freedom in determining which parts of the entire client/server application would be in the client and which in the server.
In the middle of May, we were given a mission: create a speedy, offline API documentation viewer and a graphical Dojo build tool. Here we are at the beginning of July, and the result is the Dojo Toolbox 1.0.
I was doing some research on script loading speed tests. Each script load required the page to be refreshed, making it difficult to log the time to Firebug and get an average.
Non-trivial data often has structures that cannot be well-defined with normal linear, acyclic data descriptions. Data that consists of cycles, many-to-one relationships, and non-local references often requires custom strategies for serialization and transfer of the data over JSON.
NOTE: This post is very out of date. For more up to date information about RESTful JSON in Dojo applications there are a number of more recent tutorials are available, such as the Dojo Store introduction, as well as tutorials demonstrating store-driven grids and trees, among others.
We’re pleased to announce the two latest projects from SitePen Labs: Paver and Persevere! Paver exists because of SitePen’s Kevin Dangoor, and his work on the SitePen Support web application. We found that the build tools that exist with Python just aren’t all that easy to use.
In March, we introduced the SitePen Support service to provide high-quality support for Dojo, DWR and Cometd from the people who know those projects inside and out. We’re always watching to see how we can make our services better and after listening to our early support clients we’re making changes to ensure that clients are successful with the products we support.
Recently I was writing a “tips and tricks” blog post that was going to focus on the idea that it is better to use an object as a “string buffer”; the idea was that by passing this object around to various functions and pushing string fragments into it, you can get better performance from a JavaScript engine. My friend and colleague Alex Russell challenged me to show him hard data supporting this hypothesis—and the results were quite eye-opening! For this analysis, I used two sources for tests: the dojox.string.Builder Builder performance test, and a custom test implementing three versions of a common JavaScript task: a JSON Serializer.
This is the final part of our three part series on porting Dojo methods to Flash. In part one of our series, we implemented Dojo’s hitch method, and then used hitch in part two, where we made our connect method.
Adobe recently announced their new Open Screen project, which opens the licensing of the Flash Player and much more. We’re celebrating this event with a three part series on Dojo and ActionScript and previewing some of the work by the Dojo team.
There’s been some breaking news from Adobe, announcing their Open Screen project. As of today, they are opening the licensing of the Flash Player, FLV/F4V video, publishing the AMF protocol and device APIs for the player, and more.
At SitePen, we’re dedicated to creating excellent user experiences and writing clean, beautiful code. Because of this, we’ve earned a reputation as being advocates, advisers and teachers to our friends, colleagues, and clients.
At SitePen, we value amazing user experiences. Once in a while, you see an elegant solution to a problem that has annoyed users for years.
Since Dojo 1.1 was released a week ago, several outlets have published articles: Dojo 1.1 Refines Ajax Development – Features SitePen’s Peter Higgins and Alex Russell with their thoughts on Dojo 1.1, and a comprehensive summary of what’s new with the 1.1 release Dojo Stabilizes Open Source Ajax Toolkit – Mentions Dojo backing from IBM, Sun, AOL and Nexaweb, and gives a summary of IBM and Nexaweb’s opinions of Dojo 1.1 Dojo Encourages Ajax Innovation – The facts aren’t particularly solid in this one, but it’s still nice to see Dojo get mentioned Adobe AIR for Linux – Mentions Dojo working on AIR What’s new with Google Gears – Includes a short section about Dojo Storage and the Gears Dojo data provider. .
We’re pleased to announce the release of the Dojo Toolkit 1.1. Significant progress has been made with this release, including: An easy to use and significantly improved Dojo API Viewer with some seriously great features, including the ability to easily find the original definition of a method that is “mixed-in” A growing collection of demos, tutorials, and articles A new BorderContainer Dijit, which is a much better way to handle layout-based widgets than SplitContainer and LayoutContainer Significant performance improvements to dojo.query and dojo.fx Support for Adobe AIR and Jaxer, and updated dojox.flash and dojox.offline APIs Major improvements to Dijit infrastructure and widgets All around Dijit theme improvements including the CSS structure for themes, refinements to the Tundra theme, re-introduction of the Soria theme, and the newly added Nihilo theme DTL, the Django Template Language, is now available for use in widgets with dojox.dtl Vector graphics animations Additions to DojoX including an analytics package Improvements to Dojo Data and RPC, and support for JSONPath Many improvements to the build system including CSS optimization, multiple-versions of the Dojo Toolkit co-existing in the same document, and other great tools for optimizing performance The Dojo Toolkit 1.1 Release Notes contains even more details on this release.
We’re very excited about our new commercial support offering for the Dojo Toolkit, DWR, and Cometd. So what is SitePen Support and what do we have to offer? When getting started with something different or new, there’s rarely documentation or a tutorial that addresses things in quite the right way.
Palo Alto, CA – March 13, 2008. SitePen is responding to the growing demand for commercial web application assistance by launching a support service for the Dojo Toolkit, Cometd, DWR, and related web technologies.
Joe was recently interviewed by InfoQ about DWR 3.0 as a preview of his presentation on Comet and DWR at QCon. Key points about DWR 3.0 include: Offline Support (Google Gears and/or Dojo Offline) TIBCO General Interface integration Aptana Jaxer integration OpenAjax Hub, PubSub, Bayeux, etc.
SitePen was in the news recently: Simplexity Rising: Web usability reveals itself to be a game of hide-and-seek covers our session, “Your Mom, 2.0”, for the upcoming SXSW 2008, and offers some choice quotes about building web apps that are feature rich yet easy to use. At this session, we’ll be discussing the things that make an app that’s easy for Mom to use but still delivers the features everyone wants to use.
From a recent interview with Kevin Hakman on Ajaxian: “I personally love the ability to write a script that runs on the server, but call it from the client as if it were running on the client. In this case Jaxer handles all the sync or async communications for you transparently, and soon will provide end-to-end debug capabilities as well.
While the media has beat us to the punch with countless “on AIR” puns (and the list of companies using the word air grows), we completed work to make the Dojo Toolkit compatible with Adobe AIR in time for its recent launch. It’s a platform for web app deployment that’s somewhat similar to a browser: web applications are deployed to the desktop using AIR, giving web applications some of the capabilities of desktop apps while retaining the ability to use web app development tools like the Dojo Toolkit.
As we kick off 2008, I’m pleased and extremely excited to announce that we’ve added some awesome, new talent to the SitePen team. Eugene Lazutkin is highly respected in Dojo circles for his work on Drag-n-drop, GFX (2D and 3D), Charting, and many other crucial 0.9 and 1.0 features.
In response to recent articles by Andy Clarke and David Baron, Alex recently said that the W3C cannot save us. The most significant point being made is that you cannot standardize the future, and you should not punish those who attempt to push the envelope through experimentation and invention.
Google released the first preview of Android today. It is chock full of features and a great emulator, but there was one interesting omission.
Chris Mitchell of IBM had a few days of free time prior to the Dojo 1.0 release, and so he added Canvas support for dojox.gfx. While Canvas does not offer all of the DOM goodness of SVG, it does have one key features: it works today on the iPhone.
Recently, the first draft of the new Dojo Grid made its way into the DojoX trunk. There’s still a significant amount of work to complete prior to the Dojo 1.0 launch date of October 31, but if you update your subversion checkout to head, you can follow along at home.
I recently had the opportunity to speak about Dojo on the iPhone at AjaxWorld West. The session was a straightforward, if not colorful, review of the current state of app development for the iPhone.
With the recent launch of Dojo 0.9 and the planned launch of 1.0 in late October, the SitePen Dojo training courses have been revamped and now focus exclusively on the new code base. SitePen’s partnership with UK-based Skills Matter is allowing us to offer our 3-day Dojo training workshop overseas, several times, in the upcoming months.
Slides from our recent talks at the Ajax Experience and the Rich Web Experience are now available. Newly added talks include: Standards Heresy: Dojo and the Rise of Open Web Pragmatism Dojo 0.9: Faster, Leaner, and Dijit? Comet: Low Latency Data Transit or Really Bad Pun?.
I speak at a number of conferences and am giving a couple of talks later this year about Dojo on the iPhone. Of course, giving a talk without being able to show demos is frustrating, but giving a talk without having high-quality screenshots is silly.
Alex has announced the final release of Dojo 0.9: After a complete re-think about the purpose and value of Dojo, and after months of grueling ground-up work on the part of the entire Dojo team, I’m happy, proud, and excited to announce that Dojo 0.9.0 is available. And AOL is already hosting 0.9 in their CDN.
Spaghetti code comes from all of your objects needing to know where all your other objects are so they can communicate. I used to attempt to alleviate this problem by creating a switchboard object that acted as a message bus.
Last week was the latest installment of the Ajax Experience in San Francisco. More low-key than last year’s conference, I left the main corridor only to give two talks, one on Dojo and one on Comet.
Many people are perplexed by the absence of instant messaging on the iPhone. Apple has done great things for SMS with their ichat styled interface.
Apple’s iPhone web application development tips are yet the latest example of blurring the lines between the power of the web and the desktop. The example that drives this point home the most is Google Maps: Google maps links open a built-in Google client rather than making a connection through the public website.
Safari on the iPhone does not currently have support for SVG. Safari 3 beta on Mac and Windows is currently the best browser on the planet for SVG performance, so this is a somewhat disappointing omission.
Shortly after we began working on Dojo Offline, our friends at Google invited us over to the Googleplex to tell us about their efforts in building an open source project similar to Dojo Offline called Google Gears. Since the release of Dojo Offline, we’ve been working with Google to make Dojo Offline and Google Gears work well together.
We’re speaking at and/or attending a number of upcoming events and conferences. We hope to see you there! May 20-23: Alex will be attending the IEEE Privacy and Security Symposium in Oakland, CA.
At the beginning of 2007, we announced a collaboration with Brad Neuberg to develop the Dojo Offline Toolkit, and today we are pleased to announce the beta release! Several people have asked how and why we decided to do this, and how this relationship came about. From the SitePen perspective, our clients have an obvious need for offline web applications.
Until the release of GMail, much of the innovation in the world of Ajax (at that time known as DHTML and JavaScript) was occurring behind the scenes in corporate intranet applications. At one point, Alex Russell and I concluded that the “DHTML Dark Matter” was at least 10 times the size of the public-facing applications such as Oddpost that were available more than three years ago.
InfoQ had an interesting article recently asking Is XML the Future of UI Development?. I believe that the author of the article is significantly underestimating the resourcefulness of JavaScript developers: The first up is AJAX, the poster child of the Web 2.0 craze.
At SXSW and AjaxWorld, I had the opportunity to talk about dojo.gfx and native web vector graphics in general. The amazing thing about these talks was the large number of attendees familiar with and interested in SVG, Canvas, and other native vector graphics formats.
[Note: This blog post is out of date. For up to date information on Dojo Offline please see the official web page.] Hi folks; lots of news on the Dojo Offline front.First, we have put up a screencast that shows a demo of Dojo Offline named Moxie.
[Note: This blog post is out of date. For up to date information on Dojo Offline please see the official web page.] We have posted up the default user-interface widget for Dojo Offline; this is all coded up now in JavaScript and is complete.
We’re pleased to announce that we’ve integrated Dojo’s Charting and Filtering Table widgets with Lightstreamer’s Comet server. A demo is available, as is the example source code to try it out yourself.
The Ajax Experience is this Monday October 23 through Wednesday October 25 in Boston. If it is anything like the one in San Francisco in May, it is going to be a great show.We are giving four talks at the conference.
“Mobile Ajax” is a code word for “snake oil” and the folks who claim it’s the future probably aren’t working with it.
Receive Our Latest Insights!
Sign up to receive our latest articles on JavaScript, TypeScript, and all things software development!