I was thinking this morning about +Web Components
. I think web components are awesome and I'm super excited about them. (Thanks +Dimitri Glazkov +Alex Russell
and everyone I don't even know about who made this a thing)
First, some background (stay with me):
When you're building large scale applications for the web, one concern that comes up is how to release your code into production. That includes things like combining scripts, minifying them, picking a module loader, and dependency management tool, and the list goes on. All of this comes with a huge amount of complexity when you have a large number of teams, and can't dictate which tools to use.
For Polymer, a tool called Vulcanize walks the dependency graph of your app and does all of the optimization for you. This way you don't have a huge amount of network requests for each HTML import and every separate script file for every web component in your app.
Back to my ah ha moment this morning ...
With the advent of HTTP2, all of this hoop jumping doesn't matter as much. We don't need to try as hard to avoid lots of network requests. In a HTTP2 world, we can write web components the right way and it will just be efficient on the wire.
Well, what about older clients that aren't HTTP2? Here's the beautiful thing. Since the dependency graph is now specified with HTML tags (HTML imports and script tags) it's possible to have a server side bit of code to walk the graph, and do all of the "best practices" for a HTTP1x world. Then I realized, that would basically be putting the vulcanize tool into Page Speed Service (mod_pagespeed etc) so it happens automatically and transparently for older clients. Best of all, no extra work for devs.
So, I ask, if this isn't already planned, please make it happen.