The Web Components project, led largely by the Google Chrome development team, aims to help solve a simple problem: Building Web applications is more complicated than it used to be. Worse, it's more complicated than it should be.
[ Delve into HTML5 programming with InfoWorld's "HTML5 Megaguide Deep Dive" PDF how-to report. Then understand the issues surrounding HTML5 today in InfoWorld's HTML5 Deep Dive PDF strategy report. | Keep up on key application development insights with the Fatal Exception blog and Developer World newsletter. ]
"That's actually a regression," says Google's Alex Russell. "We've regressed from how we'd like to be building apps. And it's worth acknowledging that we have failed, and that we would like to do better."
The components of Web Components
That's where Web Components come in. The project is composed of a group of technologies aimed at making it possible to create rich Web UIs using ordinary CSS and markup. They do this by allowing toolkit makers to encapsulate their widgets and UI elements as easily reusable components.
At the core of this idea is a new HTML element called a Template, which contains markup that gets inserted into the DOM but not displayed. Once it's in the DOM, you can activate a Template as many times as you want to make as many visible copies as you need -- like creating objects from a class.
What is a Template good for? For one thing, it can be used to create a Decorator: a complex package of styles that you apply to an element using CSS. It's much more powerful than plain CSS because in addition to modifying CSS attributes, it can insert blocks of markup and even script.