<?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: Ibrahim Tanyalcin</title>
    <description>The latest articles on DEV Community by Ibrahim Tanyalcin (@ibrahimtanyalcin).</description>
    <link>https://dev.to/ibrahimtanyalcin</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%2F83415%2F29c0b1ae-ffef-4c83-b3f7-c74535203713.jpeg</url>
      <title>DEV Community: Ibrahim Tanyalcin</title>
      <link>https://dev.to/ibrahimtanyalcin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibrahimtanyalcin"/>
    <language>en</language>
    <item>
      <title>simple-chat-demo</title>
      <dc:creator>Ibrahim Tanyalcin</dc:creator>
      <pubDate>Wed, 28 May 2025 19:21:40 +0000</pubDate>
      <link>https://dev.to/ibrahimtanyalcin/simple-chat-demo-39ak</link>
      <guid>https://dev.to/ibrahimtanyalcin/simple-chat-demo-39ak</guid>
      <description>&lt;p&gt;A drop in native web component that you can use with any framework.&lt;/p&gt;

&lt;p&gt;This is native web component written by Cahir (&lt;a href="https://github.com/IbrahimTanyalcin/Cahir" rel="noopener noreferrer"&gt;https://github.com/IbrahimTanyalcin/Cahir&lt;/a&gt;) that can be used in conjunction with ChatGPT like LLM APIs. &lt;/p&gt;

&lt;p&gt;The UI is separate from the backend representation so you are completely free to customize and use your parser as you see fit. The parser function has an extensive signature that allows you to simulate or stream node strings.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/IbrahimTanyalcin/embed/VYZNOvX?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
    <item>
      <title>Vantage Point - Combining the imperative and the declerative</title>
      <dc:creator>Ibrahim Tanyalcin</dc:creator>
      <pubDate>Fri, 20 Oct 2023 15:30:15 +0000</pubDate>
      <link>https://dev.to/ibrahimtanyalcin/vantage-point-combining-the-imperative-and-the-declerative-4fdk</link>
      <guid>https://dev.to/ibrahimtanyalcin/vantage-point-combining-the-imperative-and-the-declerative-4fdk</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QxwILHJC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy7iibn2w5jlmb4dkhbr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QxwILHJC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy7iibn2w5jlmb4dkhbr.png" alt="vantage" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I always take the new shiny bits from TC39 with a pinch of salt. I have been honest about some of the &lt;a href="https://medium.com/@ibowankenobi/the-amazing-yield-b49710207703"&gt;additions to the language&lt;/a&gt; before, but this will be a good one. &lt;/p&gt;

&lt;p&gt;For me it has always been a pain, not to be able to respond to arbitrary property accesses without some safety net. Whether we are talking about a &lt;code&gt;Class&lt;/code&gt; or an &lt;code&gt;Object&lt;/code&gt;, your options were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hardcode the property from an &lt;code&gt;array-like&lt;/code&gt; using &lt;code&gt;[[Set]]&lt;/code&gt; or &lt;code&gt;defineProperties&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;dodge the error using optional chaining or nullish coalescence&lt;/li&gt;
&lt;li&gt;create a method on the prototype chain that accepts an arbitrary string, corresponding to the property to be accessed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of the above feels natural, aka, you cannot do: &lt;code&gt;someObj.someArbitraryString&lt;/code&gt; and return something other than &lt;code&gt;undefined&lt;/code&gt;. For that reason &lt;code&gt;Proxy&lt;/code&gt; was a great addition to the language simply because a polyfill was not possible.&lt;/p&gt;

&lt;p&gt;Proxies empowered ALL of the objects in JS. Not just Arrays, Objects, Maps etc, but functions too. I want to talk about the function part, because a pattern that I unconsciously started using for over a year kept coming back and proved to be extremely useful. It stayed on the shelf for some time while I used it, and now I have at least something little to show.&lt;/p&gt;

&lt;p&gt;Consider this:&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;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="cm"&gt;/* returns a li DOM object */&lt;/span&gt;
&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="cm"&gt;/* returns a div DOM object */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One would think it is some sort of a class or object that has a method, no it is not:&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;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;whatever&lt;/span&gt; &lt;span class="cm"&gt;/* &amp;lt;whatever&amp;gt;&amp;lt;/whatever&amp;gt; */&lt;/span&gt;
&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;whatever&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;innerHTML&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;what?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cm"&gt;/* &amp;lt;whatever&amp;gt;what?&amp;lt;/whatever&amp;gt; */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;taking it a step further:&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;ch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;`
sappend &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
set innerHTML &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;what?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
style &lt;/span&gt;&lt;span class="p"&gt;${[[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;width&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;40dvw&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;height&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;auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]]}&lt;/span&gt;&lt;span class="s2"&gt;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above 'sappend' is short for 'select and then append'. A bit more with shortcuts to commands:&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;ch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&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="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
&amp;gt;&amp;gt; innerHTML &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;what?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
style &lt;/span&gt;&lt;span class="p"&gt;${[[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;width&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;40dvw&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;height&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;auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]]}&lt;/span&gt;&lt;span class="s2"&gt;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and why not alternate between template literals and classic function calls:&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;ch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&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="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
&amp;gt;&amp;gt; innerHTML &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;what?&lt;/span&gt;&lt;span class="dl"&gt;"&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="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;([[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;width&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;40dvw&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;height&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;auto&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="nx"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="p"&gt;)...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or maybe this is better?:&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;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;&lt;span class="s2"&gt;`
    &amp;lt;li&amp;gt;
        &amp;lt;span style="width: 40dvw;"&amp;gt;what?&amp;lt;/span&amp;gt;
    &amp;lt;/li&amp;gt;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;what about children?:&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;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;&lt;span class="s2"&gt;`
    &amp;lt;li&amp;gt;
        &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;span style="width: 40dvw;"&amp;gt;what?&amp;lt;/span&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;
    &amp;lt;/li&amp;gt;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;wait a second, what if:&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;ch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`li{"attr":[["data-name", "I am a li"]]}`&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;styles, attributes may work like above, what about props??&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;ch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`li{
"attr": [["data-name", "I am a li"]],
"prop": [["a",&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;], ["b", &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="mi"&gt;4&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;does it mean you could do?:&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;ch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`li{
"attr": [["data-name", "I am a li"]],
"prop": [["innerHTML", "what?"]]
}`&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can we combine them all?:&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;ch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`li{
"attr": [["data-name", "I am a li"]],
"prop": [["innerHTML", "what?"]]
}`&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="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;&lt;span class="s2"&gt;`
            &amp;lt;span&amp;gt;
                &amp;lt;i&amp;gt;HELLO!&amp;lt;/i&amp;gt;
            &amp;lt;/span&amp;gt;
        `&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="nx"&gt;selected&lt;/span&gt; &lt;span class="c1"&gt;//logs the li element&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Marking a &lt;code&gt;parentNode&lt;/code&gt; or any other variable to do something with it later:&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;ch&lt;/span&gt;&lt;span class="s2"&gt;`
-&amp;gt; myLi:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;
    &lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`li{
        "attr": [["data-name", "I am a li"]],
        "prop": [["innerHTML", "what?"]]
    }`&lt;/span&gt;&lt;span class="p"&gt;]&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="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;ch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dom&lt;/span&gt;&lt;span class="s2"&gt;`
        &amp;lt;span&amp;gt;
            &amp;lt;i&amp;gt;HELLO!&amp;lt;/i&amp;gt;
        &amp;lt;/span&amp;gt;
    `&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pointerover@mynamespace&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mouseover!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;selected&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="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;myLi&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you were to call function parameters inside a tagged template literal, you would need spreading. Sure, why not?:&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;ch&lt;/span&gt;&lt;span class="s2"&gt;`
-&amp;gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
on ...&lt;/span&gt;&lt;span class="p"&gt;${[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click@someNameSpace&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="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clientX&lt;/span&gt;&lt;span class="p"&gt;)}]}&lt;/span&gt;&lt;span class="s2"&gt;
+&amp;lt; &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="s2"&gt;
`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we created a &lt;code&gt;li&lt;/code&gt; element, added a &lt;code&gt;click&lt;/code&gt; event listener on it with &lt;code&gt;someNameSpace&lt;/code&gt; (so that we can later remove all the listeners registered with that namespace) and appended that to the &lt;code&gt;body&lt;/code&gt;. The event and the handler is passed in an array inside a template literal which is spread to &lt;code&gt;on&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;In none of the examples there is a &lt;code&gt;build&lt;/code&gt; step involved. It all is based on about 160 lines of ES6 - ES2018 JavaScript. Here is a &lt;a href="https://codepen.io/IbrahimTanyalcin/pen/BaMBOzY"&gt;codepen &lt;/a&gt; with some of the examples above.&lt;/p&gt;

&lt;p&gt;At this point you might ask what a TODO list would look like, there you go:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/IbrahimTanyalcin/pen/ExrYZZG"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l6V8wJs8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.jsdelivr.net/npm/cahir%400.0.2/static/img/cahir_todo.png" alt="TODO" width="488" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many of you are using frameworks, I won't be giving names here, and it is totally perfect when it comes to getting the job done. Programming is somewhat bit of an art when compared to positive sciences like physics and math, and for that reason, there is more than one optimal way of doing things, I definitely cherish the differences. Also different stacks for rendering the same "Hello World!" page has packed a lot of documentation through the years, so it is not possible for an average person like me to know everything.&lt;/p&gt;

&lt;p&gt;Here is the thing, the examples you saw in this article are &lt;code&gt;imperative&lt;/code&gt; compared to &lt;code&gt;declarative&lt;/code&gt;. Due its nature, imperative programming has been a bit more verbose because the programmer has to instruct the &lt;code&gt;how to&lt;/code&gt; rather than &lt;code&gt;what to&lt;/code&gt;. But in the face of ES6+, it does not have to be like that anymore. I hope I could prove a point.&lt;/p&gt;

&lt;p&gt;Why is the above important? Because &lt;code&gt;imperative&lt;/code&gt; represents control and &lt;code&gt;declarative&lt;/code&gt; represents abstraction. You want to abstract because you want to avoid the pain and make it easier. You want imperative because you want to specifically control the flow of your functions to create the exact effect desired. Both can be combined.  &lt;/p&gt;

&lt;p&gt;Using this small library, I was able to create complex data visualizations, interfaces using simple routines and web components. When it came to fine tuning and controlling rendering cycle, I was able to control the DOM operations because the setup is imperative by nature with declarative bits.&lt;/p&gt;

&lt;p&gt;Complex visualizations or interfaces go through a process called &lt;code&gt;Enter - update - exit&lt;/code&gt; cycle. Which is reminiscent of how D3 works, and most of the frameworks today use that logic behind the scenes by specifying a &lt;code&gt;key&lt;/code&gt; value to decide with nodes to add/remove/change. This also can be done, &lt;a href="https://ibrahimtanyalcin.github.io/Cahir/"&gt;here is a static example I put together&lt;/a&gt;. You can pause and call Array methods on the &lt;code&gt;data&lt;/code&gt; in the inspector. See for yourself. &lt;/p&gt;

&lt;p&gt;There is a lot of work to do. The &lt;a href="https://github.com/IbrahimTanyalcin/Cahir/blob/master/collections/DOM/ch.js"&gt;helper methods&lt;/a&gt; that are mounted on the &lt;code&gt;Proxy&lt;/code&gt; needs documentation in JSDoc. If you are interested, here is the repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/IbrahimTanyalcin/Cahir"&gt;&lt;strong&gt;Cahir&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Almost a decade and half of developing open source/proprietary visualizations in bioinformatics has thought me that &lt;code&gt;what works&lt;/code&gt; &amp;gt;&amp;gt;&amp;gt; &lt;code&gt;what is trendy&lt;/code&gt;. I understand people refraining from taking risks of dunking into works of others and instead going for the safe route of &lt;code&gt;frameworks&lt;/code&gt; because "they know better than you do." There is also a large cohort of young people who desperately need a paycheck and have no option other than investing into whichever soup of the day stack that lands a job in this VC poisoned market. &lt;/p&gt;

&lt;p&gt;I get all of the above. I also get the idea of &lt;code&gt;standing in the shoulder of giants&lt;/code&gt;. We all, whether we want or not, stand in one way or another in the shoulder of a giant. I believe the key is to find a balance, and sometimes try to ask the question "what if". I think the only sustainable leverage is a vantage point, a vantage point that can incorporate the old and the new, that can keep what works and discards what doesn't.&lt;/p&gt;

&lt;p&gt;If you like the &lt;a href="https://github.com/IbrahimTanyalcin/Cahir"&gt;repository&lt;/a&gt;, please try to help me to make it better by submitting PRs and documentation suggestions. If you like it, a star would not hurt.&lt;/p&gt;

&lt;p&gt;Have a great weekend, &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>es6</category>
      <category>es2018</category>
      <category>proxy</category>
    </item>
    <item>
      <title>Ascii Glitch Animation with js</title>
      <dc:creator>Ibrahim Tanyalcin</dc:creator>
      <pubDate>Wed, 17 Apr 2019 23:40:32 +0000</pubDate>
      <link>https://dev.to/ibrahimtanyalcin/ascii-glitch-animation-with-js-10l3</link>
      <guid>https://dev.to/ibrahimtanyalcin/ascii-glitch-animation-with-js-10l3</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ffsg7jchv0mezcfuyh79i.gif" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ffsg7jchv0mezcfuyh79i.gif" alt="IMG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been working on this for a bioinformatics project, turns out it can also be used to animate ascii characters as well:P.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://observablehq.com/@ibrahimtanyalcin/ascii-warp-github" rel="noopener noreferrer"&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://distreau.com/lexicon-mono-seq/examples/example-5.html" rel="noopener noreferrer"&gt;Another example&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here is the library:&lt;br&gt;
&lt;a href="https://github.com/IbrahimTanyalcin/lexicon-mono-seq" rel="noopener noreferrer"&gt;https://github.com/IbrahimTanyalcin/lexicon-mono-seq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd really appreciate bug reports.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>animation</category>
      <category>github</category>
      <category>library</category>
    </item>
    <item>
      <title>ES6 Modules and Declarative Dependencies in HTML</title>
      <dc:creator>Ibrahim Tanyalcin</dc:creator>
      <pubDate>Sun, 15 Jul 2018 22:31:24 +0000</pubDate>
      <link>https://dev.to/ibrahimtanyalcin/es6-modules-and-declarative-dependencies-in-html-1cm6</link>
      <guid>https://dev.to/ibrahimtanyalcin/es6-modules-and-declarative-dependencies-in-html-1cm6</guid>
      <description>&lt;h1&gt;
  
  
  ES6 Modules and Declarative Dependencies in HTML
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F750%2F1%2AMWzgHGuxOoiH8RSxHap1eA.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F750%2F1%2AMWzgHGuxOoiH8RSxHap1eA.jpeg" alt="Cables"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is a follow up write up of my previous work:&lt;/p&gt;
&lt;/blockquote&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/IbrahimTanyalcin" rel="noopener noreferrer"&gt;
        IbrahimTanyalcin
      &lt;/a&gt; / &lt;a href="https://github.com/IbrahimTanyalcin/taskq" rel="noopener noreferrer"&gt;
        taskq
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Async module loader with declerative dependency management in HTML and compatibility with ES6 import/export
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;taskq&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://travis-ci.org/IbrahimTanyalcin/taskq" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a09ff89825c05e5c09c7d6655253bda93cd7148d66d9b8bf5958011ad34219f6/68747470733a2f2f7472617669732d63692e6f72672f4962726168696d54616e79616c63696e2f7461736b712e7376673f6272616e63683d6d6173746572" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://www.patreon.com/ibrahimTanyalcin" title="Patreon donate" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/16f7a7036f5fa064ab3e0a8737c7449b3f89a9093ecb598cb99a10f6a4f59de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667" alt="Patreon donate"&gt;&lt;/a&gt;
&lt;a href="https://www.codacy.com/app/IbrahimTanyalcin/taskq?utm_source=github.com&amp;amp;utm_medium=referral&amp;amp;utm_content=IbrahimTanyalcin/taskq&amp;amp;utm_campaign=Badge_Grade" title="Codacy" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/94c78bcf24b07e1f21e10382a28f924a2c32338e069c9707e4ce7a339492d81d/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3036663034356466383836383438663039353139646631353338386338626636" alt="Codacy Badge"&gt;&lt;/a&gt;
&lt;a href="https://www.npmjs.com/package/@ibowankenobi/taskq" title="Npm" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/70e5b9f5322e1bc2cf6f40c26325f1f297d1a237a8dab5b30d51b8c12396245e/68747470733a2f2f62616467652e667572792e696f2f6a732f25343069626f77616e6b656e6f62692532467461736b712e737667" alt="Npm Badge"&gt;&lt;/a&gt;
&lt;a href="https://zenodo.org/badge/latestdoi/108156384" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7c2f835a0642a1c2502bf1dcbc4b92af83454110071dbcb0bc3bb259894b245c/68747470733a2f2f7a656e6f646f2e6f72672f62616467652f3130383135363338342e737667" alt="DOI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Async Modules Supporting ES5 &amp;amp; ES6 with Control Flow&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;⇩ First, your 1 min cheatsheet ⇩&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/IbrahimTanyalcin/taskq./cheatsheet.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FIbrahimTanyalcin%2Ftaskq.%2Fcheatsheet.png" alt="cheatsheet"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e22ae2237efc6c158638f32f493c46d354f0a25d11b919f22bc090bc67710e08/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f362f36612f44657461696c5f6465725f52656368656e6d61736368696e655f766f6e5f4a6f68616e6e5f48656c66726963685f4d2543332542436c6c65722e6a7067"&gt;&lt;img src="https://camo.githubusercontent.com/e22ae2237efc6c158638f32f493c46d354f0a25d11b919f22bc090bc67710e08/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f362f36612f44657461696c5f6465725f52656368656e6d61736368696e655f766f6e5f4a6f68616e6e5f48656c66726963685f4d2543332542436c6c65722e6a7067" width="100%"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Navigation&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;If you want you can jump straight into the &lt;a href="https://github.com/IbrahimTanyalcin/taskq#examples-" rel="noopener noreferrer"&gt;&lt;strong&gt;examples&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#advantages-" rel="noopener noreferrer"&gt;Advantages&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#api-" rel="noopener noreferrer"&gt;API&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#reading-" rel="noopener noreferrer"&gt;Reading&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#what-does-it-do-" rel="noopener noreferrer"&gt;What does it do?&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#usage-" rel="noopener noreferrer"&gt;Usage&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#changelog-" rel="noopener noreferrer"&gt;Changelog&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;a href="https://github.com/IbrahimTanyalcin/taskq#examples-" rel="noopener noreferrer"&gt;Examples&lt;/a&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Advantages &lt;a href="https://github.com/IbrahimTanyalcin/taskq#advantages" rel="noopener noreferrer"&gt;⏎&lt;/a&gt;
&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;span&gt;0&lt;/span&gt; dependencies&lt;/li&gt;
&lt;li&gt;No polyfill required&lt;/li&gt;
&lt;li&gt;No transpiling required.&lt;/li&gt;
&lt;li&gt;No config file etc.&lt;/li&gt;
&lt;li&gt;About 6kB when minimized&lt;/li&gt;
&lt;li&gt;Will work on ie9+.&lt;/li&gt;
&lt;li&gt;Will play nice with other technologies/patterns you use in your page&lt;/li&gt;
&lt;li&gt;Non-render blocking&lt;/li&gt;
&lt;li&gt;You can pause/resume the main thread&lt;/li&gt;
&lt;li&gt;Aware of document state (hidden, minimized etc.)&lt;/li&gt;
&lt;li&gt;Fine grained control on execution of all imported scripts.&lt;/li&gt;
&lt;li&gt;Uses Promises combined with requestAnimationFrame(rAF). Falls back to rAF on older browsers (ie etc).&lt;/li&gt;
&lt;li&gt;Supports nested/single dynamic imports. Your main thread will wait until a module finishes dynamically importing other modules.&lt;/li&gt;
&lt;li&gt;Supports &lt;em&gt;then&lt;/em&gt; , &lt;em&gt;catch&lt;/em&gt; phrases for dynamic imports.&lt;/li&gt;
&lt;li&gt;You can do things that you cannot do with ES6 directly
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt; taskq.load("./scriptDynamic1.js")
    .then(function(res){
        res.init
        setTimeout(function(){&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/IbrahimTanyalcin/taskq" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;It tries to reason about what it would be like to have your dependencies declared in HTML as attributes.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://taskq.ibrahimtanyalcin.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Taskq.js&lt;/strong&gt;&lt;/a&gt; is not new, I have released it on October 2017, since then I have been using it to upkeep a fairly large project and add new stuff to it as I see fit.&lt;/p&gt;

&lt;p&gt;As you might know, one of the hottest debates going around in the js landscape is the comparison of module loaders/bundlers and their advantages over each other. The problem is quite clear: they are not compatible with each other, at least not without putting together another “middle man” build time tool.&lt;/p&gt;

&lt;p&gt;It is quite understandable that consumers of modules do not wanna deal with dependency management but if you think about your own projects, there are ALWAYS parts of the app that you want to retain some control if not completely. You can bundle or do whatever you want with some parts of your app while still having control on the flow of the newly added parts. This is what Taskq was designed for, to create a future compatible(combine with ES6 import/export) module system that operates with async scripts (parallel + HTTP2 alleviates need for bundling) and gives you control over their order of execution while reducing your job of managing dependencies (point to crucial leafs in dependency tree, Taskq will work the rest out).&lt;/p&gt;

&lt;p&gt;Today I want to go over a small exercise, we will have a minimal html with 3 async scripts that depend on each other and we will embed the dependencies right in the HTML (a version for ie11 would have to be more verbose). You can complicate this by adding several scripts with comma separated dependencies several layers deep, but I will keep it simple here. Here is the html we have:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We have 3 async scripts A, B and C which should execute in this order. From my previous write-ups, you perhaps know that we declare the &lt;code&gt;_taskqId&lt;/code&gt; and &lt;code&gt;_taskqWaitFor&lt;/code&gt; properties on the modules, this time instead of adding these within the module, we will directly grab it from the attribute:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;X._taskqId = document.currentScript.dataset.taskqid; &lt;br&gt;
X._taskqWaitFor = document.currentScript.dataset.taskqwaitfor.split(",").filter(d=&amp;gt;d);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So instead of hard coding the properties, we can grab them from &lt;code&gt;data-taskqid&lt;/code&gt; and &lt;code&gt;data-taskqwaitfor&lt;/code&gt; attributes. We do not need to know the script name as we can use the document.currentScript in evergreen browsers. So what do the scripts look like?:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;They are almost identical to each other, they only export their own variables. If you open the &lt;a href="https://github.com/IbrahimTanyalcin/taskq/tree/master/example/declerativeDependenciesExample" rel="noopener noreferrer"&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;/a&gt; file you will get this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1000%2F1%2Aei3UVB3axn2IiNx_wwiS1Q.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%2Fcdn-images-1.medium.com%2Fmax%2F1000%2F1%2Aei3UVB3axn2IiNx_wwiS1Q.png" alt="Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can go ahead and add more script tags and make the dependencies several layers deep or add more dependencies such as &lt;code&gt;data-taskqwaitfor='X,Y,Z,...'&lt;/code&gt;. You can even try to add circular references, in that case Taskq will try to resolve and also display a console message.&lt;/p&gt;

&lt;p&gt;Another interesting part here is that you can still use ES6 import/export. For instance nothing is barring you from doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
\&amp;lt;script type="module" src="./B.js" data-taskqid="B" data-taskqwaitfor="A" charset="UTF-8" async&amp;gt;
\&amp;lt;/script&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;And then within the module you can do:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
import someExport from "./A.js";&lt;br&gt;
!function(){ &lt;br&gt;
    function X(exportA){&lt;br&gt;
    ...&lt;/code&gt;&lt;/p&gt;



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



In ES6, as far as I know, the imported modules are guaranteed to be run before the current script that imported them, but the order of execution of the imported modules cannot be guaranteed and is vendor implementation dependent. In these cases, let ES6 figure out its own dependency and import these variable as it wants, we could care less when the iief is executed!

You will still have control on the execution order of what is pushed to taskq within the outer iief. This way you take advantage of ES6 while retaining control on the execution order of the bits you care about.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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