Snippets

Drupal 8 contextual links are locally cached in sessionStorage

I ran into a seriously confusing issue with a project that I’m learning the internals of Drupal 8 for: custom contextual links were not reliably appearing or even disappearing after removing them from code, and the only thing that seemed to work was to fully uninstall and reinstall the custom module, which was far from ideal. Turns out that Drupal caches contextual link markup in sessionStorage, which is why clearing Drupal’s own cache had no effect like you would expect. The easiest way of handling this is running window.sessionStorage.clear(); in your browser’s developer console. Alternate solutions include opening the page in a new tab will cause a re-download of the contextual links (due to how sessionStorage works), or opening up your browser’s developer tools and deleting the sessionStorage entries for the entities or other identifiers - for a block it would be Drupal.contextual.block.*, while for a node it would be Drupal.contextual.node.*.

What Web Can Do Today

Ever get annoyed by people who tell you the web will never compare to native apps and wish you could send them a comprehensive slap in website form? If so, this is pretty awesome. Not only does it list a lot of things there are modern web APIs for, it also displays whether your current browser supports each one.

Box Alignment Cheatsheet by Rachel Andrew

The box alignment specification details how items are aligned in the various layout methods. As different layout methods pose different constraints in terms of alignment, some of the behaviour of Box Alignment is layout method dependent. This cheatsheet compares alignment in CSS Grid Layout and Flexbox.