<?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: Avichay Eyal</title>
    <description>The latest articles on DEV Community by Avichay Eyal (@eavichay).</description>
    <link>https://dev.to/eavichay</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%2F48384%2F2dadfddf-ec62-4d5a-9ac5-b6deacf3ec14.png</url>
      <title>DEV Community: Avichay Eyal</title>
      <link>https://dev.to/eavichay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eavichay"/>
    <language>en</language>
    <item>
      <title>slim.js gets a fifth version</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Thu, 08 Jul 2021 18:28:20 +0000</pubDate>
      <link>https://dev.to/eavichay/slim-js-gets-a-fifth-version-58h2</link>
      <guid>https://dev.to/eavichay/slim-js-gets-a-fifth-version-58h2</guid>
      <description>&lt;p&gt;I have released this week version 5 of slim.js, faster, lighter and more flexible than previous releases.&lt;/p&gt;

&lt;p&gt;Will appreciate if you try it and let me know how was your developer experience.&lt;/p&gt;

&lt;p&gt;doc site: &lt;a href="https://slimjs.com"&gt;https://slimjs.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>webcomponents</category>
    </item>
    <item>
      <title>Undying objects in javascript</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Tue, 27 Oct 2020 08:02:06 +0000</pubDate>
      <link>https://dev.to/eavichay/undying-objects-in-javascript-3b3l</link>
      <guid>https://dev.to/eavichay/undying-objects-in-javascript-3b3l</guid>
      <description>&lt;p&gt;I'd like to introduce a simple and effective tool I have just published that creates an observable state with an "auto-save to local-storage" feature.&lt;/p&gt;

&lt;p&gt;Every change (or changeset) in the object's tree will flush the data as JSON object into the local storage, and be restored on the next page load.&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;undying&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;undying&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;defaultValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;favouriteColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blue&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;undyingObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;undying&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user-defaults&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;defaultValues&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cm"&gt;/* If the data exists on the local storage,
   the default values will be ignored and actual data is restored.
   If the data does not exist,
   it will be created with default values
*/&lt;/span&gt;


&lt;span class="nx"&gt;undyingObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;favouriteColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;undyingObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shape&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rectangle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// async flush to local storage.&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;You can also be notified when something is changed:&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;const&lt;/span&gt; &lt;span class="nx"&gt;myState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;undying&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt;
&lt;span class="nx"&gt;undying&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;undyingObject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&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="c1"&gt;// value is the whole tree data&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enjoy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/undying"&gt;https://www.npmjs.com/package/undying&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>browser</category>
      <category>frontend</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Adaptive Design Systems</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Fri, 26 Jun 2020 07:28:29 +0000</pubDate>
      <link>https://dev.to/eavichay/adaptive-design-systems-1dob</link>
      <guid>https://dev.to/eavichay/adaptive-design-systems-1dob</guid>
      <description>&lt;p&gt;Article published by me: &lt;a href="https://eavichay.svbtle.com/the-adaptive-design-system"&gt;https://eavichay.svbtle.com/the-adaptive-design-system&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can anyone share his own experience of white-labeling web applications?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>ui</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Multiple front-ends, different frameworks, one application</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Sat, 30 Nov 2019 22:05:02 +0000</pubDate>
      <link>https://dev.to/eavichay/multiple-front-ends-different-frameworks-one-application-2i58</link>
      <guid>https://dev.to/eavichay/multiple-front-ends-different-frameworks-one-application-2i58</guid>
      <description>&lt;p&gt;Here's a quick demo.&lt;br&gt;
AMA for explanations how this works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://build-theta-two.now.sh/#/side-by-side"&gt;https://build-theta-two.now.sh/#/side-by-side&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>microfrontends</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Appreciate your votes</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Mon, 16 Sep 2019 07:13:57 +0000</pubDate>
      <link>https://dev.to/eavichay/appreciate-your-votes-56f1</link>
      <guid>https://dev.to/eavichay/appreciate-your-votes-56f1</guid>
      <description>&lt;p&gt;I have sent CFPs for confoo Canada, appreciate if you vote in favour of the topics&lt;br&gt;
Link here &lt;a href="https://confoo.ca/en/yul2020/call-for-papers/speaker/avichay-eyal"&gt;https://confoo.ca/en/yul2020/call-for-papers/speaker/avichay-eyal&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ottavino Simple Demo</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Mon, 24 Jun 2019 13:21:35 +0000</pubDate>
      <link>https://dev.to/eavichay/ottavino-simple-demo-27no</link>
      <guid>https://dev.to/eavichay/ottavino-simple-demo-27no</guid>
      <description>&lt;p&gt;Simple responsive web-components library I authored not long ago. Comments, please!&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/iciif"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webcomponents</category>
      <category>ottavino</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Custom Directives in slim.js</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Mon, 06 May 2019 08:36:56 +0000</pubDate>
      <link>https://dev.to/eavichay/custom-directives-in-slim-js-kc6</link>
      <guid>https://dev.to/eavichay/custom-directives-in-slim-js-kc6</guid>
      <description>&lt;p&gt;I will demonstrate how to apply a visual effect (typewriter as an example) using custom directives in slim.js.&lt;/p&gt;

&lt;p&gt;For those aren't familiar with slim.js - It is a web-component authoring library with zero dependencies, fast, lightweight (3K) that enables developers to create custom elements with the declarative approach (similar to how Angular handles templates).&lt;/p&gt;

&lt;p&gt;Demo of the effect &lt;a href="https://codepen.io/eavichay/pen/MdWROq"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, lets define some component with a basic template:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Slim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'my-tag'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="s2"&gt;`&amp;lt;p effect:typewriter&amp;gt;This is a sample text&amp;lt;/p&amp;gt;`&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Slim&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;If you have noticed the &lt;code&gt;effect:typewriter&lt;/code&gt; attribute, it is still not defined as a custom directive, and will have no effect on the page.&lt;br&gt;
Attributes with namespaces a VALID html markup and they can be leveraged in order to avoid conflicts with native future attributes.&lt;/p&gt;

&lt;p&gt;Now let's define the effect directive&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Slim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customDirective&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attribute&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;attribute&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localName&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'effect:typewriter'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;attribute&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;match&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="c1"&gt;// capture initial text&lt;/span&gt;
        &lt;span class="kd"&gt;const&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;target&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="c1"&gt;// parse delay from attribute or default to 50ms&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attribute&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'50'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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;interval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;setInterval&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;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&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;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// set inner text&lt;/span&gt;
          &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interval&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="nx"&gt;delay&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;In the HTML Markup we can now add&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;my-tag&amp;gt;&amp;lt;/my-tag&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And viola, typewriter effect anywhere we want.&lt;/p&gt;

&lt;p&gt;For more information regarding slim.js you can see the online docs &lt;a href="http://slimjs.com"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webcomponents</category>
      <category>slimjs</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>The Nudist Web Developer</title>
      <dc:creator>Avichay Eyal</dc:creator>
      <pubDate>Thu, 02 May 2019 07:40:43 +0000</pubDate>
      <link>https://dev.to/eavichay/the-nudist-web-developer-40e</link>
      <guid>https://dev.to/eavichay/the-nudist-web-developer-40e</guid>
      <description>

&lt;p&gt;&lt;a href="https://eavichay.svbtle.com/being-nudist-web-developer"&gt;https://eavichay.svbtle.com/being-nudist-web-developer&lt;/a&gt;&lt;/p&gt;


</description>
      <category>javascript</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
