Future of javascript in Drupal 8

nod_'s picture

In an effort to make JS performance and management better, I've made a few propositions about the way Drupal deals with javascript.

  • Use AMD for JS architecture, introducing a standard way to deal with javascript modules. There is a sandbox with working code to try out.
  • Remove dependency on jQuery, this is the logical follow-up to the current clean-up of core JS. An in-depth review of all our JS files aiming at significantly reducing the amount of JS needed on every page, as well as improving performance.
  • Use JS events instead of Drupal.behaviors, an effort to un-PHP our javascript and make it more understandable to regular JS developers.

This effort is loosely coupled with the mobile initiative. Making our JS faster to load and execute is critical for mobile connections and devices.

The future should be based on a solid foundation, please help review the JavaScript clean-up queue!