Aller au contenu principal

← All talks

Vanilla JS*

DrupalCon Amsterdam, 2014

How far can Drupal go without jQuery? Some Drupal 8 core scripts are already vanilla JS (active-link.js, announce.js, drupal.js), with polyfills for classList and matchMedia. Vanilla JS still falls short on event and AJAX handling.

Micro libraries cover that, with duplication and uneven quality, so I propose a hybrid: a custom jQuery build with only the parts that we use, the "franken-jQuery" of #1541860. The full build is 29.1 KB minified and gzipped, events and AJAX together are 10.4 KB. Plus the ES5 and DOM APIs that you can use today, since mobile-first is vanilla-first.

Event

DrupalCon

City

Amsterdam

Language

English

Slides

Document
vanilla-js.pdf (2.52 Mo)

Companion code

Related