Dojo 2 Leverages JS Foundation Projects

By June 25, 2018Blog

Back in 2015 when we announced that the Dojo Foundation and jQuery Foundation would merge to form the basis for what would eventually become the JS Foundation, we were asked if this meant that the Dojo and jQuery projects were merging. The short answer was no; we do things quite differently, but that we did hope to collaborate wherever possible.

Fast forward a few years, and we’ve announced Dojo 2, the first major rewrite of Dojo in over ten years. Dojo today finds itself in a thriving ecosystem rather than in a world where each framework lived in a silo and needed to roll everything from scratch. Dojo 2 builds on the foundation of ES2015+ and TypeScript, and is focused on moving beyond building blocks and onto helping developers put all of it together.

In working on creating what we believe is an excellent developer experience for building modern web apps, at Dojo we were happy to be able to stand on the shoulders of other great JS Foundation projects for key Dojo features. This gave us a faster and more productive path to completing Dojo 2.

Key features of JS Foundation projects include:

  • PEP is a Polyfill, unifying pointer events across traditional input devices like a mouse and touch events from both mobile devices and touch screen computers. Dojo recommends using PEP whenever you need to target browsers without first-class native pointer events support.
  • Internationalization and localization are features that Dojo has supported for over a decade. While work is underway on ECMA 402 to standardize internationalization in browsers, efforts are still several years away from being finalized. Globalize offers a number of great features, starting with simple language bundle string replacements, but also includes features such as currency, date, number, time, unit and string pluralizations. Dojo 2 wraps Globalize with its @dojo/i18n package to provide a consistent API for Dojo 2 users.
  • webpack has become the defacto build system for the web today, and with Dojo we’ve been able to stop creating our own build system that we had for Dojo 1.x, and instead leverage webpack. Dojo 2 provides or leverages a number of webpack extensions to support features such as static feature analysis that is consistent during both build and runtime, dead code removal, elided imports, and i18n resource loading.
  • Intern is a powerful testing stack that provides Dojo 2 with support for unit, functional, and performance testing, code coverage analysis, and hooks into our continuous integration environment. Dojo 2 provides the @dojo/cli-test-intern package to ease the testing setup for Dojo 2 users, as well as the @dojo/test-extras package,which makes it easier to test Dojo 2 widgets in their virtual DOM environment.
  • Grunt is the original JavaScript task runner. Dojo 2 uses Grunt for some internal development workflows.

Beyond JS Foundation projects, Dojo 2 leverages a wide array of additional modern features and standards including Web Components (Custom Elements), Intersection Observers, Resize Observers, Web Animations, and more. Reference polyfills get leveraged for cross-browser compatibility of these modern features and Dojo 2 also leverages PostCSS to support CSS.Next features and CSS modules.

To learn more about the Dojo 2 release, view the Dojo 2 blog announcement. To get started using Dojo 2, visit the Dojo 2 tutorials.

dylans

Author dylans

More posts by dylans