<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tom Varughese</title>
    <description>The latest articles on DEV Community by Tom Varughese (@tom_var).</description>
    <link>https://dev.to/tom_var</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F333037%2Fc1f2098b-a064-4664-89cb-5d615ade74eb.png</url>
      <title>DEV Community: Tom Varughese</title>
      <link>https://dev.to/tom_var</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tom_var"/>
    <language>en</language>
    <item>
      <title>Wait, Pause: Web Components</title>
      <dc:creator>Tom Varughese</dc:creator>
      <pubDate>Fri, 02 Apr 2021 16:44:29 +0000</pubDate>
      <link>https://dev.to/tom_var/wait-pause-web-components-44b3</link>
      <guid>https://dev.to/tom_var/wait-pause-web-components-44b3</guid>
      <description>&lt;h1&gt;
  
  
  Some Background:
&lt;/h1&gt;

&lt;p&gt;I’ve been working with web components a lot the past year. Mostly meeting and talking about specs, new components, best practices with a bunch of developers at work. I had a feeling that the concept seemed really familiar to me, but it was hard to put something to it, until I was asked a random question from a friend: Which is your favorite power ranger series?&lt;/p&gt;

&lt;p&gt;I was a little taken back at this question because there was no related context in the convo we were having. But it was almost like that question was a key that unlocked this mystical box from my childhood and then it all started flooding back to me. We talked for an hour or more about the different series, what we remember and then something else hit me.&lt;/p&gt;

&lt;p&gt;One of my big tech passion projects I help contribute to is &lt;a href="http://haxtheweb.org/"&gt;HAX&lt;/a&gt;, the &lt;a href="https://www.youtube.com/channel/UCgcFR9ojBu9P7VNQjt0nqbA"&gt;Headless Authoring eXperience&lt;/a&gt; made out of web components. Everyone makes the comparison that Web Components are like legos. While I do agree, I think we can do one better. Web Components are Super Sentai. The end. Thanks for coming to my TED Talk.&lt;/p&gt;

&lt;h1&gt;
  
  
  Wait, pause. What is a “Super Sentai”?
&lt;/h1&gt;

&lt;p&gt;Super Sentai is a superhero genre or metaseries that come from the combination of 2 words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Super (/ ˈsü-pər /):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;High Grade or quality or &lt;/li&gt;
&lt;li&gt;large or powerful &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Sentai(戦隊)&lt;/strong&gt;: Japanese for squadron, taskforce&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The term might not be familiar to you, but you have seen its shows. Power Rangers or Sailor Moon ring a bell? Well for this imma stick with Power Ranger examples, but the ideas can also translate to Sailor Moon as well.&lt;/p&gt;

&lt;p&gt;The reason why I dont like the lego comparison is because you can't do anything with a single lego brick, you need a bunch of them. A single Power Ranger is bad-ass and can handle their own.&lt;/p&gt;

&lt;p&gt;Like a web component, there are key aspects that help define what a Power Ranger is. &lt;/p&gt;

&lt;h1&gt;
  
  
  HTML Template and Custom Elements:
&lt;/h1&gt;

&lt;p&gt;These two are intertwined, so I'll talk about them in the same section.  allows us to store some markup and styling of the component, that we can later clone, reuse, etc. You gotta use slots to make a placeholder since elements render in the shadow root. This would be akin to morphers and the morphing grid. Do power Rangers just walk down the street and buy groceries (when we were allowed to do that)? No. They are people who morph into rangers when the time occurs. But what good is a morpher if you don't have a power ranger who can use it. That’s where Custom Elements come in. &lt;/p&gt;

&lt;p&gt;We can make a power rangers class and use a &lt;code&gt;connectedCallback&lt;/code&gt; to connect it to our shadow to the template and figure out how we define our behaviors. This is where we get into custom elements. Each Power Ranger has behaviors, Attributes and functions specific to that ranger. We can make a  custom element and give the ranger whatever color, weapon, and zord we want to assign. Think back to when Tommy Oliver lost his Green Ranger Powers. Zordon and Alpha used the Power Ranges template and created a new Custom Element (New Ranger) with unique properties specifically to it. This is how we got the &lt;a href="https://www.youtube.com/watch?v=mYQnfdIGKa0"&gt;White Ranger&lt;/a&gt;! Our  element comes with Saba, The &lt;a href="https://www.youtube.com/watch?v=XofCWiRz6tg"&gt;White Tiger Zord, and the White Tiger MegaZord&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just like Rangers needing a morpher and the morphing grid, we need HTML Templates (and slots) to make our Custom Elements.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Shadow DOM:
&lt;/h1&gt;

&lt;p&gt;Each element is encapsulated and rendered separately from the main DOM. This way you can keep features and styling of each element independent of each other and the other parts of the DOM. This is like the power ranger theme or color. There are only one of each color ranger in a team. (No Time Force did not have 2 red rangers. One was the &lt;a href="https://www.youtube.com/watch?v=i5SXDwM5pcc"&gt;Red Ranger, the other was the Quantum Ranger&lt;/a&gt;… and Ninja Storm had the &lt;a href="https://www.youtube.com/watch?v=BZqsxZ2TvWc"&gt;Red and Crimson Ranger&lt;/a&gt;. Totally different).&lt;/p&gt;

&lt;p&gt;As you can see, the &lt;code&gt;&amp;lt;red-ranger&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;crimson-rangers&amp;gt;&lt;/code&gt; are similar, but independent of each other, all thanks to the Shadow DOM.&lt;/p&gt;

&lt;p&gt;Thanks to all the parts of the spec: HTML Template, Custom Elements, and Shadow DOM we get our own badass &lt;code&gt;&amp;lt;power-ranger&amp;gt;&lt;/code&gt;! &lt;/p&gt;

&lt;h1&gt;
  
  
  IT'S GIT INIT TIME
&lt;/h1&gt;

&lt;p&gt;But the cool thing about web components is when you &lt;a href="https://youtu.be/BtDblUBsI50?t=86"&gt;combine them!!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like every Super Sentai series, the support and skills of the group are what defeats the villain at the end of the episode. Web Components are better when they work together. Hey sometimes power rangers from different series make guest appearances to &lt;a href="https://www.youtube.com/watch?v=hrzwkeI_l8Y"&gt;help each other out&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope after this you see why I believe Web Components and Power Rangers are a much better comparison.&lt;/p&gt;

&lt;p&gt;Go Forth and Build. Stay Spicy and Keep Moving&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/tom_var"&gt;@tom_var&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>webcomponents</category>
      <category>newbie</category>
      <category>frontend</category>
    </item>
    <item>
      <title>HAX-the-Code-base: pre-code</title>
      <dc:creator>Tom Varughese</dc:creator>
      <pubDate>Mon, 10 Feb 2020 05:52:56 +0000</pubDate>
      <link>https://dev.to/tom_var/hax-the-code-base-pre-code-3ch6</link>
      <guid>https://dev.to/tom_var/hax-the-code-base-pre-code-3ch6</guid>
      <description>&lt;p&gt;I am not a developer. I can certainly write and understand code but I wouldn't call myself a coder. I definitely have a lot to learn... like backing up my &lt;a href="https://goforthandbuild.com/sites/go-forth-and-build/2099"&gt;website&lt;/a&gt; before nuking multiple blog post and not having a second copy somewhere... hypothetically. &lt;/p&gt;

&lt;p&gt;~~&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Small Backstory:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;About 2 years ago I graduated from University with no idea what I wanted to do with a not so easy to describe tech business hybrid degree and long story short &lt;a href="https://twitter.com/btopro"&gt;Bryan Ollendyke&lt;/a&gt; aka &lt;a href="https://twitter.com/hashtag/EdTechJoker"&gt;#EdTechJoker&lt;/a&gt; introduced me to &lt;a href="https://twitter.com/rickmanelius"&gt;Rick Manelius&lt;/a&gt;. (Def check them out, they are really cool people)&lt;br&gt;
~~&lt;/p&gt;

&lt;p&gt;Rick writes absolutely amazing blog post on his &lt;a href="https://rickmanelius.com/"&gt;website&lt;/a&gt;. One that hit me was his &lt;a href="https://rickmanelius.com/article/my-3-words-2020"&gt;3 words for 2020&lt;/a&gt; (I &lt;em&gt;highly&lt;/em&gt; encourage you to read his post because I won't tl;dr it for you lazy people). I was tired of kicking leaves for the last year or so in my career so I decided to give it a &lt;a href="https://twitter.com/Tom_Var/status/1212596610393366528"&gt;shot&lt;/a&gt;. While not 3 words, I did stick to 3 themes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;contemplation without confusion&lt;/li&gt;
&lt;li&gt;distancing distasteful distractions&lt;/li&gt;
&lt;li&gt;i am important&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what does this mean? I want to learn more about code and better understand why a developer would choose something like lit-element vs polymer. I want to be able to talk to someone about the advantages to web components passed the surface level &lt;em&gt;"its scales better and works in all browsers"&lt;/em&gt;. While I can just search these in [&lt;em&gt;insert your favorite search engine&lt;/em&gt;] I thought the best way for me to learn is to ask the developers themselves (think something akin to "Into the Actor's Studio" but with developers). So what has stopped me from doing this a year ago? Thinking I would waste someone's time by asking stupid questions, distracting myself with random things, and overall being indecisive by being stuck in my head (hence 2020 goals above). &lt;/p&gt;

&lt;p&gt;What does it mean to be a developer/coder/programmer? What are these things called Web Components and why do they matter? Tabs or Spaces? Honey Dew or Cantaloupe?! I don't know the answers but I do know that the only way for me to demystify the code/concepts is to just decode the developer. And the best place to start is the people I did my internship with my senior year of College... the &lt;a href="//haxtheweb.org"&gt;HAX Project&lt;/a&gt; by the &lt;a href="https://twitter.com/elmsln"&gt;@elmsln team&lt;/a&gt;. Hope you're ready to &lt;code&gt;&amp;lt;hax-the-code-base&amp;gt;&lt;/code&gt; with me :)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>webcomponents</category>
    </item>
  </channel>
</rss>
