Twig is dead. Long live Web Components!

Speakers: 

Click here to watch Twig is dead. Long live Web Components!

<hyperbole-alert> Everyone is excited about Drupal 8’s Twig system, but it's already dead to me.</hyperbole-alert> The W3C is working on a specification for a templating system that is native to the HTML language, called Web Components.

With web components, we’ll be able to define and instantiate our own templates from within HTML. We can even create our own custom elements. Best of all, with the Shadow DOM, our templates encapsulate styling (CSS) and behavior (JS) within them, eliminating conflicts and easing integration of multiple building blocks.

There is so much awesome in the Web Components spec, but switching to it will make switching to HTML5 look like a cake walk. There is a lot to do! (And the spec is still unfinished!)

Will Web Components be ready to use for Drupal 9? (dunno.) Will we be ready to use them? (you bet!)

But we have to start planning now and start evolving our current codebase (including Twig) to make the transition easier. By building component-like bundles of CSS, Twig templates, and JavaScript into Drupal 8 (and 9), we can bring the core concepts of Web Components into Drupal right now!

In this session, I'll give a brief demo of Web Components and the Shadow DOM, discuss the benefits, and then we can hash out a plan of attack.

Schedule info
Experience level: 
Advanced
Drupal Version: 
Drupal 9.x
Time slot: 
Thursday · 01:00-02:00
Room: 
15 - Commerce Guys | 4th floor

Comments

JohnAlbin’s picture

I wanted this session to be a conversation, so we didn't line up next the mic and take turns; we just talked and ignore the mic. It was important to have this kind of dynamic conversation, but I apologize to those who weren't able to attend and were hoping to watch the video. I promise to write this up as a blog post.

In the meantime, Brian Krall wrote up his notes here: https://www.evernote.com/shard/s409/sh/d01115df-20b2-4ec3-b566-90abf38e4... Thanks, Brian!

JohnAlbin’s picture

I realized the slides would be less useful than me just pasting the resources links into this comment, so… here you go!