<?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: Dan Bamikiya</title>
    <description>The latest articles on DEV Community by Dan Bamikiya (@danbmky).</description>
    <link>https://dev.to/danbmky</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%2F333537%2Ff0084421-1702-476a-87dc-c4715abbbef3.png</url>
      <title>DEV Community: Dan Bamikiya</title>
      <link>https://dev.to/danbmky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danbmky"/>
    <language>en</language>
    <item>
      <title>The real image tag: &lt;image&gt; vs &lt;img&gt;</title>
      <dc:creator>Dan Bamikiya</dc:creator>
      <pubDate>Thu, 17 Feb 2022 12:26:23 +0000</pubDate>
      <link>https://dev.to/danbmky/the-real-image-tag-vs-2jpd</link>
      <guid>https://dev.to/danbmky/the-real-image-tag-vs-2jpd</guid>
      <description>&lt;p&gt;The image tag is used to tell the web browser to display an image.&lt;br&gt;
It is usually written as &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; and can have attributes such as (but not limited to) &lt;code&gt;src&lt;/code&gt; - used to specify the path to the image, &lt;code&gt;alt&lt;/code&gt; - holds a text description of the image, important for accessibility, &lt;code&gt;width&lt;/code&gt; - the intrinsic width of the image(in pixels).&lt;/p&gt;

&lt;p&gt;Now you're wondering what about the &lt;code&gt;&amp;lt;image /&amp;gt;&lt;/code&gt; tag right? Well the &lt;code&gt;image&lt;/code&gt; tag is (or was) used to display images also! But its infact not an HTML element!(as written in the spec):&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpi2vb5836g17wq0m55nx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpi2vb5836g17wq0m55nx.png" alt="an image of the html parsing spec about the image tag not being an html element"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Browsers alias it to the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element but differently;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firefox aliases it during parse time;&lt;/li&gt;
&lt;li&gt;Chrome &amp;amp; Safari aliases it during element-creation time;&lt;/li&gt;
&lt;li&gt;IE (Internet Explorer) aliases it throughout runtime;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;as seen in the html parsing spec:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6alkwmdwmmfgy7cnrm9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6alkwmdwmmfgy7cnrm9i.png" alt="an image of the html parsing spec about how browsers should handle the image tag"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://html.spec.whatwg.org/multipage/parsing.html" rel="noopener noreferrer"&gt;https://html.spec.whatwg.org/multipage/parsing.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you can use it in your code and the browser will do what needs to be done(convert it to &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt;) and process your code but is it valid HTML? No.&lt;/p&gt;

&lt;p&gt;Well what about its behaviour during DOM manipulation?&lt;/p&gt;

&lt;p&gt;Assigning its &lt;code&gt;src&lt;/code&gt; value the path to an image:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;scr&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://source.unsplash.com/random/150*150&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;doesn't work in Edge, Chrome, &amp;amp; Firefox but works in IE.&lt;/p&gt;

&lt;p&gt;Creating the element and appending it to the DOM:&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;const&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://source.unsplash.com/random/150*150&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Edge &amp;amp; Chrome &amp;amp; Firefox treats it as an unknown element and doesn't load the image but it works in IE.&lt;/p&gt;

&lt;p&gt;So the real image tag is the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag and the &lt;code&gt;&amp;lt;image&amp;gt;&lt;/code&gt; tag is a tag that browsers aliases to &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element. &lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My First Contribution to the Kubernetes Project ♾</title>
      <dc:creator>Dan Bamikiya</dc:creator>
      <pubDate>Fri, 22 Oct 2021 10:24:23 +0000</pubDate>
      <link>https://dev.to/danbmky/my-first-contribution-to-the-kubernetes-project-481k</link>
      <guid>https://dev.to/danbmky/my-first-contribution-to-the-kubernetes-project-481k</guid>
      <description>&lt;p&gt;My first contribution to the Kubernetes project got merged on Github! 😁&lt;/p&gt;

&lt;p&gt;What did I do 🤷‍♂️?&lt;br&gt;
I contributed to the Kubernetes Dashboard repo. The Kubernetes Dashboard is a web-based UI for managing Kubernetes applications running in Kubernetes clusters and troubleshooting them. As well as managing the cluster itself.&lt;/p&gt;

&lt;p&gt;The web-based dashboard which is built with Angular and TypeScript still had external referencing HTTP links even for ingress host URLs in the ingress lists which is a bad security practice for web apps.&lt;/p&gt;

&lt;p&gt;I converted the HTTP links to default HTTPS links making any referenced external link direct users to secure website URLs!&lt;/p&gt;

&lt;p&gt;Felt great! 😊&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>github</category>
      <category>kubernetes</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>A quick note on performance:</title>
      <dc:creator>Dan Bamikiya</dc:creator>
      <pubDate>Mon, 01 Mar 2021 20:54:03 +0000</pubDate>
      <link>https://dev.to/danbmky/a-quick-note-on-performance-2k6f</link>
      <guid>https://dev.to/danbmky/a-quick-note-on-performance-2k6f</guid>
      <description>&lt;p&gt;We use &lt;code&gt;display: none&lt;/code&gt; instead of &lt;code&gt;opacity: 0&lt;/code&gt; to hide elements/ implementation details. &lt;br&gt;
But opacity is a &lt;strong&gt;better&lt;/strong&gt; choice for performance because it is one of the things the browser can use the GPU to animate, a process known as hardware acceleration.&lt;br&gt;
Using the GPU leads to smoother animation as the browser does not have to re-paint the areas of the screen that are animating. Instead, the browser paints the elements to be animated to "layers" that are uploaded to the GPU, which it can then animate.&lt;br&gt;
Note that the browser doesn't always create new layers for the GPU when you want it to, so you can force it to do so by setting certain properties like &lt;code&gt;backface-visibility&lt;/code&gt; (old) or &lt;code&gt;will-change&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Examples where you might use will-change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where you have an element whose transform property is used to animate or add some sort of effect adding &lt;code&gt;will-change: transform&lt;/code&gt; tells the browser this property of the element will change in the near future then the browser can choose to apply any ahead-of-time optimizations required for the property change before the property change actually happens.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;will-change: opacity&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;will-change: scroll-position&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;will-change: contents&lt;/code&gt; (something about the element’s contents will change in the near future).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Having said these there are few caveats to using will-change:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The browser already tries as hard as it can to optimize everything so do not apply will-change to too many elements.&lt;/li&gt;
&lt;li&gt;Will-change is intended to be used as something of a last resort, in order to try to deal with existing performance problems. Don't apply will-change to elements to perform premature optimization. :)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With this relatively short post I hope I've been able to add to your wealth of knowledge! :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;To know more about the will-change property visit&lt;/em&gt; &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/will-change"&gt;&lt;strong&gt;MDN&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>css</category>
      <category>webdev</category>
      <category>webapp</category>
    </item>
  </channel>
</rss>
