Vanilla JS*


A practical guide to understanding when Vanilla JS is enough and when it is not.

* Talking about fanatically ripping out libraries and replacing them with obtuse JS code is not productive. Websites like are interesting but flawed and misguiding. What would be productive is to make sure of:

  1. the need for a particular piece of code,
  2. correct and consistent use of libraries,
  3. identifying the subset of features used from libraries,

only then can we talk about using Vanilla JS instead of popular libraries.

Browsers APIs grew up, developers need to acknowledge it and make use of them — when appropriate. If we don't, browsers will stop caring and we're all going to have a bad time. This session will review common Drupal JS patterns found in core, contrib and projects and how they can be simplified (for some definition of simplified), pointing out frequent library abuse on the way.

The topic of micro libraries will come up and I'll bring up the topic of hybrid approaches for all of us lazy programmers. We'll talk about where and how to draw the line for using a particular solution (this is a cue for the IE8 talk). Drupal 8 code will be taken as an example.

The key concerns throughout the session are performance and maintainability. Unlike fanatics, I want you to be able to use what you learned knowing all the pros and cons. When you decide it's the right thing for you to use, you can trust your choice is the right one in your situation.

The future is now! (for some definition of now)

Schedule info
Core Conversations
Experience level: 
Drupal Version: 
Time slot: 
Thursday · 14:15-15:15
G107 · Pantheon