<?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: Vitali Havryliuk</title>
    <description>The latest articles on DEV Community by Vitali Havryliuk (@uiwebkit).</description>
    <link>https://dev.to/uiwebkit</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%2F781425%2F440bda5e-4497-492a-af63-6c207831e67d.jpeg</url>
      <title>DEV Community: Vitali Havryliuk</title>
      <link>https://dev.to/uiwebkit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/uiwebkit"/>
    <language>en</language>
    <item>
      <title>Application development with 100% customization. Customization Driven Development (CDD)</title>
      <dc:creator>Vitali Havryliuk</dc:creator>
      <pubDate>Sun, 09 Oct 2022 20:03:07 +0000</pubDate>
      <link>https://dev.to/uiwebkit/application-development-with-100-customization-customization-driven-development-cdd-34p4</link>
      <guid>https://dev.to/uiwebkit/application-development-with-100-customization-customization-driven-development-cdd-34p4</guid>
      <description>&lt;p&gt;In this article I want to share my experience in developing interfaces with a level of customization up to 100% (real 100%). At the same time, backward compatibility and the possibility of updates are preserved. Magic? - No, it's &lt;strong&gt;CDD&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--foSL8iZY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72ck0m5f390rzcmgz1q3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--foSL8iZY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72ck0m5f390rzcmgz1q3.jpg" alt="Customization everywhere, CDD" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It all started back in 2018 in a large international company. I was invited to the main office to explain to the top management how we were going to solve the problem of customizing our product, and specifically the UI part. Clients needed to slightly change it for themselves and add something. It was necessary to maintain backward compatibility so that customers could receive product updates. Then I knew only the possibility of adding "holes" in the code (&lt;strong&gt;slots&lt;/strong&gt;), where you can add any functionality. Well, also I knew about the &lt;strong&gt;API&lt;/strong&gt; for changing already developed functionality. It is clear that there was no talk of any possibility of customization at 100%, because then you need to change the source code, and this is a loss of backward compatibility by itself.&lt;/p&gt;

&lt;p&gt;Of course, not everyone needs a &lt;strong&gt;CDD&lt;/strong&gt;. This technique will be extremely useful when developing a product whose customers need a deep customization. I mean, not just change the logo and the name, but also change absolutely everything your heart desires. And at the same time not to lose the possibility of future updates of the product.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How to achieve almost 100% customization without losing backward compatibility?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CDD&lt;/strong&gt; uses "declarative customization", i.e. the entire view with logic must be turned outside for full customization. If it is necessary to customize certain parts of a rather complex component, then we just render its simpler internal components. These components can be packaged in a so-called "black box" with a rich &lt;strong&gt;API&lt;/strong&gt; and "holes" (&lt;strong&gt;slots&lt;/strong&gt;), or they may be rendered with even simpler components.&lt;/p&gt;

&lt;p&gt;And here you can object: “But how, if we change the internal content, then we lose the possibility of updates!”. No, that's not entirely true, and that's why:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A component of any complexity (except for a primitive one) is just a set of simpler components. This set is always freely available and we clearly see what and where has changed in this set (when it is updated) and can update it very simply and quickly manually (if it is necessary);&lt;/li&gt;
&lt;li&gt;A complex component consists of simpler components. They can be rendered in their standard, packaged form (if we do not need deep customization) and then we will receive their updates automatically;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Well. But how can this be achieved? What are the steps?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;First you need to develop the most primitive components. They can, and some of them even should, have 2 versions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The standard component&lt;/strong&gt;, the "black box" with a rich &lt;strong&gt;API&lt;/strong&gt; and "holes" (&lt;strong&gt;slots&lt;/strong&gt;). Easy to use, but has limited customization options;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The wrapper component&lt;/strong&gt;, that extends the capabilities of the content that you place inside. Less convenient to use, but much more customizable, up to 100%. Required for standard HTML elements:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button&amp;gt;, &amp;lt;a&amp;gt;, &amp;lt;form&amp;gt;, &amp;lt;input&amp;gt;, &amp;lt;textarea&amp;gt;, &amp;lt;select&amp;gt;, …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When developing more complex components, you need to use a set of simpler ones. Like primitive components, more complex components can have 2 versions. It’s not necessary to create a wrapper component: if you can wrap only a declarative template from simpler components into a standard component (without code to manage it). And then you can just use the inner content when customization is needed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In theory, everything is fine. How are things in practice?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can see this right now in the example of the &lt;a href="https://uiwebkit.com/wgt/loc/2/menu/?type=element"&gt;localization widget&lt;/a&gt;. There are tabs, switching between you can see the difference. Sources: &lt;a href="https://github.com/uiwebkit/localize"&gt;Github&lt;/a&gt;. Also, I am currently preparing a smaller project for publication and it is fully Open Source. There you can clearly see all the advantages of &lt;strong&gt;CDD&lt;/strong&gt;. The project will be extremely useful for those who often work with complex and custom HTML forms with dynamic fields and validations. I would like to talk about it in more detail, but this is a topic for another article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UdYp5FiW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1nstjf3onvq3f98e2rid.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UdYp5FiW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1nstjf3onvq3f98e2rid.jpg" alt="More customization, CDD" width="880" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, I would like to recall the project of customizable mobile phones &lt;strong&gt;Project Ara&lt;/strong&gt;. Using this example, you can see that not everyone and not always needs customization. And few people want to overpay for the possibility of customization. But the few who really need customization are willing to experiment and try different approaches to get exactly the result that meets their expectations.&lt;/p&gt;

&lt;p&gt;I will be glad to read your comments and opinions on this technique and feel free to write me a personal message. Thank you!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Auto Regex Generator / Builder</title>
      <dc:creator>Vitali Havryliuk</dc:creator>
      <pubDate>Sun, 27 Mar 2022 20:44:15 +0000</pubDate>
      <link>https://dev.to/uiwebkit/auto-regex-generator-builder-57l7</link>
      <guid>https://dev.to/uiwebkit/auto-regex-generator-builder-57l7</guid>
      <description>&lt;p&gt;Almost all developers sooner or later come across regular expressions. In almost 99% of cases, we absolutely do not like to write them, considering it a side job that is not related to programming.&lt;/p&gt;

&lt;p&gt;Most of us, when faced with this problem for the first time, begin to type in search engines something like: “auto regex generator” and, to our great regret, realize that &lt;del&gt;Google is broken&lt;/del&gt; all search results are services for checking the correctness of an already built regular expression (or I googled badly).&lt;/p&gt;

&lt;p&gt;But how to write this most regular expression?&lt;/p&gt;

&lt;p&gt;Basically, there were 2 answers to this question:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To learn the documentation on regular expressions and create a regular expression by yourself;&lt;/li&gt;
&lt;li&gt;To ask someone more experienced to do it for you;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, I am happy to introduce the 3rd answer - &lt;a href="https://uiregex.com"&gt;UiRegex&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The backstory
&lt;/h3&gt;

&lt;p&gt;In one project, a rather interesting and complex request came from internal users. Technical support staff needed to set their own validation rules for certain fields for different users. The rules had to be changed frequently and very quickly.&lt;/p&gt;

&lt;p&gt;Like any good developer, I naturally started by looking for ready-made solutions. Nothing suitable was found and I had to proceed with a very primitive implementation. On the complex, as usual, there was neither money nor time.&lt;/p&gt;

&lt;p&gt;But this problem hooked me very much, and now, finally, I am glad to present to you the fruits of my labor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web service
&lt;/h3&gt;

&lt;p&gt;I wanted to make it as simple as possible (for a wider range of people), so that not only programmers, but also people who are far from programming (moderators / administrators) could make their own validation rules.&lt;/p&gt;

&lt;p&gt;Here is the interface itself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--diTNtA2u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdg1bhkjy3h6085jqlx9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--diTNtA2u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdg1bhkjy3h6085jqlx9.jpg" alt="UiRegex interface" width="880" height="632"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As expected, it was difficult for new users to figure out what to do, so I added hidden tooltips.&lt;/p&gt;

&lt;p&gt;The first thing that meets you is an "Examples" card and this is done specifically for easier understanding of how it works. I recommend choosing the example closest to your task. Also, you can simply switch between correct and incorrect examples. You can then modify the example you have chosen as you wish. Over time, the list of examples will expand:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O2Yids9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mye469x2u3hlnu6ie0on.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O2Yids9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mye469x2u3hlnu6ie0on.jpg" alt="UiRegex examples" width="520" height="1247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next comes the thing for which it was all started - the generated Regular Expression: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fefwo0s0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tq4u0i05n7mmhwz4hx7f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fefwo0s0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tq4u0i05n7mmhwz4hx7f.jpg" alt="UiRegex regular expression" width="880" height="67"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here I would like to stop a little and tell you more.&lt;/p&gt;

&lt;p&gt;At first, I wanted to create a tool that would not restrict users in creating polysyllabic regular expressions and at the same time make the interface as simple as possible. It is possible to create a regex with groups / subgroups, define optional parts (not required), specify specific characters (the rest will have a type determined), specify the type - "any symbol" and block certain characters in a specific part of the regex. You can quite simply create a regular expression not only for a word, but also for a phrase and even a sentence. Generation of regular expressions is available both in Latin and Cyrillic (separately and together). As additional localizations of the interface are added, it is planned to support regular expressions for other writings.&lt;/p&gt;

&lt;p&gt;By the way, do not be afraid that the regular expression is always red. This does not symbolize an error, but is done only in order to focus your attention on this extremely important information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test value
&lt;/h3&gt;

&lt;p&gt;Here, the entered test value is checked to match the generated regular expression. And it happens “on the fly”. You don't need to press anything. Thus, you can check many options much faster and more conveniently.&lt;/p&gt;

&lt;p&gt;If the test value does not match the generated regular expression, a description of the generated rule / regular expression is displayed under the Test input field. Rule description displays as set of chips:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RX1GYpRM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/740wsm0xkxxuqpm1mukm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RX1GYpRM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/740wsm0xkxxuqpm1mukm.jpg" alt="UiRegex validation" width="880" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The generated regular expression can have not only required parts, but also optional ones. Red color is required, yellow is optional. &lt;/p&gt;

&lt;h3&gt;
  
  
  Regex Auto Generator / Builder (UI)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---Z9dyoKr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1puwqbkvcy7t5x96uxyw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Z9dyoKr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1puwqbkvcy7t5x96uxyw.jpg" alt="UiRegex Auto Generator / Builder" width="880" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, we got to the last block in order, but not in importance. I personally consider this block to be the core of the entire service. It is here that the Generator receives all the necessary input data, which it subsequently processes and produces a ready-made result. By the way, all logic is implemented only on the client. A web service has no server code at all.&lt;/p&gt;

&lt;p&gt;It is extremely important to understand that the machine (not able to read minds) must receive at least some information in order to analyze it and give at least some result. The more correct and concise your examples are, the more correct and concise the result will be. The order of your examples makes absolutely no difference.&lt;/p&gt;

&lt;p&gt;Regular expression generates "on the fly", in real time!&lt;/p&gt;

&lt;h3&gt;
  
  
  Save Regex
&lt;/h3&gt;

&lt;p&gt;Now we can save our regex. Just in case, I want to clarify that it is stored only in the browser's memory (localstorage). When you click on the "Save Regex" button, a dialog window appears where you enter a name for your regular expression.&lt;/p&gt;

&lt;p&gt;In fact, as in the case of default examples and our regex, it is not the generated rule that is stored, but just the input data, and every time you switch the custom regex, the Generator logic is triggered. This is very handy when fixing bugs in the logic of the Generator itself. Thus, even the saved rules will work with the latest version of the already corrected Generator.&lt;/p&gt;

&lt;h3&gt;
  
  
  Update URL
&lt;/h3&gt;

&lt;p&gt;By clicking on the "Update URL" button, the data is saved in the Url parameters. You can copy the URL, send someone a link and the other user will see exactly what you entered earlier. It's pretty convenient.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technologies
&lt;/h3&gt;

&lt;p&gt;This web service is built on UiWebKit web components and custom elements. There is no custom JS/TS code, only HTML custom elements. If you have questions about technologies and the implementation itself, then feel free to ask them. &lt;/p&gt;

&lt;p&gt;I will be glad to receive constructive comments and questions about UiRegex and I will answer them with pleasure. If you notice a bug or have a suggestion for improvement, then please email me to &lt;a href="mailto:idea@uiregex.com"&gt;idea@uiregex.com&lt;/a&gt; or &lt;a href="mailto:bug@uiregex.com"&gt;bug@uiregex.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks to all! Enjoy &lt;a href="https://uiregex.com"&gt;UiRegex&lt;/a&gt;, take care of yourself, stay healthy and productive!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
