Despite having access to advanced JavaScript frameworks, many web developers continue to write very similar boilerplate code to setup AJAX interactions. Facebook, in particular, peaked at nearly one megabyte of JavaScript on its homepage. The team then realized that 90% of our interactions could be boiled down into a very small set of steps: (1) User clicks on a link or submits a form, (2) an...
[read more]
Despite having access to advanced JavaScript frameworks, many web developers continue to write very similar boilerplate code to setup AJAX interactions. Facebook, in particular, peaked at nearly one megabyte of JavaScript on its homepage. The team then realized that 90% of our interactions could be boiled down into a very small set of steps: (1) User clicks on a link or submits a form, (2) an AJAX request is sent to the server, (3) some markup is put into the DOM.
By framing nearly all interactions in this manner, we have been able to put a small snippet of JavaScript, Primer, at the top of all pages that can listen to and wire up these interactions. Built atop plain links and forms, we have created a simple, fast, accessible way to implement most interactions on our site.
In conjunction with a few other systems, Haste for packaging and dependency management, and Bootloader for on-demand loading of static resources, Primer has changed the way we write JavaScript for the better.
Come hear Tom Occhino and Makinde Adeagbo speak about Primer, Haste, and Bootloader on Tuesday, August 3rd @ 7-9pm
Can't make this one?
We’ll be streaming the tech talk live from the ‘Facebook Live’ tab at 7pm! We invite you to ask questions via the ‘Ask A Question’ button (you can do so both in advance and during the Tech Talk).
NOTE: Due to limited space all +1s must have their name on the list. Please either comment on the wall with their name or have them request an invite on the event.