Dojo Toolkit

Open-source modular JavaScript library

Dojo Toolkit (before version 2), Dojo (since version 2)

Developer(s)| Dojo Foundation
Initial release| March 2005; 20 years ago (2005-03)[1]
Stable release|

7.0.6 / January 20, 2021; 4 years ago (2021-01-20)[2]

Preview release|

8.0.0-beta.7 / April 27, 2021; 4 years ago (2021-04-27)[3]

Repository| Dojo Toolkit 1.x https://github.com/dojo/dojo
Dojo Framework 2+ https://github.com/dojo/framework
Written in| Dojo Tookit 1.x: JavaScript, Dojo >= 2.x: TypeScript[4]
Operating system| Cross-platform
Type| JavaScript toolkit (or library)
License| The modified BSD license or the Academic Free License (≥ 2.1)[5]
Website| https://dojotoolkit.org, https://dojo.io/

Dojo Toolkit (stylized as dōjō toolkit) is an open-source modular JavaScript library (or more specifically JavaScript toolkit) designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites. It was started by Alex Russell, Dylan Schiemann, David Schontzler, and others in 2004[1] and is dual-licensed under the modified BSD license or the Academic Free License (≥ 2.1).[5]

The Dojo Foundation was a non-profit organization created with the goal to promote the adoption of the toolkit. In 2016, the foundation merged with jQuery Foundation to become JS Foundation.[6][7][8]

## Overview

[edit]

Dojo is a JavaScript framework targeting the many needs of large-scale client-side web development. For example, Dojo abstracts the differences among diverse browsers to provide APIs that will work on all of them (it can even run on the server under Node.js); it establishes a framework for defining modules of code and managing their interdependencies; it provides build tools for optimizing JavaScript and CSS, generating documentation, and unit testing; it supports internationalization, localization, and accessibility; and it provides a rich suite of commonly needed utility classes and user-interface widgets.[citation needed]

Dojo is completely open source. The toolkit includes about three thousand JavaScript modules, in addition to images and other resources.[citation needed]

The Dojo Toolkit is organized in several parts:

* dojo contains the core and most non-visual modules.
* dijit is a library of user-interface modules for widgets and layout.
* dojox holds assorted modules not yet considered stable enough to include in dojo or dijit.
* util includes build tools such as optimization, documentation, style-checking, and testing.

## Features

[edit]

This section needs additional citations for verification. Please help improve this article by adding citations to reliable sources in this section. Unsourced material may be challenged and removed. (April 2023) (Learn how and when to remove this message)

|

### Widgets

[edit]

Dojo widgets are components — comprising JavaScript code, HTML markup, and CSS style declarations — that provide multi-browser (not to be confused with cross-browser), interactive features:

* Menus, tabs, and tooltips
* Sortable tables
* Dynamic charts
* 2D vector drawings
* Animated effects--fades, wipes and slides--facilities for custom animation effects

### Asynchronous communication

[edit]

One important feature of Ajax applications is asynchronous communication of the browser with the server: information is exchanged and the page's presentation is updated without a need for reloading the whole page. Traditionally, this is done with the JavaScript object XMLHttpRequest. Dojo provides an abstracted wrapper (`dojo.xhr`) around various web browsers' implementations of XMLHttpRequest, and `dojo.io` also supports other transports (such as hidden IFrames) and a variety of data formats. Using this approach, it is easy to have the data a user enters into a form sent to the server "behind the scenes"; the server can then reply with some JavaScript code that updates the presentation of the page.[9]

### Packaging system

[edit]

Dojo provides a packaging system to facilitate modular development of functionality in individual packages and sub-packages; the base Dojo "bootstrap" script initializes a set of hierarchical package namespaces — "io", "event", etc. — under a root "dojo" namespace. After initialization of the root namespace, any Dojo package can be loaded (via XMLHttpRequest or other similar transport) by using utility functions supplied in the bootstrap. It is also possible to initialize additional namespaces within or parallel to the "dojo" namespace, allowing extensions of Dojo or the development of private Dojo-managed namespaces for third-party libraries and applications. [citation needed]

Dojo packages can consist of multiple files and can specify which files constitute the entire package. Any package or file can also specify a dependency on other packages or files; when the package is loaded, any dependencies it specifies will also be loaded.[citation needed]

Workarounds for cross-domain loading of most Dojo packages are provided (though this requires a specialized build of Dojo).

Dojo also provides a mechanism for building "profiles"; the build system takes as input a list of packages, and uses Rhino to create a single compressed JavaScript file containing those packages and all their dependencies. This allows all necessary code to be loaded and initialized at once, and permits caching of the code (most web browsers do not cache files loaded via XMLHttpRequest[citation needed]). Pre-built profiles for some common use cases are available for download from the same location as the full toolkit.

### Client-side data storage

[edit]

Dojo has support functions for reading and writing cookies. It also previously supported a local, client-side storage abstraction named Dojo Storage.

Dojo Storage allows web applications to store data on the client-side, persistently and securely and with a user's permission. When included in a web page, Dojo Storage determines the best method for persistently storing information. It works across existing web browsers, including Internet Explorer, Firefox, and Safari. Firefox 2 uses native browser persistence; on other browsers, it uses a hidden Flash applet. With Flash 6+ have previously been installed on about 95% of computers connected to the web,[10] this previously made the storage mechanism accessible for much of the web's installed base. For a web application loaded from the file system, i.e., from a file:// URL, Dojo Storage will transparently use XPCOM on Firefox and ActiveX on Internet Explorer to persist information. The programmer using Dojo Storage is abstracted from the storage mechanism used and is presented with a simple hash table abstraction, with methods such as put() and get(). Dojo Storage is not supported in versions later than the 1.3 release.[citation needed]

### Server-side data storage

[edit]

As of January 2007, Dojo includes the following example server-side datastore implementations in the dojo.data namespace:[11]

* CsvStore: a read-only store that reads tabular data from comma-separated values files
* OpmlStore: a read-only store that reads hierarchical data from OPML format files
* YahooStore: a read-only store that fetches search results from the Yahoo! Search web service
* DeliciousStore: a read-only store that fetches bookmarks from the del.icio.us web service
* RdfStore: a read-write store that uses SPARQL to talk to RDF data servers including, for example, the Rhizome RDF application server.

### Support for Adobe Integrated Runtime (AIR)

[edit]

Dojo can be used in JavaScript-based Adobe AIR applications. It has been modified to meet AIR's security requirements.

SitePen, a Dojo consulting company, has made an Adobe AIR application called "Dojo Toolbox" using Dojo. It includes an API viewer and a GUI to Dojo's build system. Normally, the build system is run from within Rhino, but in this AIR application the build system can be run from AIR, without the use of Java.[12]

## Criticisms

[edit]

### Loading

[edit]

Earlier versions of Dojo had a reputation for being bulky and slow to load.[13] It also required extra work to load Dojo across domains, e.g., from a CDN. Addressing these problems was the major goal of Dojo 1.7, which introduced asynchronous module definition (AMD) and a "nano" loader.[14]

### Documentation

[edit]

Dojo has long been criticized for its incomplete, scattered, and outdated documentation. Recognizing this, the developers made huge improvements in the documentation for the 1.8 release, including new tutorials, an API browser, filling in the missing pieces, and updating most examples to AMD style.[15][16]

A number of books have been written about Dojo, but all based upon Dojo 1.3 or earlier, now several years out of date. Since these predate AMD support and its accompanying reorganization, examples in these books almost invariably rely on things that are now deprecated and no longer best practice. Most authors are waiting for Dojo 2.0 before publishing anything new. [17]

### Learning curve

[edit]

Many have commented that Dojo seems difficult to learn and get started with, especially in comparison with the more popular jQuery.[18][19]

Dojo co-creator Dylan Schiemann acknowledges this as a consequence of their different scopes: "It's certainly easier to learn something that's smaller than something that does more, but our avid users are quick to point out that a bit more learning up front saves them countless hours for things that Dojo makes easy."[13]

### API stability

[edit]

Early users faced a difficult transition to the 1.0 release after the toolkit was totally rewritten.[16] The move to AMD in recent versions has been similarly problematic.[19] Dojo has taken great pains to maintain backward compatibility despite its rapid evolution, with a large portion of the current API deprecated but still maintained, but users have often found that upgrades did not go as smoothly as hoped.

Dojo 2.0 release removed much of the deprecated API and switched from JavaScript to TypeScript.

## See also

[edit]

* Free and open-source software portal

* Comparison of JavaScript frameworks
* JavaScript framework
* JavaScript library

## References

[edit]

1. ^ a b "A Brief History of Dojo — The Dojo Toolkit - Reference Guide". dojotoolkit.org. Retrieved January 16, 2024.
2. ^ "Dojo Blog". dojo.io. Retrieved January 16, 2024.
3. ^ "Release v8.0.0-beta.3 · dojo/framework · GitHub". github.com. March 2, 2021. Retrieved March 10, 2021.
4. ^ "Samples · TypeScript". Archived from the original on March 27, 2016.
5. ^ a b "Dojo Toolkit License". Dojo Toolkit. Retrieved April 17, 2017.
6. ^ "jQuery Foundation and Dojo Foundation to Merge". Official jQuery Blog. September 1, 2015. Retrieved July 2, 2018.
7. ^ "jQuery Foundation and Dojo Foundation to Merge". PRWeb. July 1, 2015. Retrieved July 2, 2018.
8. ^ "Announcing the JS Foundation!". SitePen. October 17, 2016. Retrieved July 2, 2018.
9. ^ "What is Asynchronous JavaScript and XML (AJAX)?". TheServerSide.com. Retrieved July 4, 2023.
10. ^ "Adobe Flash Player Version Penetration". Adobe website.
11. ^ "Dojo Data". January 11, 2007. Archived from the original on February 13, 2007. Retrieved February 3, 2007.
12. ^ "Development and JavaScript Blog".
13. ^ a b "An Interview with Dojo Toolkit Creator Dylan Schiemann". Nettuts+. August 16, 2012. Retrieved November 21, 2012.
14. ^ "Dojo 1.7 Released!". Dojo Toolkit Blog. January 1, 2011. Retrieved November 21, 2012.
15. ^ "What's coming in Dojo 1.8". Dojo Toolkit Blog. February 9, 2012. Retrieved November 21, 2012.
16. ^ a b "what is the raison detre for dojo 2.0". dojo-contributors. October 11, 2012. Retrieved November 29, 2012.Archived 2017-12-01 at the Wayback Machine
17. ^ Schiemann, Dylan (April 30, 2012). "jQuery and the long term viability of Dojo". Dojo-interest. Archived from the original on October 29, 2014. Retrieved November 29, 2012.
18. ^ "Criticism of Dojo?". Seven Foot Tall Cactus. August 17, 2012. Archived from the original on October 26, 2012. Retrieved November 21, 2012.
19. ^ a b "Dojo or JQuery". NotADojoGuru. April 6, 2012. Retrieved November 21, 2012.

## Further reading

[edit]

* Orchard, Leslie M. (November 24, 2008). Concise Guide to Dojo (1st ed.). Wrox Press. p. 264\. ISBN 978-0-470-45202-8.
* Russell, Matthew A. (June 24, 2008). Dojo: The Definitive Guide (1st ed.). O'Reilly Media. p. 500\. ISBN 978-0-596-51648-2.
* Riecke, Craig; Gill, Rawld; Russell, Alex (June 18, 2008). Mastering Dojo: JavaScript and Ajax Tools for Great Web Experiences (1st ed.). Pragmatic Bookshelf. p. 568\. ISBN 978-1-934356-11-1.
* Holzner, Steven (December 14, 2008). The Dojo Toolkit: Visual QuickStart Guide (1st ed.). Peachpit Press. p. 208\. ISBN 978-0-321-60512-2.
* Zammetti, Frank (September 19, 2008). Practical Dojo Projects (1st ed.). Apress. p. 500\. ISBN 978-1-4302-1066-5.
* Hayes, Kyle (November 17, 2009). Getting StartED with Dojo JavaScript Toolkit (1st ed.). Friends of Ed. p. 350\. ISBN 978-1-4302-2521-8. Archived from the original on April 22, 2010. Retrieved August 15, 2009.
* Svensson, Peter (November 24, 2008). Learning Dojo (1st ed.). Packt Publishing. p. 264\. ISBN 978-1-84719-268-4.
* Harmon, James E. (June 21, 2008). Dojo: Using the Dojo JavaScript Library to Build Ajax Applications (1st ed.). Addison-Wesley Professional. p. 336\. ISBN 978-0-13-235804-0.
* Orchard, Leslie M.; Pehlivanian, Ara; Koon, Scott; Jones, Harley (August 31, 2009). Professional JavaScript Frameworks: Prototype,YUI, ExtJS, Dojo and MooTools (1st ed.). Wrox Press. p. 888\. ISBN 978-0-470-38459-6. Archived from the original on July 6, 2011. Retrieved August 15, 2009.

## External links

[edit]

* Dojo toolkit website

* v
* t
* e

ECMAScript

Dialects|

* ActionScript
* Haxe
* Caja
* JavaScript
* engines
* asm.js
* JScript
* JScript .NET
* QtScript
* TypeScript
* WMLScript

Engines
(list)|

* Carakan
* Futhark
* InScript
* JavaScriptCore
* JScript
* KJS
* Linear B
* QtScript
* Rhino
* SpiderMonkey
* TraceMonkey
* JägerMonkey
* Tamarin
* V8
* ChakraCore
* Chakra
* JScript .NET
* Nashorn

Frameworks|

| Client-side|

* Dojo
* Echo
* Ext JS
* Google Web Toolkit
* jQuery
* Lively Kernel
* midori
* MochiKit
* MooTools
* Prototype
* Pyjs
* qooxdoo
*   * SproutCore
* Spry
* Wakanda Framework

|

Server-side|

* Node.js
* Deno
* Bun
* Jaxer
* AppJet
* WakandaDB

Multiple|

* Cappuccino

Libraries|

* Backbone.js
* SWFObject
* Underscore.js

People|

* Brendan Eich
* Douglas Crockford
* John Resig
* Scott Isaacs

Other|

* DHTML
* Ecma International
* JSDoc
* JSGI
* JSHint
* JSLint
* JSON
* JSSS
* Sputnik
* SunSpider
* Asynchronous module definition
* CommonJS

Lists: JavaScript libraries • Ajax frameworks • Server-side JavaScript
Comparison: JavaScript web frameworks

* v
* t
* e

Web frameworks

* Comparison

.NET|

* ASP.NET
* Core
* AJAX
* Dynamic Data
* MVC
* Razor
* Web Forms
* Blazor
* DNN
* BFC
* MonoRail
* Umbraco
* WebSharper

C++|

* CppCMS
* Drogon
* Wt

ColdFusion|

* ColdBox Platform

Common Lisp|

* CL-HTTP

Haskell|

* Servant
* Snap
* Yesod

Java|

* AppFuse
* Grails
* GWT
* ICEfaces
* JHipster
* JWt
* Mojarra
* Play
* Remote Application Platform
* Seam
* Sling
* Spring
* Stripes
* Struts
* Tapestry
* Vaadin
* Vert.x
* Wicket
* WaveMaker
* ZK

JavaScript|

* Angular/AngularJS
* Backbone.js
* Closure
* Dojo Toolkit
* Ember.js
* Express.js
* Ext JS
* Fastify
* htmx
* jQuery
* Knockout.js
* Meteor
* MooTools
* NestJS
* Next.js
* Nuxt.js
* Node.js
* OpenUI5
* Prototype
* React
* Remix
* Sencha Touch
* SproutCore
* Svelte
* Vue.js

Perl|

* Catalyst
* Dancer
* Maypole
* Mojolicious
* WebGUI

PHP|

* CakePHP
* CodeIgniter
* Drupal
* eZ Publish
* Fat-Free
* Flow
* FuelPHP
* Grav
* Gyroscope
* Horde
* Joomla!
* Laminas
* Laravel
* li₃
* Midgard
* MODX
* Phalcon
* PHP-Fusion
* PHP-Nuke
* Pop PHP
* PRADO
* ProcessWire
* Qcodo
* Silverstripe
* Symfony
* TYPO3
* WordPress
* XOOPS
* Yii

Python|

* BlueBream
* CherryPy
* CubicWeb
* Django
* FastAPI
* Flask
* Grok
* Nevow
* Pyjs
* Pylons
* Pyramid
* Quixote
* Tornado
* TurboGears
* web2py
* Zope 2
* more...

Ruby|

* Merb
* Padrino
* Ruby on Rails
* Sinatra

Rust|

* Rocket

Scala|

* Lift
* Play
* Scalatra

Smalltalk|

* AIDA/Web
* Seaside

Other languages|

* Application Express (PL/SQL)
* Grails (Groovy)
* OpenACS (Tcl)
* Phoenix (Elixir)
* Shiny (web framework) (R)
* SproutCore (JavaScript-Ruby)
* Yaws (Erlang)

* v
* t
* e

List of widget toolkits

Low-level platform-specific

On AmigaOS|

* Intuition

On Classic Mac OS, macOS|

* Macintosh Toolbox
* Carbon

On Windows|

* Windows API
* UWP
* WinRT

On Unix,
under X11|

* Xlib
* XCB
* X Toolkit Intrinsics

On BeOS, Haiku|

* BeOS API

On Android|

| CLI|

* Xamarin.Android

|

Low Level Cross-platform

CLI|

* OpenTK

* GDK
* Simple DirectMedia Layer

Java|

* JOGL
* LWJGL

High-level, platform-specific

On AmigaOS|

* BOOPSI
* MUI
* ReAction GUI
* Zune

On Classic Mac OS, macOS|

| Object Pascal|

* MacApp

|

Objective-C, Swift|

* Cocoa
* Cocoa Touch

C++|

* MacApp
* PowerPlant
* THINK C

CLI|

* Xamarin.Mac
* Xamarin.iOS

On Windows|

| CLI|

* Windows Forms
* XAML
* Windows Presentation Foundation
* Windows UI Library
* Silverlight
* Microsoft XNA

|

C++|

* MFC
* Active Template Library
* Windows Template Library
* Object Windows Library

Object Pascal|

* Visual Component Library

On Unix,
under X11|

* Athena (Xaw)
* LessTif
* Motif
* OLIT
* XForms
* XView

On Android|

* Qt for Android

High-level, cross-platform

* Enlightenment Foundation Libraries
* GTK
* IUP
* XForms
* XVT

C++|

* Bedrock
* CEGUI
* Component Library for Cross Platform
* FLTK
* FOX toolkit
* OpenGL User Interface Library
* gtkmm
* JUCE
* Qt
* Rogue Wave Views
* TnFOX
* U++
* Wt
* wxWidgets
* Simple and Fast Multimedia Library

Objective-C|

* GNUstep

CLI|

* Gtk#
* Tao Framework
* OpenTK
* UIML
* MonoGame
* Moonlight
* Xamarin.Forms
* XWT[1][2]
* .NET MAUI

Adobe Flash|

* Apache Flex
* MXML

Go|

* Fyne

Haskell|

* wxHaskell

Java|

* Abstract Window Toolkit
* FXML
* JavaFX
* Qt Jambi
* Swing
* Standard Widget Toolkit
* Google Web Toolkit
* Lightweight User Interface Toolkit

JavaScript|

* Dojo Toolkit
* Echo
* Ext JS
* Google Closure Tools
* jQuery UI
* OpenUI5
* Qooxdoo
* YUI

Common Lisp|

* CAPI
* CLIM
* Common Graphics

Lua|

* IUP

Pascal|

* Lazarus Component Library

Object Pascal|

* Component Library for Cross Platform
* fpGUI
* IP Pascal
* FireMonkey

Perl|

* Perl/Tk
* wxPerl

PHP|

* PHP-GTK
* wxPHP

Python|

* Tkinter
* Kivy
* PySide
* PyQt
* PyGTK
* wxPython
* Pyjs

Ruby|

* Shoes
* QtRuby

Tcl|

* Tcl/Tk

XML|

* GladeXML
* Lively Kernel
* Extensible Application Markup Language
* XUL
* Wt

shell|

* Newt
* CDK
* Dialog

Dart|

* Flutter

Authority control databases

International|

* VIAF

National|

* Germany
* United States

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template