We just mentioned X-Tag as a way to get some Web Components goodness. Another approach is to get your HTML grove on with a view-centric framework such as AngularJS, which just hit 1.0 with its feature flushed out:
- HTML as the template. You, your browser, your editors and your other tools already know all about working with HTML. Why introduce something else? AngularJS lets you expand HTML’s vocabulary with your own app-specific elements, attributes, and class-types that are fully compatible with the HTML specification.
- Reusable components — in HTML! AngularJS gives you the power to extend HTML’s syntax with your own elements, attributes that adds behavior or transforms the DOM. Want to write
<div><div><div>...? Want to attach keyboard shortcuts to any element by adding an attribute like
key=’ctrl-s’? You miss the
<blink>tag? All these things and more are possible.
- Views and Routes. AngularJS lets you switch sub-views in your app with a simple route configuration. And you get URL deep-linking for free.
- Tests and Testability. Shipping apps means testing them. We provide common mocks, we take full advantage of dependency injection, and we encourage MVC structure making it easy to test behavior separate from view. It also comes with an end-to-end scenario runner which eliminates test flakiness by having the runner truly understand application state.
Angular is a Google-production, and I would love to know if Misko created it from his Doubleclick work (or if it came from something else).
It is interesting to know that various Google projects use internal frameworks Closure, GWT, Angular and maybe Dart? they also use external projects (jQuery etc) and who knows what else. Kinda feels like the server side (Java, Go, Python, C++, …).
If you are someone who wishes they got to spend more time in the HTML view, and less time in JS code, give AngularJS a looksie.