Falling for Web Components

Tyler Garlick
Tyler Garlick
Published in
3 min readSep 1, 2016

The first day I saw Polymer, I LOVED IT! It just felt right, kinda like when you hand fits nicely in theirs. The code was concise, neatly groomed. For years, I was in lust with Angular and loved how she disrupted the SPA space. Polymer, made me forget about Angular, and I never really looked back.

What was it about Polymer that captivated me? ABSTRACTION. How nice was it that I could include a file at the top of my page and have a new custom tag. <google-map> that provided a succinct interface peeling away the complexity of Google’s map API.

<!-- Polyfill Web Components support for older browsers -->
<script src="components/webcomponentsjs/webcomponents-lite.min.js"></script>

<!-- Import element -->
<link rel="import" href="components/google-map/google-map.html">

<!-- Use element -->
<google-map latitude="37.790" longitude="-122.390"></google-map>

This is what I was looking for, the HTML abstraction that got out of the way. Behind the scenes it loaded JS, HTML, CSS so I could focus on the task at hand. Composing new reusable components was easy. No weird directive syntax like Angular. Plus, she played nice with everyone…. on the hotness scale she is that unicorn.

When you start building components the CLI generates a HTML page that allows you to visualize your API, a demo page, and testing baked right in. Wow! I could share my element with the world and it would do a lot of that hard lifting for me.

At first, I was tempted to bring Angular along with me because my new Polymer friend didn’t seem to provide things like routing, controllers, etc. it was then I realized I didn’t need to because you could use existing frameworks or a web component that did that for you. I almost cried as I looked at Polymer in the eyes, your my soulmate.

Just like a normal relationship we got out of the honeymoon stage and the community that was also in love with Polymer worked hard to release 1.0, but then seemed disinterested in her. I was forced to start looking elsewhere because I was superficial and wanted validation from my friends that my new love was the hot sexy one that I knew she was.

I started dating other frameworks like React. Don’t get me wrong they were nice, but Polymer just seemed to get me. I also thought more like she did. I missed her.

It was during Google’s I/O 2016 that it all made sense. Polymer was still being worked on, and then community was there. It was just being incorporated into Google’s product offering. They used her in almost all new products. I was blown away at how the tooling has matured.

I saw this from the beginning, the web component specification was going to rock the world. It definitely has! Only one piece left on Mozilla’s a Firefox and web components would be native, no more poly fills. Yay!

Sometimes love is hard, but it does make one appreciate all the things Polymer does for us. Hopefully, you can see how to love her too.

--

--