<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tom Lienard</title>
    <description>The latest articles on DEV Community by Tom Lienard (@tomlienard).</description>
    <link>https://dev.to/tomlienard</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%2F253139%2Fb17ce886-aacf-4d41-9402-f3ea5dd0a67c.jpg</url>
      <title>DEV Community: Tom Lienard</title>
      <link>https://dev.to/tomlienard</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tomlienard"/>
    <language>en</language>
    <item>
      <title>V8 Isolates are taking over the world</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Wed, 22 Jun 2022 15:54:03 +0000</pubDate>
      <link>https://dev.to/tomlienard/v8-isolates-are-taking-over-the-world-3h4m</link>
      <guid>https://dev.to/tomlienard/v8-isolates-are-taking-over-the-world-3h4m</guid>
      <description>&lt;h1&gt;
  
  
  V8 Isolates are taking over the world
&lt;/h1&gt;

&lt;p&gt;Cloudflare Workers with Vercel&lt;/p&gt;

&lt;p&gt;Deno Deploy with Netlify and Supabase&lt;/p&gt;

&lt;p&gt;Oxygen (from Shopify)&lt;/p&gt;

&lt;p&gt;All of these companies have something in common. You guessed it, they all use V8 Isolates for one of their product.&lt;/p&gt;

&lt;p&gt;You might be thinking, what are those "V8 Isolates" this guy is talking about? Well, let's read this explanation from &lt;a href="https://developers.cloudflare.com/workers/learning/how-workers-works/"&gt;Cloudflare&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;V8 orchestrates isolates: lightweight contexts that provide your code with variables it can access and a safe environment to be executed within. You could even consider an isolate a sandbox for your function to run in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's cheaper to run a code within an Isolate than a container or a virtual machine, both in terms of time and resources. It's faster to start an Isolate than Node.js. It costs less to run a single process running multiple Isolates, than running multiple processes. It's being used by more and more big companies.&lt;/p&gt;




&lt;p&gt;So, what are the drawbacks?&lt;/p&gt;

&lt;p&gt;Honestly, I didn't found a lot.&lt;/p&gt;

&lt;p&gt;The most obvious one is that its usage to run client-provided JavaScript is still fairly recent compared to containers and virtual machines. The ecosystem is not yet mature, even tough there's more and more &lt;a href="https://deno.com/blog/series-a"&gt;funding&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The second I can think of is that every company is implementing its own runtime, with its own APIs, duplicating the work. Luckly, a community group was created, initiated by Cloudflare and Deno, named &lt;a href="https://wintercg.org/"&gt;WinterCG&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It aims to&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;provide a space for JavaScript runtimes to collaborates on API interoperability.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a way to provide a unified API for all those new runtimes, but I'm still sad that none of them is open-source (Cloudflare announced few months ago that their &lt;a href="https://blog.cloudflare.com/workers-open-source-announcement/"&gt;runtime will be open-source&lt;/a&gt;, but that's not yet the case).&lt;/p&gt;




&lt;p&gt;That's why I started working on an open-source platform named &lt;a href="https://github.com/lagonapp/serverless"&gt;Lagon&lt;/a&gt;, aiming to provide a cloud-based and self-hosted version of a Serverless Runtime for running JavaScript and TypeScript. I want to give the community a really good software, even tough it requires a lot of work to do so.&lt;/p&gt;

&lt;p&gt;Here is the GitHub repository if you want to take an early look: &lt;a href="https://github.com/lagonapp/serverless"&gt;github.com/lagonapp/serverless&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would love to know if this idea seems interesting for anyone, so feel free to leave your tought in the comments. I'm convinced that even more amazing products using V8 Isolates will be released in the future. Long live to Isolates!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>serverless</category>
    </item>
    <item>
      <title>An introduction to atomic state management libraries in React</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Mon, 08 Nov 2021 11:42:33 +0000</pubDate>
      <link>https://dev.to/tomlienard/an-introduction-to-atomic-state-management-libraries-in-react-4fhh</link>
      <guid>https://dev.to/tomlienard/an-introduction-to-atomic-state-management-libraries-in-react-4fhh</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Atomic state management libraries are growing. Fast. As you can see in this graph from &lt;a href="https://www.npmtrends.com/jotai-vs-recoil" rel="noopener noreferrer"&gt;npmtrends&lt;/a&gt;, the two most famous libraries &lt;a href="https://recoiljs.org/" rel="noopener noreferrer"&gt;Recoil&lt;/a&gt; and &lt;a href="https://jotai.pmnd.rs/" rel="noopener noreferrer"&gt;Jotai&lt;/a&gt; were almost unknown last year, and now count respectively &lt;strong&gt;240k and 35k downloads per week&lt;/strong&gt;:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7hwtx58ko9ymvcog6r5.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%2Fm7hwtx58ko9ymvcog6r5.png" alt="Jotai VS Recoil"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've also open-sourced a new atomic library called &lt;a href="https://github.com/QuiiBz/particule" rel="noopener noreferrer"&gt;Particule&lt;/a&gt;, which has some new interesting features such as &lt;a href="https://github.com/quiiBz/particule#custom-atom-with-hooks" rel="noopener noreferrer"&gt;custom &lt;code&gt;atom&lt;/code&gt;  functions with hooks&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  But what is atomic state management?
&lt;/h2&gt;

&lt;p&gt;Ha, that's a good question. From &lt;a href="https://recoiljs.org/docs/introduction/core-concepts/#atoms" rel="noopener noreferrer"&gt;Recoil's docs&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Atoms are units of state. They're updateable and subscribable: when an atom is updated, each subscribed component is re-rendered with the new value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An atom represents a piece of state that you can read and update anywhere in your application. Think of it as a &lt;code&gt;useState&lt;/code&gt; that can be shared in any component.&lt;/p&gt;

&lt;p&gt;This approach provides many benefits, mainly:&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid unwanted re-renders and computations
&lt;/h3&gt;

&lt;p&gt;You won't anymore pass state values and update functions via &lt;code&gt;props&lt;/code&gt;, nor trigger the whole tree of components from a context's consumer. &lt;strong&gt;Only components subscribed to the atom's value will update&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Take a look at this example using &lt;a href="https://github.com/QuiiBz/particule" rel="noopener noreferrer"&gt;Particule&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;textAtom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;atom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello world!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Text&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;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useGetAtom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;textAtom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Won't re-render!&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Button&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;setText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSetAtom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;textAtom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&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="nf"&gt;setText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Updated!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Update&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Won't re-render!&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&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;Only &lt;code&gt;&amp;lt;Text /&amp;gt;&lt;/code&gt; will re-render, even if &lt;code&gt;&amp;lt;Button /&amp;gt;&lt;/code&gt; also uses the atom. But there's a difference between the two: &lt;code&gt;&amp;lt;Button /&amp;gt;&lt;/code&gt; &lt;strong&gt;isn't subscribed to updates, because it uses &lt;code&gt;useSetAtom&lt;/code&gt;&lt;/strong&gt; and only retrieves a setter function (similar to the one in &lt;code&gt;useState&lt;/code&gt;. On the contrary, &lt;code&gt;&amp;lt;Text /&amp;gt;&lt;/code&gt; is subscribed to updates because it uses &lt;code&gt;useGetAtom&lt;/code&gt; to retrieve the value.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compose atom from other atoms
&lt;/h3&gt;

&lt;p&gt;Derived (or composed) atoms are atoms made from other atoms. They subscribe to each atom that they depend on, and such automatically trigger a re-render when needed.&lt;/p&gt;

&lt;p&gt;This can be made using &lt;a href="https://recoiljs.org/docs/basic-tutorial/selectors" rel="noopener noreferrer"&gt;selectors&lt;/a&gt; in Recoil, and is even simpler in Jotai and Particule. This example is made with &lt;a href="https://github.com/QuiiBz/particule" rel="noopener noreferrer"&gt;Particule&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;eurosAtom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;atom&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dollarsAtom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;atom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;eurosAtom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1.15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;euros&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setEuros&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useAtom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;eurosAtom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;dollars&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setDollars&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useAtom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dollarsAtom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setEuros&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;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;euros&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setDollars&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;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;dollars&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&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;When &lt;code&gt;eurosAtom&lt;/code&gt; changes, &lt;code&gt;dollarsAtom&lt;/code&gt; is re-calculated since it is subscribed using &lt;code&gt;get&lt;/code&gt; and re-render the component once.&lt;/p&gt;

&lt;p&gt;There are many other interesting topics with atomic state management libraries, such as &lt;code&gt;&amp;lt;Suspense /&amp;gt;&lt;/code&gt; support for async, helper &lt;code&gt;atom&lt;/code&gt; functions to add new functionalities...&lt;/p&gt;

&lt;p&gt;So feel free to comment down below if you want more articles on this, and you can check out the GitHub repository of the libraries I mentioned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/QuiiBz/particule" rel="noopener noreferrer"&gt;Particule&lt;/a&gt; (looking for feedback!)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/facebookexperimental/Recoil" rel="noopener noreferrer"&gt;Recoil&lt;/a&gt; (created by Facebook)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/pmndrs/jotai" rel="noopener noreferrer"&gt;Jotai&lt;/a&gt; (created by Poimandres)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Writing a CSS-in-JS library to rapidly create reusable designs</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Tue, 13 Apr 2021 16:02:16 +0000</pubDate>
      <link>https://dev.to/tomlienard/writing-a-css-in-js-library-to-rapidly-create-reusable-designs-39ap</link>
      <guid>https://dev.to/tomlienard/writing-a-css-in-js-library-to-rapidly-create-reusable-designs-39ap</guid>
      <description>&lt;p&gt;Hello, today I'm going to talk about my CSS-in-JS library called &lt;a href="https://github.com/QuiiBz/niftycss" rel="noopener noreferrer"&gt;NiftyCSS&lt;/a&gt;. I developed few very cool ideas and wanted to get some &lt;strong&gt;feedback and thoughts&lt;/strong&gt; from the community.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why writing CSS in JS?
&lt;/h2&gt;

&lt;p&gt;Good question. If you never tried any CSS-in-JS library, you might be wondering why and how you can write your CSS in your JavaScript (or TypeScript of course).&lt;/p&gt;

&lt;h3&gt;
  
  
  No class name conflicts
&lt;/h3&gt;

&lt;p&gt;Since the class name is generated automatically by the library, you don't have to think about it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dead-code elimination
&lt;/h3&gt;

&lt;p&gt;If a class is not used, the CSS will not be injected (or server-side renderer for the libraries which support it) and you will never have extra CSS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use JS in your CSS
&lt;/h3&gt;

&lt;p&gt;It seems logical, but you can actually use ANY feature from your JavaScript code, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Calling functions to get code&lt;/li&gt;
&lt;li&gt;Reusing styles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And there are much more pros to use CSS-in-JS. Of course, there are also some &lt;a href="https://www.freecodecamp.org/news/you-dont-need-css-in-js-why-i-use-stylesheets/" rel="noopener noreferrer"&gt;draw-backs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  NiftyCSS cool features
&lt;/h2&gt;

&lt;p&gt;First of all, let me show you what an example code looks like:&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%2Fi.imgur.com%2FGtDXQur.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%2Fi.imgur.com%2FGtDXQur.png"&gt;&lt;/a&gt;&lt;br&gt;
As you can see, I wrote the CSS in a JavaScript file (actually it was TypeScript), and used some strange techniques. The &lt;code&gt;css&lt;/code&gt; function returns me a unique class name, so I can include it everywhere I want.&lt;br&gt;
At the right, you can see the generated and injected CSS. Let's go more in-depth about few features used:&lt;/p&gt;
&lt;h3&gt;
  
  
  Directives for automatic code generation
&lt;/h3&gt;

&lt;p&gt;Writing media queries declaration is boring, isn't it? To solve this, I created something called &lt;strong&gt;Directives&lt;/strong&gt;. They are simple properties in the &lt;code&gt;css&lt;/code&gt; object, which can hold anything.&lt;br&gt;
For instance, NiftyCSS contains &lt;strong&gt;breakpoints&lt;/strong&gt; to replace the fastidious &lt;code&gt;@media (min-width...)&lt;/code&gt; declarations. Here, I used the &lt;code&gt;$sm&lt;/code&gt; directive, which tells that all the CSS rules inside this directive will be inside a pre-defined breakpoint. The best is that it's automatically transformed by Nifty! (and you can also define custom breakpoints and custom directives via plugins, but that will be for the next time)&lt;/p&gt;
&lt;h3&gt;
  
  
  CSS Utilities
&lt;/h3&gt;

&lt;p&gt;You might notice that I used some functions and variables called &lt;code&gt;flexCenter&lt;/code&gt; and &lt;code&gt;paddingX&lt;/code&gt;. Since we are in a JavaScript file, we can use the spread operator. These functions and variables are coming from the &lt;code&gt;@niftycss/css&lt;/code&gt; package and return many CSS rules from one single property.&lt;br&gt;
For instance, the &lt;code&gt;flexCenter&lt;/code&gt; variable returns an object with these 3 rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;display&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;flex&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;justify-content&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;center&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;align-items&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;center&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whenever I want to create an element with these properties, I only need to spread this variable, instead of writing everything myself!&lt;br&gt;
The &lt;code&gt;paddingX&lt;/code&gt; works the same but returns the &lt;code&gt;padding-left&lt;/code&gt; and &lt;code&gt;padding-right&lt;/code&gt; with the passed value.&lt;/p&gt;

&lt;h3&gt;
  
  
  Theming
&lt;/h3&gt;

&lt;p&gt;Did you notice that in the code above, I used a custom theme object? That allows implementing a white and dark theme in seconds, by just calling &lt;code&gt;setTheme&lt;/code&gt; later on. And the best is that you automatically get auto-completion from your theme keys!&lt;/p&gt;

&lt;p&gt;That's it for this first article about &lt;a href="https://github.com/QuiiBz/niftycss" rel="noopener noreferrer"&gt;NiftyCSS&lt;/a&gt;, thanks for reading it.&lt;br&gt;
Feel free to comment below your thoughts on these features, and to visit (maybe star if you enjoyed) the GitHub repo: &lt;a href="https://github.com/QuiiBz/niftycss" rel="noopener noreferrer"&gt;https://github.com/QuiiBz/niftycss&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Don't pay cloud from your pocket - use free credit </title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Thu, 28 Jan 2021 16:04:36 +0000</pubDate>
      <link>https://dev.to/tomlienard/don-t-pay-cloud-from-your-pocket-use-free-credit-2jb8</link>
      <guid>https://dev.to/tomlienard/don-t-pay-cloud-from-your-pocket-use-free-credit-2jb8</guid>
      <description>&lt;p&gt;If you only want to validate an idea or want to launch without knowing if it will be profitable, you don't have to pay from your pocket for a majority of cloud products. For the launch of my side project Mindible, I won't be using any paid cloud services. Let me show you how I can do so!&lt;/p&gt;

&lt;h2&gt;
  
  
  Static website
&lt;/h2&gt;

&lt;p&gt;If you have a static frontend, you can use free services like &lt;a href="https://vercel.com/"&gt;Vercel&lt;/a&gt; or &lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt;. Their &lt;strong&gt;free tiers&lt;/strong&gt; are really enough for any small launching startup. I would recommend using Vercel since I used it myself for more than a year.&lt;/p&gt;

&lt;h2&gt;
  
  
  VPS / Virtual Instances
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://m.do.co/c/2b270a97d422"&gt;DigitalOcean&lt;/a&gt; can give you $100 for free when signing up for the first time to try their products. This way you could use their Droplets or other services for up to &lt;strong&gt;60 days for free.&lt;/strong&gt; Ideal to host your backend server for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  Databases
&lt;/h2&gt;

&lt;p&gt;If you are using &lt;strong&gt;MongoDB&lt;/strong&gt;, this is for you! I found yesterday that there are tons of credits code (you can found them via Reddit) that you can apply to your account. Using this process, I got more than $600 of credits for cloud-hosted MongoDB: &lt;a href="http://prntscr.com/xqvm40"&gt;http://prntscr.com/xqvm40&lt;/a&gt;&lt;br&gt;
There is also &lt;strong&gt;Firebase&lt;/strong&gt; which is a really powerful cloud database that can help you with real-time features and online/offline synchronization. Their free tier is also pretty big.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Cloud services
&lt;/h2&gt;

&lt;p&gt;Major cloud providers give you free credit and free services when signing up.&lt;br&gt;
Take &lt;a href="https://aws.amazon.com/fr/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;amp;all-free-tier.sort-order=asc"&gt;AWS&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/en-gb/free/"&gt;Azure&lt;/a&gt; or even &lt;a href="https://cloud.google.com/free?hl=fr"&gt;GCP&lt;/a&gt;. Of course, this requires a bit of time to understand how it works, but it's still a good idea for a free Serverless endpoint for instance.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cloud</category>
      <category>serverless</category>
      <category>database</category>
    </item>
    <item>
      <title>Are you using JavaScript Testing Frameworks?</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Thu, 24 Sep 2020 17:29:57 +0000</pubDate>
      <link>https://dev.to/tomlienard/are-you-using-javascript-testing-frameworks-9n5</link>
      <guid>https://dev.to/tomlienard/are-you-using-javascript-testing-frameworks-9n5</guid>
      <description>&lt;h2&gt;
  
  
  📌 Introduction
&lt;/h2&gt;

&lt;p&gt;First of all, I hope your day was good.&lt;br&gt;
This post is made for everyone who is using or not a JavaScript Testing Framework and want to share his experience with it. Feel free to comment down below!&lt;/p&gt;

&lt;h2&gt;
  
  
  🔎 The question
&lt;/h2&gt;

&lt;p&gt;I was wondering, *&lt;em&gt;are you using any JavaScript Testing Framework *&lt;/em&gt; at your work, on your daily-routine? If yes, could you explain why you choose this one and not another one? And if no, why are you not using one?&lt;/p&gt;

&lt;p&gt;There are plenty of tools like Mocha, Jest, Tape, AVA... But they all are slow, +1s for a simple test.&lt;/p&gt;

&lt;p&gt;Do not hesitate to debate and share your experience, I’m very interested to know your preferences.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>testing</category>
    </item>
    <item>
      <title>Why you should use the product you’re building every day</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Tue, 22 Sep 2020 11:03:48 +0000</pubDate>
      <link>https://dev.to/tomlienard/why-you-should-use-the-product-you-re-building-every-day-dml</link>
      <guid>https://dev.to/tomlienard/why-you-should-use-the-product-you-re-building-every-day-dml</guid>
      <description>&lt;p&gt;You are building a new product? Great. But if you are not using it every day, how would you improve it and find early bugs? Let me introduce to you why it’s important to &lt;strong&gt;use your product every day&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For each « why », I will take an example of the « how » with &lt;em&gt;Mindible&lt;/em&gt;, which is the product I’m currently building. Feel free to check it out at &lt;a href="https://usemindible.com"&gt;https://usemindible.com&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  🧬 Bugs
&lt;/h2&gt;

&lt;p&gt;Before launching officially your new product/startup, you would need beta-testers to find out bugs. Because you (and I) don’t want to ship a product &lt;strong&gt;filled with bugs&lt;/strong&gt;.&lt;br&gt;
But did you know that by using yourself your product, you will find &lt;strong&gt;tons of bugs&lt;/strong&gt; even before thinking about the official launch?!&lt;br&gt;
It’s especially true if your product is a PaaS or a SaaS.&lt;/p&gt;

&lt;p&gt;For example, since I use my product &lt;strong&gt;Mindible&lt;/strong&gt; to write articles, todos and notes, I found more than 10 bugs during the first days and found at least 1 to 3 new bugs every day.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 New features
&lt;/h2&gt;

&lt;p&gt;While using your product, you will get new ideas for cool features that could be really helpful.&lt;/p&gt;

&lt;p&gt;On Mindible, I found that even while using tags, it was &lt;strong&gt;hard to find a specific note&lt;/strong&gt; between all the others. The solution I hand up with was to create some sort of « groups » of multiples notes, to store them easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 UI and UX
&lt;/h2&gt;

&lt;p&gt;When using your product, you will certainly find some strange things you built for the UI and/or UX. Just by using your product, you will be like &lt;strong&gt;one of your customers&lt;/strong&gt;. So don’t be too kind, spot all the misconceptions you can find while using your product, and fix them all.&lt;/p&gt;

&lt;p&gt;As an example, I found that the « Create Note » button was really not accessible before. &lt;strong&gt;Naturally, as a customer&lt;/strong&gt;, I knew where it should be placed, but didn’t do so before using it every day.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎉 Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope I convinced you to start &lt;strong&gt;using your product every day&lt;/strong&gt; with all of these examples. And let me give you the last advice:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you like using your product and don't feel restricted, your users will too!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thanks for reading, feel free to comment down below to share your experience and tell me if you're already using this method or no.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>productivity</category>
    </item>
    <item>
      <title>🧐 Which Terminal Emulator are you using?</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Tue, 15 Sep 2020 21:47:06 +0000</pubDate>
      <link>https://dev.to/tomlienard/which-terminal-emulator-are-you-using-3c5i</link>
      <guid>https://dev.to/tomlienard/which-terminal-emulator-are-you-using-3c5i</guid>
      <description>&lt;h2&gt;
  
  
  📌 Introduction
&lt;/h2&gt;

&lt;p&gt;First of all, I hope your day was good.&lt;br&gt;
This post is made for everyone who is using a Terminal Emulator and want to share his experience with it. Feel free to comment down below!&lt;/p&gt;

&lt;h2&gt;
  
  
  🔎 The question
&lt;/h2&gt;

&lt;p&gt;Since I’m working on my own &lt;a href="https://github.com/QuiiBz/squid"&gt;Terminal Emulator&lt;/a&gt;, I was wondering, &lt;strong&gt;which one are you using on your daily routine?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are plenty of alternatives, from iTerm to Hyper and Cmder. So &lt;strong&gt;why do you use your Terminal Emulator and not another one?&lt;/strong&gt; Does it have every features that you needs? Does you can’t find a good one that fit your expectations?&lt;/p&gt;

&lt;p&gt;Do not hesitate to debate and share you experience, I’m very interested to know your preferences.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>terminal</category>
      <category>shell</category>
      <category>productivity</category>
    </item>
    <item>
      <title>🚀 Releasing ShineBoard - A beautiful way to share code</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Sat, 16 May 2020 21:17:16 +0000</pubDate>
      <link>https://dev.to/tomlienard/releasing-shineboard-a-beautiful-way-to-share-code-46ac</link>
      <guid>https://dev.to/tomlienard/releasing-shineboard-a-beautiful-way-to-share-code-46ac</guid>
      <description>&lt;h1&gt;
  
  
  ShineBoard
&lt;/h1&gt;

&lt;h2&gt;
  
  
  A beautiful way to share code
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;🎉 Hello ! Today, I wanted to show you the side project I was working on. Basically, I didn’t like pastebin for sharing codes - it’s not very beautiful and user-friendly. I know hastebin, but half of the time the website is down. Also, I always have tons of .txt, .yaml files on my Desktop, due to logs or configuration files. So this is why I created ShineBoard - a tool to make code sharing easier and a better experience.&lt;br&gt;
❗️ It’s a « beta » version, I just would like to get some feedback about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--imwVCm3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/E8wVJoW.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--imwVCm3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/E8wVJoW.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ShineBoard is a open-source platform to make sharing code easier. Wasted by all the .txt files you downloaded and the poor hastebin codes ? Switch now to ShineBoard :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;a href="https://shineboard.io"&gt;shineboard.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Paste your file's content&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;CTRL + S&lt;/code&gt; to save the paste, and then &lt;code&gt;CTRL + V&lt;/code&gt; to share the link&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alternatively, you can use the &lt;a href="https://github.com/ShineBoard/cli"&gt;CLI&lt;/a&gt; to create paste from your terminal :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install with NPM (&lt;code&gt;npm i -g @shineboard/cli&lt;/code&gt;) or with Yarn (&lt;code&gt;yarn global add @shineboard/cli&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;shine help&lt;/code&gt; to get started&lt;/li&gt;
&lt;li&gt;To upload very quicly, run &lt;code&gt;shine add &amp;lt;file&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You can also choose to specify a name for this paste with the flag &lt;code&gt;--name&lt;/code&gt; (or &lt;code&gt;-n&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;If you which, you can force the language with &lt;code&gt;--language&lt;/code&gt; (or &lt;code&gt;-l&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Informations
&lt;/h2&gt;

&lt;p&gt;📋 ShineBoard is currently in a « beta » version. I just want to get some feedback before working on new features.&lt;br&gt;
The project is open-source, so feel free to contribute (links bellow).&lt;/p&gt;

&lt;h3&gt;
  
  
  About the Website :
&lt;/h3&gt;

&lt;p&gt;Based on Laravel, I choose to use VueJS and VueRouter in SPA mode, for a better navigation : you won’t see pages loading more and more. There is also a simple API, which is called by the CLI.&lt;/p&gt;

&lt;h3&gt;
  
  
  About the CLI :
&lt;/h3&gt;

&lt;p&gt;It’s actually the first time I made a CLI - and I’m not sure if it’s the good way to do it. Just a simple Nodejs app. Let me know if it’s not that bad :)&lt;/p&gt;

&lt;p&gt;❤️ Also, I you liked this post and this project, please consider starring the Github repository bellow :&lt;/p&gt;

&lt;h2&gt;
  
  
  Importants links :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Website : &lt;a href="https://shineboard.io"&gt;https://shineboard.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Github :

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/ShineBoard/shineboard"&gt;Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ShineBoard/cli"&gt;CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;NPMJS CLI : &lt;a href="https://www.npmjs.com/package/@shineboard/cli"&gt;&lt;/a&gt;&lt;a href="https://www.npmjs.com/package/@shineboard/cli"&gt;https://www.npmjs.com/package/@shineboard/cli&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>php</category>
    </item>
    <item>
      <title>Squid, a terminal for everyone</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Sun, 23 Feb 2020 17:46:53 +0000</pubDate>
      <link>https://dev.to/tomlienard/squid-a-terminal-for-everyone-3791</link>
      <guid>https://dev.to/tomlienard/squid-a-terminal-for-everyone-3791</guid>
      <description>&lt;h1&gt;
  
  
  Squid
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Squid&lt;/strong&gt; in an open-source electron terminal in developement.&lt;/p&gt;

&lt;p&gt;Here is the GitHub repo, the code is documented so feel free to contribute :&lt;br&gt;
&lt;a href="https://github.com/QuiiBz/squid"&gt;https://github.com/QuiiBz/squid&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Screenshots
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WjXcFTuX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/9t4kWi1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WjXcFTuX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/9t4kWi1.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uEcbLfvQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/KFY3Ezo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uEcbLfvQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/KFY3Ezo.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Choose the bash you want&lt;/li&gt;
&lt;li&gt;Create, delete, switch terminal tabs&lt;/li&gt;
&lt;li&gt;Create the theme you want&lt;/li&gt;
&lt;li&gt;Many settings like font size/family, cursor type...&lt;/li&gt;
&lt;li&gt;Auto-update&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Themes
&lt;/h2&gt;

&lt;p&gt;There is a complete theme system which works with &lt;code&gt;.theme.json&lt;/code&gt; files, located in &lt;code&gt;userData/Squid&lt;/code&gt;. To apply a theme, edit the &lt;code&gt;currentTheme&lt;/code&gt; key in &lt;code&gt;settings.squid.json&lt;/code&gt; to match the theme name. Here is an exemple of a material theme :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name":"material",
  "background":"rgb(41, 45, 62)",
  "foreground":"#ECEFF1",
  "cursor":"#FFCC00",
  "black":"#000000",
  "red":"#E54B4B",
  "green":"#9ECE58",
  "yellow":"#FAED70",
  "blue":"#396FE2",
  "magenta":"#BB80B3",
  "cyan":"#2DDAFD",
  "white":"#d0d0d0",
  "lightBlack":"#6b6b6b",
  "lightRed":"#FF5370",
  "lightGreen":"#C3E88D",
  "lightYellow":"#FFCB6B",
  "lightBlue":"#82AAFF",
  "lightMagenta":"#C792EA",
  "lightCyan":"#89DDFF",
  "lightWhite":"#ffffff"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Coming soon
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Plugins creation&lt;/li&gt;
&lt;li&gt;Hosts remember with

&lt;ul&gt;
&lt;li&gt;Quick SSH connect&lt;/li&gt;
&lt;li&gt;Built-in SFTP&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>opensource</category>
      <category>electron</category>
      <category>typescript</category>
    </item>
    <item>
      <title>How to get started with TypeScript</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Wed, 19 Feb 2020 20:16:06 +0000</pubDate>
      <link>https://dev.to/tomlienard/how-to-get-started-with-typescript-36fo</link>
      <guid>https://dev.to/tomlienard/how-to-get-started-with-typescript-36fo</guid>
      <description>&lt;p&gt;Welcome to this guide of « How to get started with TypeScript ». What you need to follow this guide is :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of JavaScript&lt;/li&gt;
&lt;li&gt;NPM or Yarn installed&lt;/li&gt;
&lt;li&gt;An IDE like Visual Studio Code or Intellij/WebsStorm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s all !&lt;br&gt;
Now that you have everything you need to start, let’s follow along !&lt;/p&gt;
&lt;h2&gt;
  
  
  What is TypeScript ?
&lt;/h2&gt;

&lt;p&gt;TypeScript is an evolution of JavaScript, created, developed and maintained by Microsoft. As in it’s name, it’s a typed evolution of JavaScript, which means your current JavaScript codes works in TypeScript. You can then compile your TypeScript code to a clean JavaScript code, which you can use without problems like any one.&lt;br&gt;
TypeScript is also open-source, so everyone can contribute to this language.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing TypeScript
&lt;/h2&gt;

&lt;p&gt;From your favorite command-line, create a fresh NPM project, and install TypeScript :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
npm install -g typescript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once done, create the index.ts file which come in every JS applications, but notice the extension .ts. You’re done for the installation !&lt;/p&gt;

&lt;h2&gt;
  
  
  TypeScript basics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Variables
&lt;/h3&gt;

&lt;p&gt;In TypeScript, you can — and you should — specify the type of the variables. For instance, take this piece of 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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In plain JS, you can re-asign the number variable to a string :&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;myNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Non-typed variable&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 may notice, it’s not very practicable. So, to specify the type of the variable, which is number :&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;let&lt;/span&gt; &lt;span class="nx"&gt;myNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this done, the type of myNumber is now set to number. And you can do this with string and boolean.&lt;/p&gt;

&lt;h3&gt;
  
  
  Functions
&lt;/h3&gt;

&lt;p&gt;Type in functions is also very usefull. Take this exemple :&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;function&lt;/span&gt; &lt;span class="nx"&gt;fooBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="p"&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;foo&lt;/span&gt; &lt;span class="o"&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="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;bar&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;You don’t know what type of variable is foo and bar. So, let’s do the same as upside :&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;function&lt;/span&gt; &lt;span class="nx"&gt;fooBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want a parameter to be optional, just add a ? after the name :&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;function&lt;/span&gt; &lt;span class="nx"&gt;fooBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty cool, isn’t it ?&lt;/p&gt;

&lt;h3&gt;
  
  
  Enums
&lt;/h3&gt;

&lt;p&gt;If you came from Java, C… you are familiar with Enumerations. As in it’s name, it’s an enumeration of keys, but a exemple is better than words :&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="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;FooBar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;FOO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;BAR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// print '0', because it’s the first index&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;FooBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FOO&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, enums start with index 0, but you can specify the value you want :&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="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;FooBar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;FOO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;BAR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&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="c1"&gt;// print 'Hello'&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;FooBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FOO&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also specify function parameters to an enum, which is very usefull :&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;function&lt;/span&gt; &lt;span class="nx"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FoorBar&lt;/span&gt;&lt;span class="p"&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;foo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// print 'World&lt;/span&gt;
&lt;span class="nx"&gt;someFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FooBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BAR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Compiling
&lt;/h2&gt;

&lt;p&gt;When you install TypeScript, a command line is added :&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You can provide flags in the command itself, but it’s better to create a tsconfig.js file :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"outDir"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./dist"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Specify&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;out&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;directory&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowJs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Allow&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;plain&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;JS&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"es5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;ES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;version&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;compile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sourceMap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"allowSyntheticDefaultImports"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"include"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"./*"&lt;/span&gt;&lt;span class="w"&gt;               &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;files&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"exclude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"node_modules"&lt;/span&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Exclude&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;node_modules&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;folder&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To compile TS to JS, run this command :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tsc –w
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will convert your TS to JS in the folder you specified, and the -w flag is to watch for changes and recompile automaticaly.&lt;/p&gt;

&lt;p&gt;It’s the end of this brief introduction to TypeScript. Here is the link of the full documentation : &lt;a href="https://www.typescriptlang.org/docs/handbook/basic-types.html"&gt;https://www.typescriptlang.org/docs/handbook/basic-types.html&lt;/a&gt;&lt;br&gt;
I hope it was interesting for you, and thanks for reading !&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Creating my side-project in 2 weeks - day 4</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Fri, 25 Oct 2019 19:02:40 +0000</pubDate>
      <link>https://dev.to/tomlienard/creating-my-side-project-in-2-weeks-day-4-4hp5</link>
      <guid>https://dev.to/tomlienard/creating-my-side-project-in-2-weeks-day-4-4hp5</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;Creating my side-project in 2 weeks&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Fourth day: working on board&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Custom right-click menu&lt;/strong&gt;&lt;br&gt;
I first added a custom right-click menu, which looks like this for the moment:&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftpq67ss8nwjn4ekef2p8.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftpq67ss8nwjn4ekef2p8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see I've only implemented one action, creating cards. But first, let's see how I manage to create this right-click menu - and you will see, it's very easy.&lt;/p&gt;

&lt;p&gt;First, I added a data property to the &lt;code&gt;Board.vue&lt;/code&gt; component:&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="nf"&gt;data&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="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;top&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="na"&gt;left&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="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;menu&lt;/code&gt; is a boolean which depends if the user want to display the context menu or not. &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt; are here to open the right-click menu at the position of the user's cursor.&lt;/p&gt;

&lt;p&gt;Then I added these two events on the main &lt;code&gt;Board.vue&lt;/code&gt; component:&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="nd"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prevent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;menu = true&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prevent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;menu = false&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, very basic stuff. And for &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt;, just a simple &lt;code&gt;@mousemove&lt;/code&gt; event which call a &lt;code&gt;move&lt;/code&gt; method:&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="nf"&gt;move&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&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;menu&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;top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clientY&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;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&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="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;Then we just need to create the menu itself - a simple div hidden by default with the &lt;code&gt;v-if&lt;/code&gt; property:&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;div&lt;/span&gt; &lt;span class="na"&gt;v-if=&lt;/span&gt;&lt;span class="s"&gt;"menu"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"menu"&lt;/span&gt; &lt;span class="na"&gt;:style=&lt;/span&gt;&lt;span class="s"&gt;"'position: absolute; top: ' + this.top + 'px; left: ' + this.left + 'px;'"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"addCard"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"menu-link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"icon-plus"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt; Add a card&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;class=&lt;/span&gt;&lt;span class="s"&gt;"menu-link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"icon-directions"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt; Another action&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;class=&lt;/span&gt;&lt;span class="s"&gt;"menu-link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"icon-trophy"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt; Another action&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Handling the creation of a card&lt;/strong&gt;&lt;br&gt;
When a user click on the &lt;strong&gt;Add a card&lt;/strong&gt; button, we need to create a new card which show at the location of the user's cursor. For this, I created a &lt;code&gt;mutation&lt;/code&gt; in the store of &lt;strong&gt;Vuex&lt;/strong&gt;, to simply push a card object to the array of cards. By doing this, this store is updating and because I fetch the cards list in a &lt;code&gt;computed method&lt;/code&gt;, VueJS re-render all the cards with this updated list and voilà, adding a card is now finished!&lt;/p&gt;

&lt;p&gt;...until I remember that I forgot to update the &lt;code&gt;CardController&lt;/code&gt; to handle the requests when the new card is edited. So here is the logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$card&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Card&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$card&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Updating the card&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Creating a new card      &lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I fetch the card with the id of the request. If the card exist, I update it with the request's content - else I create the card. And here it is!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>vue</category>
      <category>design</category>
    </item>
    <item>
      <title>Creating my side-project in 2 weeks - day 3</title>
      <dc:creator>Tom Lienard</dc:creator>
      <pubDate>Thu, 24 Oct 2019 18:48:21 +0000</pubDate>
      <link>https://dev.to/tomlienard/creating-my-side-project-in-2-weeks-day-3-448c</link>
      <guid>https://dev.to/tomlienard/creating-my-side-project-in-2-weeks-day-3-448c</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;Creating my side-project in 2 weeks&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Third day: improving cards&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here is the third day of this series, let's begin now!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auto-updating cards&lt;/strong&gt;&lt;br&gt;
When a card is moved or his title is changed, we need to send a request through the API to update it in the database. But how to know &lt;strong&gt;when&lt;/strong&gt; I need to update the card ? Here are the points for the moment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When the card title is edited&lt;/li&gt;
&lt;li&gt;When the card content is edited&lt;/li&gt;
&lt;li&gt;After the card was moved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So let's jump to it. I first added a &lt;code&gt;update&lt;/code&gt; data to the Card.vue, and set it to false by default. Then for the input of the title and the textarea of the content, I choose to use the event &lt;code&gt;@blur&lt;/code&gt; which is activated when the user leave the field, to then set the &lt;code&gt;update&lt;/code&gt; value to true. And which event choose when I move the card ? I used the &lt;code&gt;@mouseup&lt;/code&gt; which is rather explicit.&lt;/p&gt;

&lt;p&gt;With this, the request is always not sent, but I now know when I need to update the card. So in the &lt;code&gt;mounted&lt;/code&gt; method, I added a &lt;code&gt;setInterval&lt;/code&gt; which run every 0.5s to check if we need to send the request:&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;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&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="k"&gt;if&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;update&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;update&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Set back 'update' value to false&lt;/span&gt;

            &lt;span class="c1"&gt;// ... Perform the request&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Run the task every 0.5 seconds&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And with this, when I edit the title/content/move the card, I can see that a request is sent...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EE6H4F85--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/su06oix5isgoj0fqjrcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EE6H4F85--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/su06oix5isgoj0fqjrcs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...and the &lt;code&gt;update&lt;/code&gt; data goes back to false:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--650QGmiV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/c0qxkmijfpwhdkcj824p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--650QGmiV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/c0qxkmijfpwhdkcj824p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I just need to update the card's data in the controller, and return back a &lt;strong&gt;JSON&lt;/strong&gt; with the key &lt;code&gt;success&lt;/code&gt;, which can be true or false.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Icon pack&lt;/strong&gt;&lt;br&gt;
I choose to switch from &lt;a href="https://fontawesome.com/"&gt;FontAwesome&lt;/a&gt; to &lt;a href="https://simplelineicons.github.io/"&gt;Simple Line Icons&lt;/a&gt; which - I think - looks really better, simply because it's simpler and thiner - even if there are not as many icons as FontAwesome has. Here is the result on the dashboard sidebar:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uLVsbrfb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/faqx6u1ndjyrmn1ala3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uLVsbrfb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/faqx6u1ndjyrmn1ala3x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dev environment&lt;/strong&gt;&lt;br&gt;
I also setup a dev environment where &lt;strong&gt;you&lt;/strong&gt; can test the - very basic - card sustem. Here ares the credentials for the test account:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email: &lt;a href="mailto:test@gmail.com"&gt;test@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Password: testtest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can login &lt;a href="https://dev.shineboard.io/auth/login"&gt;here&lt;/a&gt; if you want to test it.&lt;/p&gt;

&lt;p&gt;Infortunnately I don’t got the time to create the custom right-click menu, so it will be for tomorrow, with I think the options to create/delete cards and even change the color. Hope you liked this episode, see you tomorrow! &lt;/p&gt;

</description>
      <category>laravel</category>
      <category>vue</category>
      <category>design</category>
    </item>
  </channel>
</rss>
