This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PULPPULPFICTIONFICTION
Théodore 'nod_' BIADALA
Core JS maintainerTechnical consultant at Acquia
PULPPULPFICTIONFICTION
Théodore 'nod_' BIADALA
Core JS maintainerTechnical consultant at Acquia
Drupal Dev Days SZEGED 2014
PULPPULPFICTIONFICTION
Frontend developers&
Drupal's theme layer
HTML/CSS dev
JS dev
Don't you remove 'views-group-title' class
Custom HTML?
Divitis
Classitis
It's not that bad for the JS developer
Use data- attributes for everything JS$('[data-drupal-progress]').once('butch');
// JS
var $el = $(context).find('#mydiv');
var $el = context.querySelector('[data-mydiv]');
// PHP
$element['#attributes']['data-mydiv'] = TRUE;
// HTML
<div data-mydiv class='whatever themers want'>
TWIG
Drupal 8 frontend
The gold feature
Frontend testing,it's been well hidden
JS Patching
Core team is scared of frontend getting broken all the time.
Help.
The overlay situation
Overlay module
Look!I wrote 10 lines of JS!
Oups.
Bojhan'sUX napkin
Angry user
meh. Good coffee though
Follow UX core gateand I'll commit your patch
UX Team
They solve problems
Cue months of UX testing
And some clean-up
Tests went well, all wrapped up for commit
Overlay, 'Like it never happened'
Coffee issessionStorage
// escapeAdmin.js
var winLoc = window.location;var store = sessionStorage;var pathInfo = drupalSettings.path;var isAdminPath = pathInfo.currentPathIsAdmin;var dest = /destination=/.test(winLoc.search);
var adminPath = store.getItem('escapeAdminPath');
if (!isAdminPath && !destination) { store.setItem('escapeAdminPath', winLoc);}