<?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: Visual Composer</title>
    <description>The latest articles on DEV Community by Visual Composer (@visualcomposer).</description>
    <link>https://dev.to/visualcomposer</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%2Forganization%2Fprofile_image%2F1868%2Fa3b5dccc-2b1c-41ca-9545-3d399f530702.png</url>
      <title>DEV Community: Visual Composer</title>
      <link>https://dev.to/visualcomposer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/visualcomposer"/>
    <language>en</language>
    <item>
      <title>Debugging a problem</title>
      <dc:creator>Filips Masolovs</dc:creator>
      <pubDate>Mon, 11 May 2020 18:13:52 +0000</pubDate>
      <link>https://dev.to/visualcomposer/debugging-a-problem-b5f</link>
      <guid>https://dev.to/visualcomposer/debugging-a-problem-b5f</guid>
      <description>&lt;p&gt;"If debugging is the process of removing software bugs, then programming must be the process of putting them in."&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edsger Dijkstra&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I like this quote! Whenever I am asked something like: "How did this bug appear?" my first response would usually be: "Someone just put it there..."&lt;br&gt;
And then we can check!?&lt;/p&gt;

&lt;p&gt;However, being in this whole new world for less then a year debugging is currently the hardest part for me! Sometimes you open the console and the error is blunt and obvious like "Cannot read property 'smth...' of undefined" most of the times this type of issue will be pretty easy. Obviously there can be times when you struggle to realize why on earth the object or whatever is undefined, but still, probably this is workable!&lt;br&gt;
Then there are hard errors like object doesn’t support property, Uncaught RangeError, ...is not a function and such! These usually take much more time for me to debug and I definitely need to learn to use debugger in such cases more properly, but about this more in the future!&lt;/p&gt;

&lt;p&gt;But then there is hell. And by hell I mean when all the code is loaded, there are no errors in the console, you see what you want to see in the DOM, but... but the functionality isn't working! This is extremely tedious when you know for sure that it was working before.&lt;br&gt;
And this is the type of "bug" that frustrates me the most for now!&lt;br&gt;
When I encounter bugs I usually at the least know where to check, but in cases like this, it is from a to z... So what to do? Dig?&lt;/p&gt;

&lt;p&gt;What are your stories with debugging and bugs in general?&lt;br&gt;
Care to share?&lt;/p&gt;

&lt;p&gt;P.S. I would like to write an article about my thoughts on design docs next! Would you be interested in reading it?&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>cleancode</category>
      <category>codenewbie</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Become more productive with these 5 terminal tips</title>
      <dc:creator>Nikita Hlopov</dc:creator>
      <pubDate>Mon, 16 Mar 2020 13:44:14 +0000</pubDate>
      <link>https://dev.to/visualcomposer/become-more-productive-with-these-5-terminal-tips-2h75</link>
      <guid>https://dev.to/visualcomposer/become-more-productive-with-these-5-terminal-tips-2h75</guid>
      <description>&lt;p&gt;Five small tips to improve your terminal skills that I've learned from my teammate.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Change directory from root&lt;/li&gt;
&lt;li&gt;Line navigation&lt;/li&gt;
&lt;li&gt;Remove the line&lt;/li&gt;
&lt;li&gt;Repeat the previous command with &lt;code&gt;sudo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Suggestions with Tab button&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Change directory from root
&lt;/h2&gt;

&lt;p&gt;From any directory location in your terminal, you can start directory change from the root folder. Right after &lt;code&gt;cd&lt;/code&gt; command add a Space and a / to begin change. E.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/log/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Line navigation
&lt;/h2&gt;

&lt;p&gt;Navigate through your line with ease. Either jump to the start and end of the line:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
fn + shift(⇧) + ← - Jump to the start of the line&lt;/li&gt;
&lt;li&gt;
fn + shift(⇧) + → - Jump to the end of the line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or jump by word:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
alt(⌥) + ← - Jump to the previous word&lt;/li&gt;
&lt;li&gt;
alt(⌥) + → - Jump to the next word&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Remove the line
&lt;/h2&gt;

&lt;p&gt;This command will remove all text in the current line and leave cursor blinking at the start:&lt;/p&gt;

&lt;p&gt;ctrl(⌃) + u&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Repeat the previous command with &lt;code&gt;sudo&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Very handy if you need to repeat the command with superuser permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="o"&gt;!!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Suggestions with Tab button
&lt;/h2&gt;

&lt;p&gt;Double-clicking on Tab button while writing a path to a file will show you suggestions (contents) of the directory. It comes in handy when you need to type in a long path.&lt;/p&gt;

&lt;p&gt;That's it for now. Happy coding. 👩‍💻👨‍💻&lt;/p&gt;

&lt;p&gt;Cover image via Unsplash by &lt;a href="https://unsplash.com/@goran_ivos"&gt;Goran Ivos&lt;/a&gt;&lt;/p&gt;

</description>
      <category>bash</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>terminal</category>
    </item>
    <item>
      <title>How to clean your git history</title>
      <dc:creator>Slava Vasenin</dc:creator>
      <pubDate>Mon, 16 Mar 2020 12:31:04 +0000</pubDate>
      <link>https://dev.to/visualcomposer/how-to-clean-your-git-history-32lg</link>
      <guid>https://dev.to/visualcomposer/how-to-clean-your-git-history-32lg</guid>
      <description>&lt;p&gt;Hi!&lt;br&gt;
I want to share you a short instruction on how to remove wrong or mistaken commits from a remote repository when you don't want to make a revert.&lt;/p&gt;

&lt;p&gt;Check changes and find what commits you want to remove.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git log &lt;span class="nt"&gt;--stat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the interactive rebase command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; HEAD~X
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put the number of commits instead of &lt;strong&gt;X&lt;/strong&gt; which you want to remove. Better to add a bit more to view the previous ones also. So, you need to remove 1 commit add number 3.&lt;/p&gt;

&lt;p&gt;You will see something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pick a0b45b373 Dynamic field featured image url fixed
pick 8e8d27747 Update render condition for feedback popup component
pick 843770a32 Add dev.to version

# Rebase 680ac7c26..843770a32 onto 680ac7c26 (3 commands)
#
# Commands:
# p, pick &amp;lt;commit&amp;gt; = use commit
# r, reword &amp;lt;commit&amp;gt; = use commit, but edit the commit message
# e, edit &amp;lt;commit&amp;gt; = use commit, but stop for amending
# s, squash &amp;lt;commit&amp;gt; = use commit, but meld into previous commit
# f, fixup &amp;lt;commit&amp;gt; = like "squash", but discard this commit's log message
# x, exec &amp;lt;command&amp;gt; = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop &amp;lt;commit&amp;gt; = remove commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I use Vim as default text editor for Git.&lt;/p&gt;

&lt;p&gt;Replace the word &lt;code&gt;pick&lt;/code&gt; with the word &lt;code&gt;drop&lt;/code&gt; or &lt;code&gt;d&lt;/code&gt; for those commits that you want to remove. I remove only one, but I also checked and see that previous commits not related to my changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pick a0b45b373 Dynamic field featured image url fixed
pick 8e8d27747 Update render condition for feedback popup component
d 843770a32 Add dev.to version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit from your editor.&lt;/p&gt;

&lt;p&gt;Check git status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git status
On branch master
Your branch is behind &lt;span class="s1"&gt;'origin/master'&lt;/span&gt; by 1 commit, and can be fast-forwarded.
  &lt;span class="o"&gt;(&lt;/span&gt;use &lt;span class="s2"&gt;"git pull"&lt;/span&gt; to update your &lt;span class="nb"&gt;local &lt;/span&gt;branch&lt;span class="o"&gt;)&lt;/span&gt;

nothing to commit, working tree clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In some cases, there can be merge conflicts after rebase. Follow instructions to solve them.&lt;/p&gt;

&lt;p&gt;The next step is to push it to your remote repository. You need to force this push because the remote repository will think that your current branch is behind.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go and check your remote repository.&lt;/p&gt;

&lt;p&gt;That it. Thanks and Good luck 🚀&lt;/p&gt;

&lt;p&gt;Cover image by &lt;a href="https://www.flickr.com/photos/broccolini/5597043374"&gt;Diana Mounter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>vim</category>
    </item>
    <item>
      <title>⚛️ Initiate a React app with multiple components on a single DOM element</title>
      <dc:creator>Nikita Hlopov</dc:creator>
      <pubDate>Mon, 09 Mar 2020 13:22:10 +0000</pubDate>
      <link>https://dev.to/visualcomposer/initiate-a-react-app-with-multiple-components-on-a-single-dom-element-2899</link>
      <guid>https://dev.to/visualcomposer/initiate-a-react-app-with-multiple-components-on-a-single-dom-element-2899</guid>
      <description>&lt;p&gt;In this article, I'll go through the use case of rendering multiple React components to a single DOM element of a React app.&lt;/p&gt;

&lt;p&gt;There might be a case when your app consists of independent components that might need to be initiated from different places on different conditions but inside a single container.&lt;/p&gt;

&lt;p&gt;Turns out that React can handle these cases with ease.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initiate a generic React app&lt;/li&gt;
&lt;li&gt;Initiate a React app with multiple components&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Initiate a generic React app
&lt;/h2&gt;

&lt;p&gt;Usually, the generic React app begins like so:&lt;/p&gt;

&lt;p&gt;HTML have a single &lt;code&gt;div&lt;/code&gt; container element:&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;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The React part is a &lt;strong&gt;single component&lt;/strong&gt; that gets rendered inside a given DOM container:&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;appContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&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="nx"&gt;Form&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;handleSubmit&lt;/span&gt; &lt;span class="o"&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;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email@example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Form&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;appContainer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Initiate a React app with multiple components
&lt;/h2&gt;

&lt;p&gt;To initiate your app with multiple components you need to wrap them in a &lt;a href="https://reactjs.org/docs/fragments.html"&gt;React Fragment&lt;/a&gt; inside the &lt;code&gt;ReactDOM.render&lt;/code&gt; method.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fragments let you group a list of children without adding extra nodes to the DOM.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&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;appContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&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="nx"&gt;Form&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;handleSubmit&lt;/span&gt; &lt;span class="o"&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;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email@example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Content&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Subscribe&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;our&lt;/span&gt; &lt;span class="nx"&gt;newsletter&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Content&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Form&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&amp;gt;, appContainer&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The good part about it is that you can wrap those components in a variable and render them based on a condition if necessary.&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;formComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Form&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;contentComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;isVisible&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Content&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;components&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;contentComponent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;formComponent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;components&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;appContainer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a complex environment (ours is a WordPress plugin), it is a great way to control what gets delivered to the user.&lt;/p&gt;

&lt;p&gt;See full example on CodePen:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/nikitahl/embed/gOpoOEj?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>5 reasons to write Semantic HTML</title>
      <dc:creator>Nikita Hlopov</dc:creator>
      <pubDate>Wed, 04 Mar 2020 17:47:35 +0000</pubDate>
      <link>https://dev.to/visualcomposer/5-reasons-to-write-semantic-html-280f</link>
      <guid>https://dev.to/visualcomposer/5-reasons-to-write-semantic-html-280f</guid>
      <description>&lt;p&gt;I’ll go through a list of 5 reasons why web developers should pay more attention to semantic HTML.&lt;/p&gt;

&lt;p&gt;Another repost of my original article on the &lt;a href="https://nikitahl.com/why-it-is-important-to-write-semantic-html/"&gt;importance of writing semantic HTML&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understandable code&lt;/li&gt;
&lt;li&gt;Screen readers&lt;/li&gt;
&lt;li&gt;Search engines (SEO)&lt;/li&gt;
&lt;li&gt;Usability (UX)&lt;/li&gt;
&lt;li&gt;Default styling&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What does MDN say about Semantic HTML:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In programming, Semantics refers to the meaning of a piece of code — for example ... "what purpose or role does that HTML element have" (rather than "what does it look like?".)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the number one reason is:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understandable code
&lt;/h2&gt;

&lt;p&gt;By giving meaning to your markup, you make it more understandable. From a human perspective semantic code is more readable, understandable and easier to maintain. Imagine looking at the code like this:&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;id=&lt;/span&gt;&lt;span class="s"&gt;”brown-fox”&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;A story of quick brown fox&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;The quick brown fox jumps over the lazy dog.&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;Properties:&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;- quick&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;- brown&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;- jumpy&lt;span class="nt"&gt;&amp;lt;/div&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;The same structure but with meaningful tags:&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;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;”brown-fox”&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;A story of quick brown fox&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The quick brown fox jumps over the lazy dog.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Properties:&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;quick&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;brown&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;jumpy&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can immediately spot the difference. Straight off the bat, you can tell what each part of the structure does.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Screen readers
&lt;/h2&gt;

&lt;p&gt;Not only humans (programmers) have the need to understand the meaning of the page structure, so do the machines, one of them are screen readers.&lt;/p&gt;

&lt;blockquote&gt;
  A screen reader is a form of assistive technology which is essential to people who are blind, as well as useful to people who are visually impaired, illiterate, or have a learning disability.   &lt;br&gt;
    —&lt;cite&gt;&lt;a href="https://en.wikipedia.org/wiki/Screen_reader"&gt;Wikipedia&lt;/a&gt;&lt;/cite&gt;
&lt;/blockquote&gt;

&lt;p&gt;A screen reader analyzes the contents of the web page and outputs the results via speech. This means whatever a screen reader sees, it will read. So it’s quite important to structurize your web page with a meaning. However modern screen readers are quite &lt;em&gt;“smart”&lt;/em&gt; and handle web pages very well.&lt;/p&gt;

&lt;p&gt;Both MAC and Windows have built-in screen readers. For MAC it is &lt;a href="https://www.apple.com/accessibility/mac/vision/"&gt;VoiceOver&lt;/a&gt;, for Windows it is &lt;a href="https://support.microsoft.com/en-us/help/22798/windows-10-complete-guide-to-narrator"&gt;Narrator&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Search engines (SEO)
&lt;/h2&gt;

&lt;p&gt;Moving on from one machine type to another. The structure of your web page can affect SEO (Search Engine Optimization) results.&lt;/p&gt;

&lt;blockquote&gt;
  SEO stands for ‘Search Engine Optimization’. It’s the practice of optimizing your web pages to make them reach a high position in the search results of Google or other search engines.
    —&lt;cite&gt;&lt;a href="https://yoast.com/what-is-seo/"&gt;YOAST&lt;/a&gt;&lt;/cite&gt;
&lt;/blockquote&gt;

&lt;p&gt;However semantic HTML is not the primary factor that affects the SEO of the page, but it helps page &lt;a href="https://www.google.com/search/howsearchworks/crawling-indexing/"&gt;crawlers&lt;/a&gt; understand the structure of this page. A page with proper semantic HTML will have a chance to &lt;a href="https://www.inboundnow.com/html5-semantic-elements-mean-seo/"&gt;rank higher in the search results&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Usability (UX)
&lt;/h2&gt;

&lt;p&gt;By using semantics not only you are aiding the machines, but you can also help people and make their lives better. The use of proper semantic HTML can boost up your website usability and accessibility. I think you all will agree with me, that you like resources that are intuitive and easy to use.&lt;/p&gt;

&lt;p&gt;Sometimes small adjustments or fine-tuning can make a huge difference for users. For instance, adding a &lt;code&gt;label&lt;/code&gt; element next to &lt;code&gt;input&lt;/code&gt;, or adding a proper attribute to the same &lt;code&gt;input&lt;/code&gt; element.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Default styling
&lt;/h2&gt;

&lt;p&gt;The good thing about semantic HTML, that elements come with default styling. Even without additional CSS the page that is built with proper semantic HTML will look good, be accessible and is going to provide the meaning and outline the structure.&lt;/p&gt;

&lt;p&gt;Even though the default styling can vary from browser to browser, the main look of the page will remain.&lt;/p&gt;

&lt;p&gt;Default styling comes to the rescue when something goes wrong and your CSS fails.&lt;/p&gt;

&lt;p&gt;Below I’ll share a list of resources I have found useful when I was learning about semantic HTML and Semantic Web in particular.&lt;/p&gt;

&lt;p&gt;Blogs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codepen.io/mi-lee/post/an-overview-of-html5-semantics"&gt;https://codepen.io/mi-lee/post/an-overview-of-html5-semantics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://internetingishard.com/html-and-css/forms/"&gt;https://internetingishard.com/html-and-css/forms/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://html5doctor.com/lets-talk-about-semantics/"&gt;http://html5doctor.com/lets-talk-about-semantics/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/17272019/why-to-use-html5-semantic-tag-instead-of-div"&gt;https://stackoverflow.com/questions/17272019/why-to-use-html5-semantic-tag-instead-of-div&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webflow.com/blog/html5-semantic-elements-and-webflow-the-essential-guide"&gt;https://webflow.com/blog/html5-semantic-elements-and-webflow-the-essential-guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.dallasseogeek.com/uncategorized/understanding-semantic-html-and-its-applications-for-2015-and-beyond/#.WdRs79MjFTY"&gt;https://www.dallasseogeek.com/uncategorized/understanding-semantic-html-and-its-applications-for-2015-and-beyond/#.WdRs79MjFTY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.smashingmagazine.com/2011/11/our-pointless-pursuit-of-semantic-value/"&gt;https://www.smashingmagazine.com/2011/11/our-pointless-pursuit-of-semantic-value/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://html5doctor.com/microformats/"&gt;http://html5doctor.com/microformats/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://html5doctor.com/microdata/"&gt;http://html5doctor.com/microdata/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lifewire.com/why-use-semantic-html-3468271"&gt;https://www.lifewire.com/why-use-semantic-html-3468271&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Docs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Semantic_Web"&gt;https://en.wikipedia.org/wiki/Semantic_Web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/fundamentals/native-hardware/click-to-call/"&gt;https://developers.google.com/web/fundamentals/native-hardware/click-to-call/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/"&gt;https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://microformats.org/wiki/html5"&gt;http://microformats.org/wiki/html5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time"&gt;https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/RDF/FAQ"&gt;https://www.w3.org/RDF/FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/2006/Talks/0718-aaai-tbl/Overview.html#(1)"&gt;https://www.w3.org/2006/Talks/0718-aaai-tbl/Overview.html#(1)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/virtuoso-blog/a-semantic-web-artificial-intelligence-ea480b8f4507"&gt;https://medium.com/virtuoso-blog/a-semantic-web-artificial-intelligence-ea480b8f4507&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA"&gt;https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/TR/rdfa-primer/"&gt;https://www.w3.org/TR/rdfa-primer/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://schema.org/docs/about.html"&gt;http://schema.org/docs/about.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://rdfa.info/"&gt;http://rdfa.info/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Semantics#Semantics_in_HTML"&gt;https://developer.mozilla.org/en-US/docs/Glossary/Semantics#Semantics_in_HTML&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Videos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=qvONd7Z8vec"&gt;https://www.youtube.com/watch?v=qvONd7Z8vec&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=z9_rdtdA2BQ"&gt;https://www.youtube.com/watch?v=z9_rdtdA2BQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=OGg8A2zfWKg"&gt;https://www.youtube.com/watch?v=OGg8A2zfWKg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to measure deployment frequency for WordPress plugin</title>
      <dc:creator>Slava Vasenin</dc:creator>
      <pubDate>Tue, 03 Mar 2020 15:02:40 +0000</pubDate>
      <link>https://dev.to/visualcomposer/how-to-measure-deployment-frequency-for-wordpress-plugin-1j5</link>
      <guid>https://dev.to/visualcomposer/how-to-measure-deployment-frequency-for-wordpress-plugin-1j5</guid>
      <description>&lt;p&gt;One year ago I read a very great book about DevOps science &lt;a href="https://www.goodreads.com/book/show/35747076-accelerate"&gt;"Accelerate"&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There was a chapter about measurements that can be used to answer the question: Does your company has High-performance team in the development?&lt;/p&gt;

&lt;p&gt;These measurements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployment Frequency&lt;/li&gt;
&lt;li&gt;Lead Time for changes&lt;/li&gt;
&lt;li&gt;MTTR&lt;/li&gt;
&lt;li&gt;Change Failure rate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the most interesting points is &lt;strong&gt;Deployment Frequency&lt;/strong&gt; and we had a long discussion about this in my team about that. The book says that the high-performance team should deliver on-demand, multiple deploys per day. &lt;/p&gt;

&lt;p&gt;The problem is that if we will publish one plugin every day multiple times in &lt;a href="https://wordpress.org/plugins/visualcomposer/"&gt;"WordPress.org"&lt;/a&gt; people won't like it because there are no automatic updates for Wordpress plugins in the admin dashboard.&lt;/p&gt;

&lt;p&gt;So, Publishing so frequently isn't an option, but the concept to have a deliverable product as often as the possible sound really useful. &lt;/p&gt;

&lt;p&gt;We use a &lt;a href="https://trunkbaseddevelopment.com/"&gt;trunk-based development&lt;/a&gt; branching model. What does it mean?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A source-control branching model, where developers collaborate on code in a single branch called ‘trunk’(master), resist any pressure to create other long-lived development branches by employing documented techniques. They, therefore, avoid merge hell, do not break the build, and live happily ever after.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is a master branch were we merge all pull requests. Is it safe? From point of continues integrations, we run tests pipeline for every commit and every merge. Sound safe! How true is it? Not sure. No one during the merge of the pull request thinks it can be delivered to the customer at once.&lt;/p&gt;

&lt;p&gt;The only thing left is to update the release brunch as frequently as possible. Here is our scenario:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Developer crates pull request. Before all CI pipeline's tests have been successfully completed. &lt;/li&gt;
&lt;li&gt;A reviewer checks code and confirms this pull request as valid.&lt;/li&gt;
&lt;li&gt;A reviewer merges pull request.&lt;/li&gt;
&lt;li&gt;Release engineer checks during the day the state of the master branch and if it has updates, decides are this code safe for the update in the current release branch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So every update counts as deployment. Makes sense, isn't it?&lt;/p&gt;

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

&lt;p&gt;If you have any suggestions or you want to share what kind of practices you use in your company, please welcome to write comments :)&lt;/p&gt;

&lt;p&gt;Thanks and Good Luck 🚀&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>github</category>
      <category>codequality</category>
    </item>
    <item>
      <title>Working remotely! YES or NO?</title>
      <dc:creator>Filips Masolovs</dc:creator>
      <pubDate>Wed, 12 Feb 2020 15:56:22 +0000</pubDate>
      <link>https://dev.to/visualcomposer/working-remote-yes-or-no-12hd</link>
      <guid>https://dev.to/visualcomposer/working-remote-yes-or-no-12hd</guid>
      <description>&lt;p&gt;So, today I decided to ponder about working remotely!&lt;br&gt;
Its' pros and cons, whether I really like it or no and is it even productive.&lt;/p&gt;

&lt;p&gt;First of all, I noticed that on the days when I visit the office I am so drained out by the end of the day that I don't want to do anything anymore. This is related to a 2h daily commute that I need to tackle in order to get to the office and to the fact that working in the office quite honestly just takes more out of you due to always chatting with someone, joggling this and that and quite simple more things to do then just tasks at hand.&lt;br&gt;
When I work at home I can easily do some extra work at 8PM, 9PM sometimes even 10PM. No problem. I am not tired from driving for 2h and working at home is quite simple more calming.&lt;/p&gt;

&lt;p&gt;Secondly, I have to say(even though this is very specific from person to person) that my personal productivity level is better at home. And here I mean not the hours spent on work, no-no, I mean the overall amount of work done within a day! Obviously if you lack focus and can't sit for a while at a computer thinking about how to solve an unsolvable problem, maybe, this is not the way for you!&lt;/p&gt;

&lt;p&gt;To conclude, I would like to say, that I really like working remotely!&lt;br&gt;
My productivity is better. I can work more. I am not tired by the end of the day.&lt;/p&gt;

&lt;p&gt;Did you try working remotely? Maybe with a friend?&lt;br&gt;
How did it go? And if you haven't, why?&lt;/p&gt;

&lt;p&gt;Tell me about your experience...&lt;/p&gt;

</description>
      <category>remote</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>How to get WordPress plugin release in GitHub actions</title>
      <dc:creator>Slava Vasenin</dc:creator>
      <pubDate>Mon, 10 Feb 2020 15:18:16 +0000</pubDate>
      <link>https://dev.to/visualcomposer/how-to-get-wordpress-plugin-release-in-github-actions-4336</link>
      <guid>https://dev.to/visualcomposer/how-to-get-wordpress-plugin-release-in-github-actions-4336</guid>
      <description>&lt;p&gt;We started to use GitHub actions to build Visual Composer &lt;a href="https://github.com/VisualComposer/builder/releases"&gt;release&lt;/a&gt; candidates in GitHub. This action will prepare a proper zip archive file which we can use to update our plugin in Wordpress.org. &lt;/p&gt;

&lt;p&gt;We decided that the release will be built on the new tag. The tag will be the version of the published release.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We already had the script which was able to create a valid zip archive of Visual Composer Website Builder for Wordpress.org. It looks like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;node _infrastructure/vcwb-builder/builder plugin &lt;span class="nt"&gt;-b&lt;/span&gt; VERSION &lt;span class="nt"&gt;-p&lt;/span&gt; ./_infrastructure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yeah, this script will set plugin version also &lt;code&gt;-b VERSION&lt;/code&gt;. The question is how to get the version from GitHub tag. There is access to &lt;code&gt;$GITHUB_REF&lt;/code&gt; where we can get tags. I decide to create variable &lt;code&gt;get_version&lt;/code&gt; which can be used in other steps of the job.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get the version&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;get_version&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we just need to use &lt;code&gt;steps.version_version&lt;/code&gt; in the next step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build project&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;yarn install&lt;/span&gt;
    &lt;span class="s"&gt;node _infrastructure/vcwb-builder/builder plugin -b ${{ steps.get_version.outputs.VERSION }} -p ./_infrastructure&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next action is to create Github release itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create Release&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;create_release&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/create-release@v1.0.0&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;tag_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref }}&lt;/span&gt;
    &lt;span class="na"&gt;release_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref }}&lt;/span&gt;
    &lt;span class="na"&gt;draft&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="na"&gt;prerelease&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After release creation needs to upload our zip archive. I use &lt;code&gt;actions/upload-release-asset@v1.0.1&lt;/code&gt; action for that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload Release Asset&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;upload_release_asset&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-release-asset@v1.0.1&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;upload_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.create_release.outputs.upload_url }}&lt;/span&gt;
    &lt;span class="na"&gt;asset_path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./_infrastructure/visualcomposer.zip&lt;/span&gt;
    &lt;span class="na"&gt;asset_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;visualcomposer.zip&lt;/span&gt;
    &lt;span class="na"&gt;asset_content_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/zip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. The full version of the configuration file you can check &lt;a href="https://github.com/VisualComposer/builder/blob/master/.github/workflows/create-dev-release.yml"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Good luck ✌️&lt;/p&gt;

</description>
      <category>github</category>
      <category>devops</category>
      <category>wordpress</category>
      <category>actions</category>
    </item>
    <item>
      <title>The start of my journey!</title>
      <dc:creator>Filips Masolovs</dc:creator>
      <pubDate>Mon, 10 Feb 2020 11:58:23 +0000</pubDate>
      <link>https://dev.to/visualcomposer/the-start-of-my-journey-6c4</link>
      <guid>https://dev.to/visualcomposer/the-start-of-my-journey-6c4</guid>
      <description>&lt;p&gt;01.08.2019&lt;br&gt;
That was the day when my "development" journey started!&lt;br&gt;
I will clarify immediately that the only reason why I put "development" in quotation marks is because I still consider myself far from a decent developer.&lt;/p&gt;

&lt;p&gt;Being a frontend-dev my journey started with HTML, it was easy. I mean with HTML you don't need to think a lot of super complicated logic. What you see is what you get, so yeah those steps were easy.&lt;br&gt;
After that came CSS, I can't say that it is particularly hard, but some CSS stuff is confusing and misleading. Like I still sometimes wonder: "Do I justify or align here?" when working with flex-box. And some things like gradient transition require hacks to work, but these are very easily available on the web.&lt;/p&gt;

&lt;p&gt;But then came the hard part, JS, React.JS...&lt;br&gt;
Here's where things get tricky, here you have to implement logic, use functions and battle Sauron not to get any errors in your console.&lt;br&gt;
For the most part I manage to write the most part of code when I am creating something from scratch and get stuck only at the end and here and there need some refactoring to be done, but the biggest issue for me comes when I battle some already prewritten code. This is where I get stuck.&lt;/p&gt;

&lt;p&gt;But I guess the journey doesn't supposed to be easy? Does it? I mean if it would, what would be the point? So yes, even if I do struggle now on things that may not be so hard, I still see how much I have grown personally in the last few months and I still feel that I can grow further in this industry...&lt;/p&gt;

&lt;p&gt;TTYS, Mr.Masolov&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>javascript</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Writing and debugging Cypress tests</title>
      <dc:creator>Nikita Hlopov</dc:creator>
      <pubDate>Thu, 30 Jan 2020 22:36:49 +0000</pubDate>
      <link>https://dev.to/visualcomposer/writing-and-debugging-cypress-tests-1cii</link>
      <guid>https://dev.to/visualcomposer/writing-and-debugging-cypress-tests-1cii</guid>
      <description>&lt;p&gt;I want to share the knowledge I and my team gained after implementing Cypress e2e tests in our project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;About a year ago we've (&lt;a href="https://github.com/visualcomposer/builder/" rel="noopener noreferrer"&gt;Visual Composer dev team&lt;/a&gt;) picked Cypress as our main tool for e2e tests. It was a new experience for the whole team as none of us was familiar with e2e testing. Over that period of time not only we've covered a large amount of functionality with tests but also we've learned quite a bit.&lt;/p&gt;

&lt;p&gt;Recently I've made a small demo for our team of developers to summarise what we already know. The purpose of this demo was to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Share knowledge and to establish common understanding and principles for e2e tests among all developers in our team&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That inspired me to write an article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;p&gt;Conventionally we can split the app testing process into two parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;writing tests - when a developer actually writes the code&lt;/li&gt;
&lt;li&gt;debugging tests - fixing issues when the test is failing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So that's what I'm going to share with you in a form of tips and solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: Even though our product may be very specific I think these tips can be applicable to a wide variety of projects.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing tests
&lt;/h2&gt;

&lt;p&gt;These tips helped me to write tests and to tackle issues faster and with ease.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Cypress syntax is similar to jQuery
&lt;/h3&gt;

&lt;p&gt;If you know jQuery then understanding that Cypress commands are similar to the jQuery counterparts like &lt;em&gt;selectors&lt;/em&gt; and &lt;em&gt;chaining&lt;/em&gt; will make your Cypress learning curve much smoother.&lt;/p&gt;

&lt;p&gt;E.g. the &lt;code&gt;cy.get()&lt;/code&gt; command will return a collection of elements. Knowing that you'll be able to handle further chaining or resolve the possible error.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Cypress is lacking some features
&lt;/h3&gt;

&lt;p&gt;Some of the functionality cannot be tested like &lt;code&gt;hover&lt;/code&gt; effect or testing within and &lt;code&gt;iframe&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The good part is that the Cypress team is aware of that and communicating to the community on possible solutions and workarounds.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cypress resources
&lt;/h3&gt;

&lt;p&gt;Continuing the thought from the previous point, I really like &lt;a href="https://docs.cypress.io/" rel="noopener noreferrer"&gt;Cypress API documentation&lt;/a&gt; and their &lt;a href="https://github.com/cypress-io/cypress/issues" rel="noopener noreferrer"&gt;GitHub repo's Issues&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I was able to resolve almost every problem just by checking their docs or searching GitHub issues. Stackoverflow helped me as well. 😅&lt;/p&gt;

&lt;p&gt;Overall I find the Cypress team quite engaging and willing to help. &lt;/p&gt;

&lt;h3&gt;
  
  
  4. Folder structure
&lt;/h3&gt;

&lt;p&gt;We are sticking to the recommended folder and file structure in the official &lt;a href="https://docs.cypress.io/guides/references/configuration.html#Folders-Files" rel="noopener noreferrer"&gt;Cypress docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since our project is quite large and multiple components that need to be tested are stored in multiple repositories, having a unified structure helps a lot.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Cypress strange behavior
&lt;/h3&gt;

&lt;p&gt;In our case sometimes Cypress may render duplicate elements. I'm not sure if this is a project-specific issue, but I couldn't find any information on that topic.&lt;/p&gt;

&lt;p&gt;The point is if a specific issue is occurring in your tests, you need to share that information across your team and prepare a solution for such cases.&lt;/p&gt;

&lt;p&gt;Btw, the solution to our issue is since we're only checking the single element we're adding an index with a bracket notation to select the first element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.vce-row-content&lt;/span&gt;&lt;span class="dl"&gt;'&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="nf"&gt;children&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;have.length&lt;/span&gt;&lt;span class="dl"&gt;'&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. CSS values are computed values
&lt;/h3&gt;

&lt;p&gt;When checking for CSS values it's important to understand that Cypress will compare your assertion to a computed CSS value. That is equal to the one you get when using the &lt;code&gt;getComputedStyle()&lt;/code&gt; method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debugging
&lt;/h2&gt;

&lt;p&gt;We separate debugging into two types.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local&lt;/li&gt;
&lt;li&gt;Pipeline&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Local debugging
&lt;/h3&gt;

&lt;p&gt;Usually, it's quite simple but sometimes developers get stuck and having a hard time resolving the issue. Even though the Cypress itself helps to troubleshoot.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Carefully read the error message
&lt;/h4&gt;

&lt;p&gt;Developers are in a hurry and don't read the error message till the very end or read it superficially.&lt;/p&gt;

&lt;p&gt;Sometimes it may contain a clue or a possible solution.&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%2Fpbs.twimg.com%2Fmedia%2FEFI-sskXoAUc-Ri%3Fformat%3Dpng%26name%3D900x900" class="article-body-image-wrapper"&gt;&lt;img alt="Cypress error message" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FEFI-sskXoAUc-Ri%3Fformat%3Dpng%26name%3D900x900"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Additional data in the console
&lt;/h4&gt;

&lt;p&gt;To retrieve additional data click on the step and the data will be outputted in the console.&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%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fcypress-pinned-step.png" class="article-body-image-wrapper"&gt;&lt;img alt="Cypress console error message" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fcypress-pinned-step.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Comment out commands
&lt;/h4&gt;

&lt;p&gt;Comment out commands to get to the problem point faster. We have quite complex logic behind our tests, so they take quite a long time to run. In order to make the debugging process faster, I use that technique.&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="cm"&gt;/* global describe, it, cy */&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ELEMENT_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Text Block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ELEMENT_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Adds element to the page, checks automatically added elements, checks attributes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fixture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../fixtures/textBlock.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;settings&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;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createPage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ELEMENT_NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

      &lt;span class="c1"&gt;// cy.setTinyMce({&lt;/span&gt;
      &lt;span class="c1"&gt;//   title: 'Content',&lt;/span&gt;
      &lt;span class="c1"&gt;//   text: settings.text,&lt;/span&gt;
      &lt;span class="c1"&gt;//   elementType: {&lt;/span&gt;
      &lt;span class="c1"&gt;//     name: settings.elementType.name&lt;/span&gt;
      &lt;span class="c1"&gt;//   },&lt;/span&gt;
      &lt;span class="c1"&gt;//   alignment: {&lt;/span&gt;
      &lt;span class="c1"&gt;//     name: settings.alignment.name&lt;/span&gt;
      &lt;span class="c1"&gt;//   }&lt;/span&gt;
      &lt;span class="c1"&gt;// })&lt;/span&gt;

      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setClassAndId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customClass&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

      &lt;span class="c1"&gt;// cy.setDO(settings.designOptions)&lt;/span&gt;

      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;savePage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;viewPage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.vce-text-block&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="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;have.class&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customClass&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;have.attr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or go straight ahead to the exact page (our tests generate site pages in WordPress)&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="cm"&gt;/* global describe, it, cy */&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ELEMENT_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Text Block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ELEMENT_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Adds element to the page, checks automatically added elements, checks attributes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fixture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../fixtures/textBlock.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;settings&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;// cy.createPage()&lt;/span&gt;
      &lt;span class="c1"&gt;// cy.addElement(ELEMENT_NAME)&lt;/span&gt;

      &lt;span class="c1"&gt;// cy.setTinyMce({&lt;/span&gt;
      &lt;span class="c1"&gt;//   title: 'Content',&lt;/span&gt;
      &lt;span class="c1"&gt;//   text: settings.text,&lt;/span&gt;
      &lt;span class="c1"&gt;//   elementType: {&lt;/span&gt;
      &lt;span class="c1"&gt;//     name: settings.elementType.name&lt;/span&gt;
      &lt;span class="c1"&gt;//   },&lt;/span&gt;
      &lt;span class="c1"&gt;//   alignment: {&lt;/span&gt;
      &lt;span class="c1"&gt;//     name: settings.alignment.name&lt;/span&gt;
      &lt;span class="c1"&gt;//   }&lt;/span&gt;
      &lt;span class="c1"&gt;// })&lt;/span&gt;

      &lt;span class="c1"&gt;// cy.setClassAndId(settings.customId, settings.customClass)&lt;/span&gt;

      &lt;span class="c1"&gt;// cy.setDO(settings.designOptions)&lt;/span&gt;

      &lt;span class="c1"&gt;// cy.savePage()&lt;/span&gt;
      &lt;span class="c1"&gt;// cy.viewPage()&lt;/span&gt;

      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:8888/wp/auto-draft-4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

      &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.vce-text-block&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="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;have.class&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customClass&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;have.attr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;customId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pipeline debugging
&lt;/h3&gt;

&lt;p&gt;We use two different environments to run Cypress on the pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CircleCI&lt;/strong&gt; on GitHub for our main project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gitlab CI&lt;/strong&gt; on GitLab for other projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They both basically do the same stuff, the main difference is the interface.&lt;/p&gt;

&lt;p&gt;On pipeline we use Docker image with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apache server&lt;/li&gt;
&lt;li&gt;Pre-installed WordPress&lt;/li&gt;
&lt;li&gt;Pre-installed theme&lt;/li&gt;
&lt;li&gt;Pre-installed plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Debugging on the pipeline is essentially similar to a local.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Read the error message
&lt;/h4&gt;

&lt;p&gt;Like in the Local debugging read the error, half of the times it will be enough. The image below is the error message from the GitLab CI terminal.&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%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fgitlab-terminal-error.png" class="article-body-image-wrapper"&gt;&lt;img alt="GitLab CI terminal error message" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fgitlab-terminal-error.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. See artifacts (screenshot or video)
&lt;/h4&gt;

&lt;p&gt;By default Cypress have screenshots enabled, but we also enabled video recording. To improve performance a little, we've enabled video recording only on failure. Video recording can be enabled in the &lt;code&gt;cypress.json&lt;/code&gt; config 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="nl"&gt;"video"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the test is failed now we can check a screenshot or a video.&lt;/p&gt;

&lt;p&gt;Artifacts on GitLab CI:&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%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fgitlab-artifacts.png" class="article-body-image-wrapper"&gt;&lt;img alt="GitLab CI artifacts" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fgitlab-artifacts.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Artifacts on CircleCI:&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%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fcircleci-artifacts.png" class="article-body-image-wrapper"&gt;&lt;img alt="CircleCI artifacts" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fnikitahl%2Fimages-from-e2e-testing%2Fmaster%2Fcircleci-artifacts.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Plugins for debugging
&lt;/h4&gt;

&lt;p&gt;The following plugins can be used both locally and on the pipeline. We're saving up resources and using them rarely only for intricate cases. For the most part, it's enough with error messages and artifacts, but it's good to know that such plugins exist.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Saves the Cypress test command log as a JSON file if a test fails &lt;a href="https://github.com/bahmutov/cypress-failed-log" rel="noopener noreferrer"&gt;https://github.com/bahmutov/cypress-failed-log&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Cypress plugin that sends all logs that occur in the browser to stdout in the terminal &lt;a href="https://github.com/flotwig/cypress-log-to-output" rel="noopener noreferrer"&gt;https://github.com/flotwig/cypress-log-to-output&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Inner docs
&lt;/h2&gt;

&lt;p&gt;If your team or project has an inner knowledge base or even if you don't, start documenting. Over time there's just too much information piling in the heads of developers.&lt;/p&gt;

&lt;p&gt;We've begun documenting &lt;em&gt;howtos&lt;/em&gt; and practices on e2e testing. That way all developers now have a point of reference.&lt;/p&gt;

&lt;p&gt;You don't have to scale to full-blown documentation at once. Start with a single document and a few code snippets. 😉&lt;/p&gt;

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

&lt;p&gt;These are the techniques we use to write the e2e tests. I do hope that people can draw from our knowledge and improve their testing. Let us know what techniques and methods you are using by replying in the comments.&lt;/p&gt;

&lt;p&gt;Check out our tests they are available in our &lt;a href="https://github.com/VisualComposer/builder" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>cypress</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
