<?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: The Open Coder</title>
    <description>The latest articles on DEV Community by The Open Coder (@opencoder).</description>
    <link>https://dev.to/opencoder</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F566518%2F222263b5-a5a5-4ab5-9182-ba51e907fa74.jpeg</url>
      <title>DEV Community: The Open Coder</title>
      <link>https://dev.to/opencoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/opencoder"/>
    <language>en</language>
    <item>
      <title>How to add I18N Support to your Web Components</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 12 Dec 2021 20:52:47 +0000</pubDate>
      <link>https://dev.to/opencoder/how-to-add-i18n-support-to-your-web-components-4o2n</link>
      <guid>https://dev.to/opencoder/how-to-add-i18n-support-to-your-web-components-4o2n</guid>
      <description>&lt;p&gt;Recently I have been working on recreating a flash card as a web component. Here's a screenshot of the card (&lt;a href="https://h5p.org/flashcards#example=733"&gt;Click the image to try it out&lt;/a&gt;):&lt;br&gt;
&lt;a href="https://h5p.org/flashcards#example=733"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ssJbAsSA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0287q3a49bp6rrgihfg.png" alt="Comp" width="432" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While this card is really well designed and has a decent UX, it's missing accessibility (a11y) and internationalization (i18n). To fix this we can recreate the card using &lt;a href="https://lit.dev/"&gt;LitElement&lt;/a&gt;, so that the flash card can be used anywhere.&lt;/p&gt;
&lt;h3&gt;
  
  
  Development Approach
&lt;/h3&gt;

&lt;p&gt;The first decision I made was to use slots for passing in the question and answer. If you don't know what slots are check out my &lt;a href="https://dev.to/opencoder/slots-in-litelement-for-dummies-32oh"&gt;post about using slots&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/opencoder" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eCk1gWbv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--dWZZ1GJh--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/566518/222263b5-a5a5-4ab5-9182-ba51e907fa74.jpeg" alt="opencoder"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/opencoder/slots-in-litelement-for-dummies-32oh" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Slots in LitElement for Dummies&lt;/h2&gt;
      &lt;h3&gt;The Open Coder ・ Oct 24 ・ 2 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;To achieve this, I created an &lt;code&gt;&amp;lt;answer-box&amp;gt;&lt;/code&gt; tag for handling the input and checking of the answer. Here's a snippet from the &lt;code&gt;&amp;lt;answer-box&amp;gt;&lt;/code&gt; render function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;render() {
    return html`
      &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"question"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;slot&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"front"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"front"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;slot&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"back"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"back"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see all the user has to do is pass in the front and back of the card when creating a &lt;code&gt;&amp;lt;flash-card&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;flash-card&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;slot=&lt;/span&gt;&lt;span class="s"&gt;"front"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;What is strawberry in Spanish?&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;slot=&lt;/span&gt;&lt;span class="s"&gt;"back"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;fresa&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/flash-card&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once the slots were working, I wanted to extend the functionality of the original design to be more accessible. For example, the original card has no audial component for hearing the answer, and it doesn't support multiple languages. When working with JavaScript in the browser we can make good use of two awesome classes for enhancing a11y and i18n.&lt;/p&gt;
&lt;h4&gt;
  
  
  SpeechSynthesisUtterance
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance"&gt;SpeechSynthesisUtterance&lt;/a&gt; is an awesome built-in class for text-to-speech in the browser. First, I instantiate the class in the constructor with:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speech&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;SpeechSynthesisUtterance&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speech&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lang&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;language&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// uses language of the browser&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here we are creating the class and setting the language of the synthetic voice to be the same as the browser's default language. Next, we need a function to run whenever the user clicks on the sound icon:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;speakWords&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;side&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;back&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;front&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;back&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;comparison&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shadowRoot&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[name="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;side&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"]`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assignedNodes&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[name="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;side&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"]`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assignedNodes&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speech&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;comparison&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speechSynthesis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speak&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speech&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The first two lines have to do with checking the data passed into the slot and determining what the correct answer is. Then on line 3 we set &lt;code&gt;this.speech.text&lt;/code&gt; to the correct answer that was passed in. Finally, line 4 makes your browser speak the correct answer.&lt;/p&gt;
&lt;h4&gt;
  
  
  I18NMixin
&lt;/h4&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/btopro" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XlKkpnlG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--f04cE9aN--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_66%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/254952/93f883b0-267c-4890-8ee5-26a97655af02.gif" alt="btopro"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/btopro/i18n-in-web-components-2gii" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;i18n in web components&lt;/h2&gt;
      &lt;h3&gt;Bryan Ollendyke ・ Mar 3 ・ 2 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webcomponents&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#i18n&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#a11y&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
I18NMixin is a "mixin" written by &lt;a href="https://dev.to/btopro"&gt;Bryan Ollendyke&lt;/a&gt; for managing internationalization (I18N) in Lit. To instantiate the mixin in my project I wrote:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;I18NMixin&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@lrnwebcomponents/i18n-manager/lib/I18NMixin.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;AnswerBox&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;I18NMixin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;i18store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;I18NManagerStore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;requestAvailability&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speech&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lang&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;i18store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After importing and extending the project, all I'm doing here is setting the manager to a variable so I can access it later. You might also recognize that I am setting the default voice from before to the language specified by our mixin. Now by simply adding these few lines I can start to translate parts of my web component. For instance, I need the placeholder text in the input and the text in the button to say "Your Answer" and "Check Answer". To do that I add:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;yourAnswer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Your answer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;checkAnswer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Check answer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;registerLocalization&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;localesPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../locales/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;locales&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;es&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ja&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here we are using the &lt;code&gt;this.t&lt;/code&gt; variable provided from our mixin to establish the variables we want to be translatable. Then, I specify the path to the files and languages that we are supporting. Here's an example of the &lt;code&gt;./locales/answer-box.ja.json&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;yourAnswer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;あなたの答え&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;checkAnswer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;答えをチェック&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see we simply add a file to our &lt;code&gt;./locales&lt;/code&gt; folder with the format of &lt;code&gt;component-name.2-letter-lang-code.json&lt;/code&gt; and directly translate our variables. Lastly, we add our &lt;code&gt;this.t&lt;/code&gt; variables to our code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="s2"&gt;`
    ...
    &amp;lt;input
      id="answer"
      type="text"
      .placeholder="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;yourAnswer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"
      @input="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;inputChanged&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"
      .value="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userAnswer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"
    /&amp;gt;
    ...
    &amp;lt;button
      id="check"
      ?disabled="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userAnswer&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"
      @click="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checkUserAnswer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"
    &amp;gt;
      &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checkAnswer&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
    &amp;lt;/button&amp;gt;
    ...
  `&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So wherever we use &lt;code&gt;this.t&lt;/code&gt; above, it will translate the variables if we support the language specified. Obviously, our component only supports 4 so far, so we have a ways to go.&lt;/p&gt;
&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7gc-ozv4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05ryfajcpugmwl5exybh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7gc-ozv4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05ryfajcpugmwl5exybh.png" alt="Our flash card" width="387" height="482"&gt;&lt;/a&gt;&lt;br&gt;
You might have noticed that I made a &lt;code&gt;&amp;lt;flash-card&amp;gt;&lt;/code&gt; component, but only showed code from &lt;code&gt;&amp;lt;answer-box&amp;gt;&lt;/code&gt;. That's because I just wanted to highlight two cool conventions for increasing i18n in web components. If you're interested in how the styling was done and how the whole component was put together check out our repo:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PenStat"&gt;
        PenStat
      &lt;/a&gt; / &lt;a href="https://github.com/PenStat/penguin-project-three"&gt;
        penguin-project-three
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
A Project EdTechJoker creation&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://opensource.org/licenses/Apache-2.0" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License: Apache 2.0"&gt;&lt;/a&gt;
&lt;a href="https://lit.dev/" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/0bfaa1c84ba5d611a6ab1d9d5a2907e1914c9c3c57c8dbc8b5cfe5ecedc6f985/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c69742d3332346666663f7374796c653d666c6174266c6f676f3d646174613a696d6167652f737667253262786d6c3b6261736536342c50484e325a79426d615778735053496a5a6d5a6d4969423261575633516d393450534977494441674d545977494449774d43496765473173626e4d39496d6830644841364c79393364336375647a4d7562334a6e4c7a49774d44417663335a6e496a3438634746306143426b50534a744d54597749446777646a6777624330304d4330304d4870744c54517749445177646a6777624451774c545177656d30774c546777646a6777624330304d4330304d4870744c54517749445177646a6777624451774c545177656d30744e4441744e4442324f4442734e4441744e444236625451774c545177646a6777624330304d4330304d4870744c545177494445794d4859344d4777744e4441744e444236625330304d4330304d4859344d4777304d4330304d486f694c7a34384c334e325a7a34253344" alt="Lit"&gt;&lt;/a&gt;
&lt;a href="https://haxtheweb.org/" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/7167458bbac476314240ffa0d0772d83641a4c5fcffe7ebc9920ad2b50bd3a7a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4841585468655765622d39393939393946463f7374796c653d666c6174266c6f676f3d646174613a696d6167652f737667253262786d6c3b6261736536342c50484e325a7942705a4430695a6d56684d5445785a5441744d6a45775a433030593251774c574a684d5751745a475a6d4f5451794f4463304e6a67314969426b595852684c57356862575539496b78686557567949444569494868746247357a50534a6f644852774f693876643364334c6e637a4c6d39795a7938794d4441774c334e325a794967646d6c6c64304a76654430694d434177494445344e4334304944457a4e5334354e79492b5047526c5a6e4d2b50484e306557786c5069356c4d574a6a4d6a41794e5330784f4441774c54526b597a49744f4463344e53316a4e445a6c5a4445774d3259304f544a375a6d6c7362446f6a4d6a4d785a6a49774f3330384c334e306557786c506a77765a47566d637a3438634746306143426a6247467a637a30695a544669597a49774d6a55744d5467774d4330305a474d794c5467334f445574597a51325a5751784d444e6d4e446b794969426b50534a4e4e7a67754d4463734f444d754e4456574e5456494f4459754d6e59344c6a457a614445324c6a4932646a51754d44646f4e4334774e3159344d7934304e5567354f433430566a59334c6a4535534467324c6a4a574f444d754e4456614969382b5048427662486c6e6232346763473970626e527a505349784e544d754d544d674e6a4d754e7941784e544d754d544d674e5445754d7a6b674d5451774c6a5530494455784c6a4d35494445304d4334314e43417a4f5334774f5341784d6a63754f5455674d7a6b754d446b674d5449334c6a6b31494449324c6a6335494445774d6934334f4341794e6934334f5341784d4449754e7a67674d7a6b754d446b674d5445314c6a4d3249444d354c6a4135494445784e53347a4e6941314d53347a4f5341784d6a63754f5455674e5445754d7a6b674d5449334c6a6b314944597a4c6a63674d5451774c6a55304944597a4c6a63674d5451774c6a553049446332494445794e79347a4e6941334e6941784d6a63754d7a59674f4467754d7941784d5451754e7a67674f4467754d7941784d5451754e7a67674d5441774c6a5978494445774d6934784f5341784d4441754e6a45674d5441794c6a4535494445784d6934354d5341784d6a63754d7a59674d5445794c6a6b78494445794e79347a4e6941784d4441754e6a45674d544d354c6a6b31494445774d4334324d5341784d7a6b754f5455674f4467754d7941784e5449754e5451674f4467754d7941784e5449754e5451674e7a59674d5459314c6a637949446332494445324e5334334d6941324d793433494445314d7934784d7941324d7934334969382b5048427662486c6e6232346763473970626e527a5053497a4d7934784d7941324d79343349444d7a4c6a457a494455784c6a4d35494451314c6a6379494455784c6a4d35494451314c6a637949444d354c6a4135494455344c6a4d7849444d354c6a4135494455344c6a4d78494449324c6a63354944677a4c6a5134494449324c6a63354944677a4c6a513449444d354c6a4135494463774c6a673549444d354c6a4135494463774c6a6735494455784c6a4d35494455344c6a4d78494455784c6a4d35494455344c6a4d784944597a4c6a63674e4455754e7a49674e6a4d754e7941304e5334334d6941334e6941314f4334344f5341334e6941314f4334344f5341344f43347a494463784c6a5134494467344c6a4d674e7a45754e4467674d5441774c6a5978494467304c6a4133494445774d4334324d5341344e4334774e7941784d5449754f5445674e5467754f446b674d5445794c6a6b78494455344c6a6735494445774d4334324d5341304e69347a4d5341784d4441754e6a45674e4459754d7a45674f4467754d79417a4d7934334d6941344f43347a49444d7a4c6a637949446332494449774c6a553049446332494449774c6a55304944597a4c6a63674d7a4d754d544d674e6a4d754e794976506a777663335a6e50673d3d" alt="#HAXTheWeb"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://github.com/elmsln/edtechjoker/blob/master/fall-21/projects/p3-haxtheweb/README.md"&gt;https://github.com/elmsln/edtechjoker/blob/master/fall-21/projects/p3-haxtheweb/README.md&lt;/a&gt; for requirements to complete this project.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/open-wc"&gt;&lt;img src="https://camo.githubusercontent.com/a24b4bf90626ead039104e3b3dd2decf8721bc5e8b07d742cb2f634b3599e1cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230776974682d6f70656e2d2d77632d626c75652e737667" alt="Built with open-wc recommendations"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Quickstart&lt;/h2&gt;
&lt;p&gt;To get started:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;yarn install
yarn start
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; requires node 10 &amp;amp; npm 6 or higher&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Navigate to the HAX page to see it in context. Make sure to change &lt;code&gt;rename-me&lt;/code&gt; in ALL parts of the repo to your project name.&lt;/p&gt;
&lt;h2&gt;
Scripts&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; runs your app for development, reloading on file changes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start:build&lt;/code&gt; runs your app after it has been built using the build command&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;build&lt;/code&gt; builds your app and outputs it in your &lt;code&gt;dist&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;test&lt;/code&gt; runs your test suite with Web Test Runner&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lint&lt;/code&gt; runs the linter for your project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;format&lt;/code&gt; fixes linting and formatting errors&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Tooling configs&lt;/h2&gt;
&lt;p&gt;For most of the tools, the configuration is in the &lt;code&gt;package.json&lt;/code&gt; to reduce the amount of files in your project.&lt;/p&gt;
&lt;p&gt;If you customize the configuration a lot, you can consider moving them to individual files.&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PenStat/penguin-project-three"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Demo
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/@penstat2/flash-card"&gt;Link to npmjs&lt;/a&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/griffin-sullivan/embed/QWqGqpB?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ideas for an Open Metaverse</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 07 Nov 2021 16:33:58 +0000</pubDate>
      <link>https://dev.to/opencoder/ideas-for-an-open-metaverse-4pmh</link>
      <guid>https://dev.to/opencoder/ideas-for-an-open-metaverse-4pmh</guid>
      <description>&lt;p&gt;With all of the new changes Facebook is making, I think it's important to talk about this topic. I've been a long time fan of VR, and I would consider myself an early adopter of the technology. You can never forget that first experience you have in a VR headset where you realize how amazing the possibilities are. But not much has changed since I bought my Oculus Rift in 2018. There's been some hardware upgrades from HTC and Oculus, and some new players entering the space with nice headsets like the Valve Index. However, the only application for this technology has largely been gaming and very few productivity applications. Now that Facebook (Meta) has announced there new direction with the "metaverse", I think it's important to talk about what that should look like beyond just Meta's products.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Metaverse
&lt;/h2&gt;

&lt;p&gt;The metaverse has been described as a place where you can virtually meet, work and play using a VR headset, glasses or your device. The easiest way to catch up on what that really means is to watch this video of Meta's recent announcements:&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/gElfIo6uw4g"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;From what we've been shown, it seems like they want to focus on social experiences through virtual meetings and work. Because they own Oculus, the largest player in the VR space, it's obvious they will be making the first machines that make this stuff possible. However, what empowers this technology is the world we build around it, which should not be left up to the largest corporations in America.&lt;/p&gt;

&lt;h2&gt;
  
  
  An Open Metaverse
&lt;/h2&gt;

&lt;p&gt;If you've read any of my other posts, you'll know that I believe in open-source technology and its ability to innovate properly. From what Meta has shown us, they seem to already be starting to build the applications that will power the metaverse. Although their announcements will push for more developers to invest in the metaverse, there are some large implications for 1 company developing what could end up being our day to day lives. &lt;/p&gt;

&lt;h3&gt;
  
  
  Security and Privacy
&lt;/h3&gt;

&lt;p&gt;In the couple decades that open-source software has existed, it has been obvious that security and privacy has been an overarching benefit. We all know Microsoft and Apple don't have our best interests in mind when we use their operating systems. When it comes to security, Linux has dominated every other operating system, because the code is openly available to anyone. That means more people see the code, understand the problems, and fix it. It's quite possibly the most simple and effective benefit of open-source.&lt;/p&gt;

&lt;h3&gt;
  
  
  Protocols
&lt;/h3&gt;

&lt;p&gt;A few parallels to the early days of the internet can be made here. Contrary to public belief, the metaverse will create more ways for humans to collaborate and socialize. A lot of the comments I've seen are along the lines of "This is sad. No one will talk to each other in person anymore." If the past two years have shown us anything it's that more and more people don't care about working in-person for the "social benefits". Additionally, we live in a world where we can take our computers anywhere and interact with other people wherever we want. This technology will only make this interaction more realistic and normal than it already is. There's no evidence for us to think this will be any different than the introduction of computers to the masses. &lt;/p&gt;

&lt;p&gt;Beyond the social aspect of the internet, we can compare the current vision of the metaverse to the early days of the internet. The internet was really nothing without protocols. There's no way we could have come this far without things like TCP/UDP and HTTP. Similarly, we need protocols for how experiences in the metaverse will be served. What file formats to support? How do we ensure a secure connection? What software will act as the "browser" between virtual worlds? These types of questions need to be tackled before a bunch of large corporations start making their own incompatible versions of the metaverse.&lt;/p&gt;

&lt;h3&gt;
  
  
  Development
&lt;/h3&gt;

&lt;p&gt;This is something Meta addressed, but I want to change the way they are looking at this piece of the puzzle. We shouldn't rely on Meta to create the tools for developers to create virtual experiences. I would look more towards technology like Unreal Engine or Unity which are freely available to anyone. If we take this a step further, we should create open-source tools for us to create virtual experiences, so that there is the same standard for quality and security at every point in the pipeline. The internet could have never succeeded if there were not some level of agreement on how to develop websites that are compatible with browsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Should We Invest in the Open Metaverse?
&lt;/h2&gt;

&lt;p&gt;Well for starters, a couple massive corporations are investing billions of dollars into the metaverse. If developers standby and let them call the shots for too long, there is a possibility for our virtual experiences to be flooded with ads and privacy invasion. &lt;/p&gt;

&lt;p&gt;Beyond the dystopian commentary, let's think about how national governments have regulated technology. We've been shown that corporations will unethically use their power over our social networks and devices in order to sell our data for profit. Whether that data has larger implications in other parts of society never mattered to these companies. All the while, our governments have done nothing to stop it. If we build the metaverse upon the foundations of open-source technology, we can largely prevent corporations from invading our privacy.&lt;/p&gt;

&lt;p&gt;My belief is that the metaverse is inevitable. It's only a matter of time before people adopt this technology, which I think will benefit society for the most part. However, I think it's important that developer communities take some time to deliberate over how the metaverse should work, so we can get around some of the mistakes that have been made before.&lt;/p&gt;

&lt;p&gt;Personally, I want to contribute to building the metaverse. Ever since I first used VR, I understood how far the technology could go, and I'm sure there are many other applications we cannot begin to understand yet. I believe this technology could empower new ways of working together that would drastically increase productivity and collaboration in the workplace. It has the power to change how we socialize on the internet and bring more empathy into the conversations we have with strangers. My hope is that the metaverse will make us understand that there's someone behind a profile picture, and they are worth more than just their data. &lt;/p&gt;

&lt;h3&gt;
  
  
  Some More Info
&lt;/h3&gt;

&lt;p&gt;If you're looking for more information about this topic, check out this &lt;a href="https://spectrum.ieee.org/open-metaverse?utm_campaign=post-teaser&amp;amp;utm_content=1kp270f8"&gt;article&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Slots in LitElement for Dummies</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 24 Oct 2021 18:25:00 +0000</pubDate>
      <link>https://dev.to/opencoder/slots-in-litelement-for-dummies-32oh</link>
      <guid>https://dev.to/opencoder/slots-in-litelement-for-dummies-32oh</guid>
      <description>&lt;p&gt;Slots allow us to write very flexible web components. And no, I'm not talking about slot machines. I'm talking about the &lt;code&gt;&amp;lt;slot&amp;gt;&lt;/code&gt; tag. &lt;/p&gt;

&lt;p&gt;If you've seen one of my other posts, I shared that I'm making a card component. Here's the design I'm following:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t7I7ub7_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7wtot5nmb60fd5migufe.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t7I7ub7_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7wtot5nmb60fd5migufe.PNG" alt="Image description" width="716" height="798"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've broken this design into 4 elements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An icon element&lt;/li&gt;
&lt;li&gt;A banner element with header, subheader, and icon&lt;/li&gt;
&lt;li&gt;A scaffold / outline for the card&lt;/li&gt;
&lt;li&gt;Putting all of these together to make one card element&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To keep the design flexible, we can use slots to pass any HTML into the header, subheader, and body content of the card. In order to achieve this we use the &lt;code&gt;name&lt;/code&gt; attribute in the parent element and the &lt;code&gt;slot&lt;/code&gt; attribute in the child. Here's what that looks like for the parent banner element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// render method for the &amp;lt;card-banner&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="s2"&gt;`
      &amp;lt;div class="banner-wrapper" style="display: flex;"&amp;gt;
        &amp;lt;card-icon type="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;" style="width: 100px"&amp;gt;&amp;lt;/card-icon&amp;gt;
        &amp;lt;div class="header-wrapper"&amp;gt;
          &amp;lt;slot name="header"&amp;gt;&amp;lt;/slot&amp;gt;
          &amp;lt;slot name="subheader"&amp;gt;&amp;lt;/slot&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Like I stated before, this banner is made up of an icon, &lt;code&gt;&amp;lt;card-icon&amp;gt;&lt;/code&gt;, and a header and subheader which are the two slots inside &lt;code&gt;header-wrapper&lt;/code&gt;. To pass HTML into these slots, we simply say &lt;code&gt;slot="header"&lt;/code&gt; and &lt;code&gt;slot="subheader"&lt;/code&gt;. Here's an example of how the HTML is slotted in the final card element that puts everything together:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// render method for &amp;lt;learning-card&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="s2"&gt;`
      &amp;lt;card-frame&amp;gt;
        &amp;lt;card-header slot="banner" type="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&amp;gt;
          &amp;lt;h2 slot="header"&amp;gt;I'm the header&amp;lt;/h2&amp;gt;
          &amp;lt;h3 slot="subheader"&amp;gt;I'm the subheader&amp;lt;/h3&amp;gt;
        &amp;lt;/card-header&amp;gt;
        &amp;lt;div slot="content"&amp;gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;/card-frame&amp;gt;
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this example, we pass an &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; tag into the header and a &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt; tag into the subheader. You might also notice that I'm using slots to separate the banner and content parts of the card. You'll find that in the &lt;code&gt;&amp;lt;card-frame&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// render method for &amp;lt;card-frame&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="s2"&gt;`
      &amp;lt;div&amp;gt;
        &amp;lt;slot id="top-part" name="banner"&amp;gt;&amp;lt;/slot&amp;gt;
        &amp;lt;slot id="bottom-part" name="content"&amp;gt;&amp;lt;/slot&amp;gt;
      &amp;lt;/div&amp;gt;
    `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So, the frame lets us pass HTML to a &lt;code&gt;banner&lt;/code&gt; and &lt;code&gt;content&lt;/code&gt; slot, and then we use &lt;code&gt;slot="header"&lt;/code&gt; or &lt;code&gt;slot="subheader"&lt;/code&gt; to pass the HTML we want into the &lt;code&gt;card-banner&lt;/code&gt;. Finally, we have one last unnamed slot in the &lt;code&gt;&amp;lt;learning-card&amp;gt;&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// inside render function of &amp;lt;learning-card&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;slot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;content&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;slot&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/slot&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This inner slot let's us pass whatever we want into the &lt;code&gt;&amp;lt;learning-card&amp;gt;&lt;/code&gt; content area. So when we call the card like:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;learning-card&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;I'm the first bullet&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;I'm the second bullet&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/learning-card&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; will become the bottom content of the card similar to the bulleted lists in the design comp.&lt;/p&gt;

&lt;p&gt;Here's the repo if you want to track the progress of this card, as it is almost finished:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PenStat"&gt;
        PenStat
      &lt;/a&gt; / &lt;a href="https://github.com/PenStat/penstat-project2"&gt;
        penstat-project2
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/b451685acf27006cfbd86b4791c911faa380a6940510bd58e526274b1ae2b6db/68747470733a2f2f6f70656e2d77632e6f72672f6865726f2e706e67"&gt;&lt;img width="200" src="https://camo.githubusercontent.com/b451685acf27006cfbd86b4791c911faa380a6940510bd58e526274b1ae2b6db/68747470733a2f2f6f70656e2d77632e6f72672f6865726f2e706e67"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;h2&gt;
Open-wc Starter App&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/open-wc"&gt;&lt;img src="https://camo.githubusercontent.com/a24b4bf90626ead039104e3b3dd2decf8721bc5e8b07d742cb2f634b3599e1cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230776974682d6f70656e2d2d77632d626c75652e737667" alt="Built with open-wc recommendations"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Quickstart&lt;/h2&gt;
&lt;p&gt;To get started:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm init @open-wc
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; requires node 10 &amp;amp; npm 6 or higher&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
Scripts&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; runs your app for development, reloading on file changes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start:build&lt;/code&gt; runs your app after it has been built using the build command&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;build&lt;/code&gt; builds your app and outputs it in your &lt;code&gt;dist&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;test&lt;/code&gt; runs your test suite with Web Test Runner&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lint&lt;/code&gt; runs the linter for your project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;format&lt;/code&gt; fixes linting and formatting errors&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Tooling configs&lt;/h2&gt;
&lt;p&gt;For most of the tools, the configuration is in the &lt;code&gt;package.json&lt;/code&gt; to reduce the amount of files in your project.&lt;/p&gt;
&lt;p&gt;If you customize the configuration a lot, you can consider moving them to individual files.&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PenStat/penstat-project2"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Considerations for Building a Web Component</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 10 Oct 2021 17:36:11 +0000</pubDate>
      <link>https://dev.to/opencoder/considerations-for-building-a-web-component-5c19</link>
      <guid>https://dev.to/opencoder/considerations-for-building-a-web-component-5c19</guid>
      <description>&lt;p&gt;There are a lot of things to consider when creating a new web component. What attributes and properties do we need? How are we going to style it? Are there accessibility concerns? What about security? The list goes on. Today, I'll go through the thought process of a making a new component with an example.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Design Comp
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UZT72gFG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgznar0xq15ls4gsu4w3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UZT72gFG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgznar0xq15ls4gsu4w3.PNG" alt="Learning Card Design" width="716" height="798"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the image above, we are going to make a "learning card" that consists of a couple things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An SVG icon&lt;/li&gt;
&lt;li&gt;Banner with Header and Subheader&lt;/li&gt;
&lt;li&gt;Slotted HTML in the bottom&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If we consider the design there's a few things we want to be mindful of when putting this thing together. First off, you might notice the color and icon match a different subheader. So maybe we want to check the subheader to set the color and icon. You might also notice there are different fonts, font sizes, and padding to consider. Design-wise this should be relatively simple, as long as we can make everything responsive and set the overflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Break It Down
&lt;/h2&gt;

&lt;p&gt;Looking at the comp above, we can break it down into one component consisting of three other components. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Icon with circle around it&lt;/li&gt;
&lt;li&gt;Banner with Header, Subheader, and Icon component&lt;/li&gt;
&lt;li&gt;A "skeleton" or outline of the card (A component with something in the top and something in the bottom)&lt;/li&gt;
&lt;li&gt;Put these all together to make a "learning card"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By breaking this component down, we'll be able to reuse any of these components in the future, and we can have more control over how things interact. For each of the components we'll have to ask ourselves those initial questions: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are the props and attributes?&lt;/li&gt;
&lt;li&gt;Design concerns?&lt;/li&gt;
&lt;li&gt;Accessibility?&lt;/li&gt;
&lt;li&gt;Security?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once we have an answer to each of these questions, we tackle each component until we are able to put everything together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expectations and Previous Experience
&lt;/h2&gt;

&lt;p&gt;I expect this component will be relatively easy to put together. However, there are a few things that I think might be challenging. The first is I don't know much about slotting content. This will be done in the "skeleton" / outline component, and we want to make sure that any HTML can be arranged in the card. The second challenge will be keeping the design consistent. We want the left margin to be consistent in the bottom half, and make sure content overflows in a natural way for both the banner and the bottom portion. If we can make the card responsive and slot content properly, then I think this will be a really good example of atomic design. &lt;/p&gt;

&lt;p&gt;In the past I made &lt;a href="https://github.com/PenStat/PenStat-CTA/tree/master/penguin-state-button"&gt;a penguin button&lt;/a&gt;, and I learned some valuable things from this experience. After that project, I have a better understanding of using properties to control the different attributes on a web component. I also learned a cool way to control the style of the component using CSS variables and Open WC's API. Overall, I learned how to answer those initial questions before creating the component which will be valuable when building this card.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/elmsln"&gt;
        elmsln
      &lt;/a&gt; / &lt;a href="https://github.com/elmsln/project-two"&gt;
        project-two
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Edtechjoker project two - card
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/b451685acf27006cfbd86b4791c911faa380a6940510bd58e526274b1ae2b6db/68747470733a2f2f6f70656e2d77632e6f72672f6865726f2e706e67"&gt;&lt;img width="200" src="https://camo.githubusercontent.com/b451685acf27006cfbd86b4791c911faa380a6940510bd58e526274b1ae2b6db/68747470733a2f2f6f70656e2d77632e6f72672f6865726f2e706e67"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;h2&gt;
Open-wc Starter App&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/open-wc"&gt;&lt;img src="https://camo.githubusercontent.com/a24b4bf90626ead039104e3b3dd2decf8721bc5e8b07d742cb2f634b3599e1cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230776974682d6f70656e2d2d77632d626c75652e737667" alt="Built with open-wc recommendations"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
Quickstart&lt;/h2&gt;

&lt;p&gt;To get started:&lt;/p&gt;

&lt;div class="highlight highlight-source-shell position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm init @open-wc
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; requires node 10 &amp;amp; npm 6 or higher&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
Scripts&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; runs your app for development, reloading on file changes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start:build&lt;/code&gt; runs your app after it has been built using the build command&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;build&lt;/code&gt; builds your app and outputs it in your &lt;code&gt;dist&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;test&lt;/code&gt; runs your test suite with Web Test Runner&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lint&lt;/code&gt; runs the linter for your project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;format&lt;/code&gt; fixes linting and formatting errors&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Tooling configs&lt;/h2&gt;
&lt;p&gt;For most of the tools, the configuration is in the &lt;code&gt;package.json&lt;/code&gt; to reduce the amount of files in your project.&lt;/p&gt;
&lt;p&gt;If you customize the configuration a lot, you can consider moving them to individual files.&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/elmsln/project-two"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Lessons from Making a Call-to-Action Button</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Mon, 27 Sep 2021 01:30:48 +0000</pubDate>
      <link>https://dev.to/opencoder/lessons-from-making-a-call-to-action-button-175o</link>
      <guid>https://dev.to/opencoder/lessons-from-making-a-call-to-action-button-175o</guid>
      <description>&lt;p&gt;For the past couple weeks my class has been working on a call-to-action button. These buttons are categorized as the most important on the page—think like the “Sign Up Now” button on every website you’ve ever been on. So naturally, my group decided to recreate the &lt;a href="https://play.cprewritten.net/"&gt;login button from Club Penguin&lt;/a&gt; PS: You have to click Play Now! first. &lt;/p&gt;

&lt;p&gt;Recreating an old clunky, Flash button in Open Web Components is actually way dumber and more annoying than you would think. I started the component by getting the penguin animation down. Normally you would do hover animations in CSS, BUT we are changing the source of the image in the DOM. Therefore, CSS can’t do anything for us. Enter JavaScript. This was easily achieved (and later improved by my teammate Jonah) by attaching event listeners to our button for mouse enter and mouse exit. When the mouse enters the button, change the image. When the mouse leaves the button, change the image back to the original. &lt;/p&gt;

&lt;p&gt;Once we finished the main animation of the button, Jonah and I started splitting the work. He would be in charge of button logic, and I would do the styling. I was able to follow a demo to figure out how to get the properties to change the CSS variables. However, I think there is an easier way to do this, which I will refactor to if possible. I have found that CSS work is more annoying in web components, or maybe I’ve just never put this much detail into a single button. But I keep finding myself making more syntax errors in CSS than ever before with the OWC workflow. We are still in the process of determining what properties of the styling we should expose in our component, so the rest of the CSS will be finished this week.&lt;/p&gt;

&lt;p&gt;Admittedly, there is still a lot of work to be done on this button, since my team has been busy with other work. We plan to create a small, medium, and large size for the button, so the user won’t be able to mess up the penguin animation (that’s the most important part of our button, duh). Other than that, we just need to finalize the styling of the button and work on accessibility. &lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PenStat"&gt;
        PenStat
      &lt;/a&gt; / &lt;a href="https://github.com/PenStat/PenStat-CTA"&gt;
        PenStat-CTA
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
PenStat-CTA&lt;/h1&gt;
&lt;p&gt;Repo for Call To Action buttons based on classic childhood games: &lt;a href="https://play.cprewritten.net/" rel="nofollow"&gt;https://play.cprewritten.net/&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PenStat/PenStat-CTA"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
    </item>
    <item>
      <title>Comparing Popular Web Component Frameworks</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 12 Sep 2021 18:10:00 +0000</pubDate>
      <link>https://dev.to/opencoder/comparing-popular-web-component-frameworks-31jl</link>
      <guid>https://dev.to/opencoder/comparing-popular-web-component-frameworks-31jl</guid>
      <description>&lt;p&gt;This week in class, we made a GitHub repo consisting of 4 "Hello World!" projects for Angular, React, Vue, and StencilJS. Today I'll be comparing their approaches to front-end development and choosing which I think is the best for building a web application.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PenStat"&gt;
        PenStat
      &lt;/a&gt; / &lt;a href="https://github.com/PenStat/boilerplates"&gt;
        boilerplates
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
boilerplates&lt;/h1&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PenStat/boilerplates"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  Similarities
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Each framework (I know Stencil isn't a framework, but for simplicity we'll say frameworks) except Vue has a &lt;code&gt;/app&lt;/code&gt; or &lt;code&gt;/src&lt;/code&gt; directory for the code. These folders always contain the HTML, CSS, and JavaScript that makes the component or web app run. In the Vue boilerplate this is just in the base directory. &lt;/li&gt;
&lt;li&gt;Dependencies. Dependencies. Dependencies. Because we're working on the web, there's always a ton of dependencies and long installs, although some are longer than others. React and Angular both take forever, while StencilJS and Vue are quick.&lt;/li&gt;
&lt;li&gt;Stencil and Angular both use TypeScript, while Vue and React don't. I'm pretty sure any of these could use TypeScript, but it's interesting to include TS in your boilerplate. I don't know any TS, so it just adds confusion when trying to understand a new framework. &lt;/li&gt;
&lt;li&gt;React, Stencil, and Vue have some JSX, but none in Angular. From what I can understand, I don't see JSX being used in Angular, but every framework I come across uses JSX nowadays. I'm guessing Angular might just be too old for that.&lt;/li&gt;
&lt;li&gt;The React, Angular, and StencilJS boilerplates have routing or back-end code added in. This is nice to have for a new project, so you don't have to write it from scratch.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Easiest to get started with
&lt;/h2&gt;

&lt;p&gt;I would have to say the easiest to start using would be Vue. From what I know about Vue and can see in this boilerplate, it's very simple and easy to begin with. You don't have to know a ton of JavaScript or TypeScript to make little components. Angular would definitely be the hardest to start, since there are a ton of packages and files plus TypeScript involved. Although React has some similarities to Angular in folder size and structure, this would be the second easiest to start just because there are so many people using it. You can find React examples for just about anything now, whereas Vue is still gaining adoption. &lt;/p&gt;

&lt;h2&gt;
  
  
  Which would I choose for building a web app?
&lt;/h2&gt;

&lt;p&gt;I would have to go with React for a serious web application. Although Vue, and I guess Stencil, are easy to get started, I don't know much about scaling them for a full site. Also, there will be less examples of them online. Then we have the choice of Angular or React which are pretty closely related: backed by big companies, used on a ton of sites, lots of documentation/examples, lots of dependencies, and large, complicated file systems. I choose React here only because I don't know TypeScript, and I like JSX. I don't want to learn another templating language, and I have no plans to dive into TS anytime soon. I also like React's file structure, since the pages, components, and server are all separated out the gate. With these choices in mind, I think I could scale a site with React pretty easily and have a lot of support online when I run into problems.&lt;/p&gt;

&lt;p&gt;To get the Angular boilerplate, I followed the docs here: &lt;a href="https://angular.io/cli"&gt;https://angular.io/cli&lt;/a&gt; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Welcome Back to the Open Coder!</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 29 Aug 2021 18:36:35 +0000</pubDate>
      <link>https://dev.to/opencoder/welcome-back-to-the-open-coder-4d13</link>
      <guid>https://dev.to/opencoder/welcome-back-to-the-open-coder-4d13</guid>
      <description>&lt;h2&gt;
  
  
  Who is the Open Coder?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hi there!&lt;/strong&gt; Welcome back to the Open Coder. I will be reviving these blog posts for a final semester of school. My name is Griffin Sullivan. I'm an undergraduate student at Penn State studying Human-Centered Design and Development. I've always had a strong interest and passion for computers and technology, and for the past couple of years that passion has focused on open-source software. I like learning about web technologies, machine learning, and open-source development. I spend a lot of my time learning about these aspects of technology, because I think they have the strongest ability to create change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Web Development?
&lt;/h2&gt;

&lt;p&gt;Although I listed 3 specific areas of technology, my class this semester will focus mostly on web development and some open-source software. What I enjoy about web development is the ability to share my work with anyone, and it &lt;em&gt;usually&lt;/em&gt; just works. Nowadays, everyone has a browser and can check out anything you make, so it's nice that web development is very easy to share with people. I also like the clear separation of structure, design, and logic that HTML, CSS, and JavaScript provides. Beyond this, I generally just enjoy writing JavaScript. Because of my passion for open-source, obviously I'm going to like JS, since there are so many frameworks and libraries that are available for free. I'm excited to dive deeper into building web components this semester, and I can't wait to share what I make on here!&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up Open Web Components
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/dQljWffZCv0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Summing up my first "sprint" on HAX</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Fri, 30 Apr 2021 02:13:15 +0000</pubDate>
      <link>https://dev.to/opencoder/summing-up-my-first-sprint-on-hax-6b0</link>
      <guid>https://dev.to/opencoder/summing-up-my-first-sprint-on-hax-6b0</guid>
      <description>&lt;p&gt;If you haven't read any of my other posts, I've recently began contributing to an open source project called &lt;a href="https://haxtheweb.org/"&gt;HAX&lt;/a&gt;. HAX is an effort to build tools usable by anyone in every platform. Think WordPress but without the PHP constraints.&lt;/p&gt;

&lt;p&gt;Anyways, my &lt;a href="https://twitter.com/btopro"&gt;professor&lt;/a&gt; is the creator and gave interested students the option to skip the final project and pick up an issue on his project and fix it. So for the past couple of weeks we've been writing code, doing code reviews, talking about Web Components, LitElement, and a bunch of other front-end rabbit holes. It has been a really fun experience, and I've learned more about open source and web development in a couple weeks than I have in other classes. Today, I want to reflect on the experience and talk about my contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  The eXperience
&lt;/h2&gt;

&lt;p&gt;The first class we started developing, we all chose an issue in the issue queue. Previously, I've talked about a property I added to another component for making a wikipedia-query tag that works with any wikipedia language. So I thought, "I have some experience. Let's try something harder." And that's where I went wrong. So I picked up an issue that was to enable a "learning mode" for their &lt;a href="https://github.com/elmsln/lrnwebcomponents/tree/master/elements/a11y-media-player"&gt;video player&lt;/a&gt; that basically disables the ability to fast forward, rewind, replay, enable transcript, etc. The use case is for quizzes or training where you want to ensure the user is viewing the entire video and not skipping around or searching for key terms.&lt;/p&gt;

&lt;p&gt;I didn't realize how intense the video player component was, and I ended up spending the next two weeks trying to understand how it worked, and to simply pass a boolean prop from one component to another. After a lot of errors and slack messaging my professor, I finally got it to work. However, throughout the process I didn't regret the issue I chose, because every class we were going over someone else's component which made for a really great learning experience.&lt;/p&gt;

&lt;p&gt;I think this is a fresh approach to learning how to code, because every student had their issues, and we got to see how they overcame them. This gave us all the ability to experience their failures as well as their solutions, so we all learned together. So even though I was just arbitrarily learning about a massive component, I got to learn a lot more about LitElement from what my peers were showing in class.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Contribution
&lt;/h2&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/elmsln/lrnwebcomponents/pull/528"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg"&gt;
      &lt;span class="issue-title"&gt;
        enableLearningMode start
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#528&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/btopro"&gt;
        &lt;img class="github-liquid-tag-img" src="https://res.cloudinary.com/practicaldev/image/fetch/s--AqYTuIoQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://avatars.githubusercontent.com/u/329735%3Fv%3D4" alt="btopro avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/btopro"&gt;btopro&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/elmsln/lrnwebcomponents/pull/528"&gt;&lt;time&gt;Apr 27, 2021&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      
    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/elmsln/lrnwebcomponents/pull/528"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;I've posted my PR for the code I worked on for this sprint. To give a basic rundown of what I had to do it was split between working on the a11y-media-player element and the hax properties in video-player. &lt;/p&gt;

&lt;p&gt;What I did in a11y-media-player was add a new property called learningMode that is set to default by false. In this element there was already a prop called disableSeek which turned off the ability to drag the video player slider and click the forward, backward and replay buttons. I then had to add a statement to the updated function that sets the value of disableSeek to the value of learningMode. I then copied this format with disableTranscript to get the transcript to be hidden when learning mode is enabled. Finally, I had to add these three properties to the hidden and disabled attributes for all the different buttons of the video player in the a11y-media-player.html file.&lt;/p&gt;

&lt;p&gt;For the hax properties file in video-player, I only had to add learningMode as a property to the json file where I described what it does. You also declare it as boolean here, and then add it to the tag. This enables a checkbox in the actual h-a-x editor for selecting learning mode for the video you want to add.&lt;/p&gt;

&lt;p&gt;Throughout this process I learned a lot about the larger elements in HAX and what it's like to work with large web components. I'm glad I got to figure out how to navigate this element, as well as learn about what my fellow classmates were doing. In the fall I will be taking this course again with the same professor who wants to make the class all about web development and code reviews. So I am very much looking forward to keeping this blog alive and learning more like we did the past two weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video coming soon.... after finals.... and I take a couple days to enjoy doing nothing...
&lt;/h2&gt;

</description>
    </item>
    <item>
      <title>Why use Microservice Server Architecture?</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sat, 10 Apr 2021 19:02:49 +0000</pubDate>
      <link>https://dev.to/opencoder/why-use-microservice-server-architecture-27ee</link>
      <guid>https://dev.to/opencoder/why-use-microservice-server-architecture-27ee</guid>
      <description>&lt;p&gt;Traditionally, software server architecture has been described as a monolith, where all of the resources are hosted in one large environment. Within the past few years, DevOps specialists at many different countries around the world have been able to design a far more approved approach to server architecture called microservices.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Microservices?
&lt;/h2&gt;

&lt;p&gt;A microservice is a small piece of the backend of a software application which runs in a virtualized environment. We can use these microservices to handle highly specific operations like authorizing a login or retrieving data from an API. By splitting these tasks up, we can encapsulate the functionality of the backend into thousands of tiny container instances. These containers can be running anywhere around the world, and we have the ability to destroy them and rebuild whenever we want. So, why do we take this approach to server architecture?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Monolith?
&lt;/h2&gt;

&lt;p&gt;A monolith server architecture basically keeps all of your resources, APIs, nodes, etc. in one large server. All of the infrastructure for your application is kept together, which means if one thing fails, it can crash your entire project. Now not all the software can be kept in one place, but the majority of it is kept together and all directly connected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Microservices
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o4gicg6Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ynfszp73iqb9yqn05m9n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o4gicg6Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ynfszp73iqb9yqn05m9n.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Microservices bring a unique advantage over the monolith server architecture. We can completely separate all the different functions of our backend into separate parts that can all be scatter across our network. This way their problems and errors don't affect each other. Also, this gives us the ability to update, delete, move, or create new microservices very easily. Because containers are so flexible, we can restart them and put them wherever we want. Lastly, we also have the ability to expand by simply adding new containers with microservices. We don't have to worry about the affect of adding and removing nodes on the entire project, as our system can be easily scaled without having to understand the inner workings of every container.&lt;/p&gt;

&lt;p&gt;As you can see, there are some major benefits to using a microservice architecture. It gives large projects the ability to separate concerns between the different functions of their software. Along with this, we can easily scale a highly flexible system, all by using configured code running in virtualized containers.&lt;/p&gt;
&lt;h2&gt;
  
  
  Video Demo
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/WwmZYTMTYrU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Contributing to Open Source</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 04 Apr 2021 17:51:42 +0000</pubDate>
      <link>https://dev.to/opencoder/contributing-to-open-source-4k3f</link>
      <guid>https://dev.to/opencoder/contributing-to-open-source-4k3f</guid>
      <description>&lt;p&gt;Over the past two weeks, I've made my first 3 commits to a real, open source project. Open source has been something I've been passionate for around 2 years now, and its one of the trends in technology right now that I really enjoy learning more about. Today, I'm going to talk about what it's like to contribute to open source software, and how you can get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  The First Commit
&lt;/h2&gt;

&lt;p&gt;I think the easiest way to get started is do something completely irrelevant to the code. Let's say you find a cool project on GitHub, and you want to get involved. Don't start by trying to find the biggest software bug in their system or trying to solve an issue that's been in the queue for months with no one being able to fix it. These bugs will kill your spirit, since you have no idea what the intricacies of the project are. Start by finding a super simple issue in the queue that no one wants to waste time on, or even fix a typo in the README or on one of the pages. For example, my first commit to &lt;a href="https://github.com/elmsln/lrnwebcomponents"&gt;HAX&lt;/a&gt; was changing the word "You're" to "Your" in one of the demos. Stuff like this will help you get your name on the project, and you'll begin to understand the layout of the project and the other contributors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Connected
&lt;/h2&gt;

&lt;p&gt;I can't really say much about this, since the founder of the project I worked on is my professor. However, if you can find someone to message that is a consistent developer on the project, you will save yourself a lot of trouble. People who are passionate about a project will want to help you. They'll tell you what issues to go after, what future development tasks you could start, or help you when you get stuck. Don't be afraid to reach out, because developers need help on these things. Open source relies on the idea that your project can get contributions from people outside your team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Big Projects are Fun to Work On
&lt;/h2&gt;

&lt;p&gt;If you can find a sizable project that really interests you, you'll get a ton out of it. I love personal projects and creating random ideas that I have, but these things are short lived usually. I don't work out all the kinks. I hack it together, and go "Look what I made! Click that! Whoa nice transition!" and then forget about it. With a real project, you can get your hands dirty, mess with the code, add a cool feature, and people will actually use it. There's a different kind of joy you get, cause you know the project won't be a forgotten graveyard in someone's GitHub. Find something you love and dive into it when you start to get comfortable. I promise you'll enjoy it more than work and more than your other projects, because it's some of the most meaningful code you'll ever write.&lt;/p&gt;

&lt;p&gt;So that's my introduction to contributing to open source. I'm still new, but this certainly won't be the end of my open source development journey. I hope you enjoy working on this stuff as much as I do!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Repo and My Recent Contribution
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/elmsln"&gt;
        elmsln
      &lt;/a&gt; / &lt;a href="https://github.com/elmsln/lrnwebcomponents"&gt;
        lrnwebcomponents
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      @lrnwebcomponents Monorepo for NPM based element definitions
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
lrnwebcomponents&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://opensource.org/licenses/Apache-2.0" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License: Apache 2.0"&gt;&lt;/a&gt;
&lt;a href="https://lerna.js.org/" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/3bc63f921dd60bac6d91aa900ef570c928b2aa4c2124ed23647e8fe9d2232853/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e6564253230776974682d6c65726e612d6363303066662e737667" alt="lerna"&gt;&lt;/a&gt;
&lt;a href="https://lit.dev/" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/0bfaa1c84ba5d611a6ab1d9d5a2907e1914c9c3c57c8dbc8b5cfe5ecedc6f985/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c69742d3332346666663f7374796c653d666c6174266c6f676f3d646174613a696d6167652f737667253262786d6c3b6261736536342c50484e325a79426d615778735053496a5a6d5a6d4969423261575633516d393450534977494441674d545977494449774d43496765473173626e4d39496d6830644841364c79393364336375647a4d7562334a6e4c7a49774d44417663335a6e496a3438634746306143426b50534a744d54597749446777646a6777624330304d4330304d4870744c54517749445177646a6777624451774c545177656d30774c546777646a6777624330304d4330304d4870744c54517749445177646a6777624451774c545177656d30744e4441744e4442324f4442734e4441744e444236625451774c545177646a6777624330304d4330304d4870744c545177494445794d4859344d4777744e4441744e444236625330304d4330304d4859344d4777304d4330304d486f694c7a34384c334e325a7a34253344" alt="Lit"&gt;&lt;/a&gt;
&lt;a href="https://haxtheweb.org/" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/7167458bbac476314240ffa0d0772d83641a4c5fcffe7ebc9920ad2b50bd3a7a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4841585468655765622d39393939393946463f7374796c653d666c6174266c6f676f3d646174613a696d6167652f737667253262786d6c3b6261736536342c50484e325a7942705a4430695a6d56684d5445785a5441744d6a45775a433030593251774c574a684d5751745a475a6d4f5451794f4463304e6a67314969426b595852684c57356862575539496b78686557567949444569494868746247357a50534a6f644852774f693876643364334c6e637a4c6d39795a7938794d4441774c334e325a794967646d6c6c64304a76654430694d434177494445344e4334304944457a4e5334354e79492b5047526c5a6e4d2b50484e306557786c5069356c4d574a6a4d6a41794e5330784f4441774c54526b597a49744f4463344e53316a4e445a6c5a4445774d3259304f544a375a6d6c7362446f6a4d6a4d785a6a49774f3330384c334e306557786c506a77765a47566d637a3438634746306143426a6247467a637a30695a544669597a49774d6a55744d5467774d4330305a474d794c5467334f445574597a51325a5751784d444e6d4e446b794969426b50534a4e4e7a67754d4463734f444d754e4456574e5456494f4459754d6e59344c6a457a614445324c6a4932646a51754d44646f4e4334774e3159344d7934304e5567354f433430566a59334c6a4535534467324c6a4a574f444d754e4456614969382b5048427662486c6e6232346763473970626e527a505349784e544d754d544d674e6a4d754e7941784e544d754d544d674e5445754d7a6b674d5451774c6a5530494455784c6a4d35494445304d4334314e43417a4f5334774f5341784d6a63754f5455674d7a6b754d446b674d5449334c6a6b31494449324c6a6335494445774d6934334f4341794e6934334f5341784d4449754e7a67674d7a6b754d446b674d5445314c6a4d3249444d354c6a4135494445784e53347a4e6941314d53347a4f5341784d6a63754f5455674e5445754d7a6b674d5449334c6a6b314944597a4c6a63674d5451774c6a55304944597a4c6a63674d5451774c6a553049446332494445794e79347a4e6941334e6941784d6a63754d7a59674f4467754d7941784d5451754e7a67674f4467754d7941784d5451754e7a67674d5441774c6a5978494445774d6934784f5341784d4441754e6a45674d5441794c6a4535494445784d6934354d5341784d6a63754d7a59674d5445794c6a6b78494445794e79347a4e6941784d4441754e6a45674d544d354c6a6b31494445774d4334324d5341784d7a6b754f5455674f4467754d7941784e5449754e5451674f4467754d7941784e5449754e5451674e7a59674d5459314c6a637949446332494445324e5334334d6941324d793433494445314d7934784d7941324d7934334969382b5048427662486c6e6232346763473970626e527a5053497a4d7934784d7941324d79343349444d7a4c6a457a494455784c6a4d35494451314c6a6379494455784c6a4d35494451314c6a637949444d354c6a4135494455344c6a4d7849444d354c6a4135494455344c6a4d78494449324c6a63354944677a4c6a5134494449324c6a63354944677a4c6a513449444d354c6a4135494463774c6a673549444d354c6a4135494463774c6a6735494455784c6a4d35494455344c6a4d78494455784c6a4d35494455344c6a4d784944597a4c6a63674e4455754e7a49674e6a4d754e7941304e5334334d6941334e6941314f4334344f5341334e6941314f4334344f5341344f43347a494463784c6a5134494467344c6a4d674e7a45754e4467674d5441774c6a5978494467304c6a4133494445774d4334324d5341344e4334774e7941784d5449754f5445674e5467754f446b674d5445794c6a6b78494455344c6a6735494445774d4334324d5341304e69347a4d5341784d4441754e6a45674e4459754d7a45674f4467754d79417a4d7934334d6941344f43347a49444d7a4c6a637949446332494449774c6a553049446332494449774c6a55304944597a4c6a63674d7a4d754d544d674e6a4d754e794976506a777663335a6e50673d3d" alt="#HAXTheWeb"&gt;&lt;/a&gt;
&lt;a href="https://github.com/prettier/prettier"&gt;&lt;img src="https://camo.githubusercontent.com/8091bbf129a8b32d477a2c246ad58a0bf8c1539bccf71098604ecf78c7ca2206/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d70726574746965722d6638626334352e737667" alt="code style: prettier"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.npmjs.com/search?q=%40lrnwebcomponents" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/218ed692aea5313bc194ba72a5beace34df97d2c65b448684511ee7cda630607/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f406c726e776562636f6d706f6e656e74732f682d612d783f7374796c653d666c6174" alt="Published on npm"&gt;&lt;/a&gt;
&lt;a href="https://github.com/elmsln/lrnwebcomponents/actions?query=branch%3Amaster"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hnf6wFJd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/elmsln/lrnwebcomponents/workflows/build/badge.svg%3Fbranch%3Dmaster" alt="build"&gt;&lt;/a&gt;
&lt;a href="https://david-dm.org/elmsln/lrnwebcomponents" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/fed430f3bdb5150c27574523f47ab769ce7a9382e28808e54e7911890370f294/68747470733a2f2f696d672e736869656c64732e696f2f64617669642f656c6d736c6e2f6c726e776562636f6d706f6e656e74732e7376673f7374796c653d666c6174" alt="Dependency Status"&gt;&lt;/a&gt;
&lt;a href="https://www.webcomponents.org/author/elmsln" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/fa095f7c7b24972f3525b39a6f31c15626f3a4cc019314b4f19ad88ccfd47ddb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f776562636f6d706f6e656e74732e6f72672d7075626c69736865642d626c75652e737667" alt="Published on webcomponents.org"&gt;&lt;/a&gt;
&lt;a href="https://bit.ly/haxslack" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/2304fa52b2a58f1d8aa7c4394da6d65ca2d32b906f97c9c835fba875e76a5ce4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636861742532306f6e2d736c61636b2d3732383964612e737667" alt="Slack"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/intent/follow?screen_name=haxtheweb" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/2cf01ca81ef57f3b4b6a4e17abe245db72761f5a829de9c0a473789c4cef52ac/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6861787468657765622e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77" alt="Twitter"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Welcome to the lrnwebcomponents project!&lt;/h1&gt;
&lt;p&gt;ELMS:LN produced web components for any project&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/elmsln/elmsln-logos/blob/master/haxtheweb/2019-08-14_13-05-52.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ScQqL_Va--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/elmsln/elmsln-logos/raw/master/haxtheweb/2019-08-14_13-05-52.png" alt="Logo"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Quick-start&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Notice: You will need to use &lt;a href="https://nodejs.org/en/" rel="nofollow"&gt;Node&lt;/a&gt; version 6.0 or higher. Verify that you have yarn enabled — if not &lt;a href="https://yarnpkg.com/lang/en/docs/install/" rel="nofollow"&gt;install yarn globally&lt;/a&gt;. These web components are written in &lt;a href="http://es6-features.org/" rel="nofollow"&gt;ES6&lt;/a&gt; and build routines compile to es5 to encompass legacy browsers.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
Quick Install&lt;/h3&gt;
&lt;div class="highlight highlight-source-shell position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;curl -fsSL https://raw.githubusercontent.com/elmsln/lrnwebcomponents/master/scripts/lrnwebcomponentsme.sh -o lrnwebcomponentsme.sh &lt;span class="pl-k"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sh lrnwebcomponentsme.sh&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
Manual Install&lt;/h3&gt;
&lt;div class="highlight highlight-source-shell position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;git clone https://github.com/elmsln/lrnwebcomponents.git
&lt;span class="pl-c1"&gt;cd&lt;/span&gt; lrnwebcomponents
yarn global add @wcfactory/cli
yarn global add polymer-cli
yarn global add @web/test-runner
yarn global add @web/test-runner-commands
yarn global add @web/test-runner-puppeteer
yarn global add @web/test-runner-playwright
yarn global add lerna
yarn global add web-component-analyzer
yarn install&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
Syncing Your Fork&lt;/h3&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;git remote add upstream https://github.com/elmsln/lrnwebcomponents.git
git fetch upstream
git pull
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
Windows&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://git-scm.com/" rel="nofollow"&gt;Git bash&lt;/a&gt; should already be installed on your Windows machine and can be found by searching through your computer's applications or by right-clicking anywhere inside of the File Explorer
&lt;a href="https://www.cygwin.com/" rel="nofollow"&gt;Cygwin&lt;/a&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/elmsln/lrnwebcomponents"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5XL7ecQXUh8"&gt;
&lt;/iframe&gt;


</description>
    </item>
    <item>
      <title>Why use Web Components?</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Sun, 28 Mar 2021 23:23:59 +0000</pubDate>
      <link>https://dev.to/opencoder/why-use-web-components-8ph</link>
      <guid>https://dev.to/opencoder/why-use-web-components-8ph</guid>
      <description>&lt;p&gt;Component structured web pages are nothing new in 2021, yet you can still find tons of websites and content management systems not taking advantage of all their benefits. Today, I will be going over why large companies should start using web components to build their sites, and the major benefits they provide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shadow DOM
&lt;/h2&gt;

&lt;p&gt;Web components use the Shadow DOM to separate the document model for component from the rest of the DOM it is in. It works similarly to a video element or iframe where the element's attributes and CSS can't be changed by the rest of the page, and likewise, it's own attributes can't change the rest of the page. This is useful for large companies as they have thousands of developers who are all creating their own pages and components. If you want to interchangeably use components on a page, you won't need to worry about messing up the styling of the rest of the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ease of Use
&lt;/h2&gt;

&lt;p&gt;Although there are some new standards and practices to learn, once you're up and running, you can simply add or create new custom elements to your page with ease. Once a custom element has been published, you can add it into the top of your HTML page with a script tag using the module attribute. This means you don't have to worry about anything going on under the hood, and you don't need a build sequence to use the element. You can simply add it and start running with it. This is especially huge for large companies, as anyone can publish a custom element like a standard logo for their company and then everyone who needs to use the logo on a page just adds the custom HTML to their page after initializing the module. &lt;/p&gt;

&lt;h2&gt;
  
  
  Custom Elements don't rely on huge projects
&lt;/h2&gt;

&lt;p&gt;This is a fairly straightforward point, but it seems like most people don't take into account how big of a deal this can be. Many web development frameworks and projects can have version breaking changes that sometimes require completely rewriting your system. On top of this you usually need other tooling to help keep your component versions consistent across large sites. With custom elements, you're creating everything with mostly vanilla JS, and you're not going to rely on companies that create frameworks like React or Angular. This is important for large companies who have many developers making different sites, as a single change won't break everything. You can also use different methods for making sure all of your custom elements are running the correct versions.&lt;/p&gt;

&lt;p&gt;As you can see, there's some major benefits to using web components. It's important that these standards continue to be adopted by smaller players in the web development community, so that we can continue to build a future web where components are easily shared and work for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video Demo
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zYVV5Ei6YVw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create your own GitLab instance with Reclaim.Cloud</title>
      <dc:creator>The Open Coder</dc:creator>
      <pubDate>Fri, 19 Feb 2021 20:42:18 +0000</pubDate>
      <link>https://dev.to/opencoder/create-your-own-gitlab-instance-with-reclaim-cloud-343c</link>
      <guid>https://dev.to/opencoder/create-your-own-gitlab-instance-with-reclaim-cloud-343c</guid>
      <description>&lt;p&gt;So you're tired of using GitHub and you want a custom, secure alternative? Well, you've come to the right place. Today, I'm going over a really simple way to set up your own GitLab instance using reclaim.cloud. &lt;a href="https://reclaim.cloud/"&gt;Reclaim.cloud&lt;/a&gt; is a cloud hosting service that allows you to pay for what you use rather than pay for limits and not use all of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Sign up for an account at &lt;a href="https://reclaim.cloud/signup/"&gt;https://reclaim.cloud/signup/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Upgrade to a professional account (you'll need the pro account in order to give you enough computing power to host a GitLab server)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Set up and install
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://reclaim.cloud/applications/"&gt;https://reclaim.cloud/applications/&lt;/a&gt; and click on the DevOps Lab - GitLab Server. Type in your email address and you should receive an email with a link to deploy the server.&lt;/p&gt;

&lt;p&gt;After signing in you'll see that you can change the domain name to whatever you like (if its available) and you can change the display name in your reclaim.cloud dashboard. It should automatically pick a server region that is best for you.&lt;/p&gt;

&lt;p&gt;Once you're done with that continue to install and you'll need to wait a while for the server to install and set up. Eventually you'll get two emails, one saying it's done installing, and a second saying it has been deployed. When you return to the dashboard, it should say the server deployed, and it will give you the root password, which you should take note of for using later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure your server
&lt;/h2&gt;

&lt;p&gt;Now before we try to sign in, go to your reclaim.cloud dashboard and click on the change environment topology icon under your GitLab Server's display name. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kenVWg5d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ak4uuqtsuo1b3txpaezp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kenVWg5d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ak4uuqtsuo1b3txpaezp.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should see a bunch of different configurations you can apply to your server. For this instance, we just need to increase the cloudlets to the maximum value of 32 under Vertical Scaling per Node so that our server has enough CPU power and RAM to handle running GitLab.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t7yX4aKy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kaurqpl0lq3lmipqj4pg.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t7yX4aKy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kaurqpl0lq3lmipqj4pg.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Test it out!
&lt;/h2&gt;

&lt;p&gt;Now you can launch your GitLab server by pressing Open in Browser or by typing your domain name into your search engine's URL search. You can sign in using the root admin sign in information that you got before, and then you can begin using GitLab like normal. &lt;/p&gt;
&lt;h2&gt;
  
  
  Why companies should use GitLab
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Authentication
&lt;/h4&gt;

&lt;p&gt;GitLab has a clear advantage over GitHub here, by giving you all the control with the security of the server and it's data. You can set the access levels to just about anything and use different groupings of employees to set these levels. In GitHub, once you're invited to a repo or group, you can only be set by read or write privileges for everything.&lt;/p&gt;
&lt;h4&gt;
  
  
  DevOps and CI
&lt;/h4&gt;

&lt;p&gt;GitLab has been focusing on it's CI for much longer than GitHub, which means it is just better and more customizable (and free). You can also integrate other CI platforms if you don't want to use the standard GitLab CI. GitHub on the other hand does have CI, but it is lacking in comparison to GitLab, since it doesn't have a deployment platform and requires additional set up with other applications like Heroku.&lt;/p&gt;
&lt;h4&gt;
  
  
  Customizability
&lt;/h4&gt;

&lt;p&gt;As a GitLab admin, you can basically control anything you want in your repos. Other than working with the authentication scopes of users and CI pipelines, you can track analytics, PRs, and issues, as well as manage different operations (like Kubernetes) and packages.&lt;/p&gt;

&lt;p&gt;Read more &lt;a href="https://usersnap.com/blog/gitlab-github/"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  My Final Opinion
&lt;/h2&gt;

&lt;p&gt;I personally love having the ability to customize so many different things in GitLab. I plan on using a Raspberry Pi to set up a home Git server at some point just to play around with. What's great about having the option between GitLab and GitHub, is they each have their own time and space. If I was working on a company project with a DevOps team, QE team, Developers, and Project Managers then GitLab is perfect, since you can set scopes and integrate anything. However, if you just want to upload personal apps, collaborate on open source projects, and show off your talent to potential employers, then GitHub is perfectly fine and easy to use under these circumstances. For my personal needs I like GitHub, but I hope that any team I work with in the future uses GitLab.&lt;/p&gt;
&lt;h2&gt;
  
  
  How-to Video
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/b_KRcWPo1lA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
