<?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: Pete Matsyburka</title>
    <description>The latest articles on DEV Community by Pete Matsyburka (@omohokcoj).</description>
    <link>https://dev.to/omohokcoj</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%2F206796%2Fc8489f52-dac9-41c3-84e1-359cf0c20cae.jpeg</url>
      <title>DEV Community: Pete Matsyburka</title>
      <link>https://dev.to/omohokcoj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/omohokcoj"/>
    <language>en</language>
    <item>
      <title>Vue 3 real-life performance</title>
      <dc:creator>Pete Matsyburka</dc:creator>
      <pubDate>Wed, 03 Feb 2021 13:20:40 +0000</pubDate>
      <link>https://dev.to/omohokcoj/vue-3-real-life-performance-3iie</link>
      <guid>https://dev.to/omohokcoj/vue-3-real-life-performance-3iie</guid>
      <description>&lt;p&gt;Recently, I moved &lt;a href="https://github.com/siteinspector/siteinspector" rel="noopener noreferrer"&gt;SiteInspector&lt;/a&gt; to Vue 3 so I was curious to see if the app had any improvements in terms of efficiency and performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build speed
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Vue 2
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hash: 30af4c4033482074a37d
Version: webpack 4.44.2
Time: 6730ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Vue 3
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hash: 36b518e42dad63f1a2cd
Version: webpack 4.44.2
Time: 7871ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The measured build speed is represented by the fastest build time of Vue modules (css/scss/less modules were removed from the bundle).&lt;/p&gt;

&lt;p&gt;Vue 3 app build didn't reach the same speed as Vue 2.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bundle size
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Vue 2
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                    Asset       Size  Chunks                                Chunk Names
            js/ui-c0266b6bd5a26196d002.js    413 KiB       0  [emitted] [immutable]  [big]  ui
         js/ui-c0266b6bd5a26196d002.js.br   91.5 KiB          [emitted]
         js/ui-c0266b6bd5a26196d002.js.gz    109 KiB          [emitted]
        js/ui-c0266b6bd5a26196d002.js.map   1.58 MiB       0  [emitted] [dev]               ui
     js/ui-c0266b6bd5a26196d002.js.map.br    335 KiB          [emitted]              [big]
     js/ui-c0266b6bd5a26196d002.js.map.gz    407 KiB          [emitted]              [big]        
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Vue 3
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                    Asset       Size  Chunks                                Chunk Names
            js/ui-34caf8d12584e4e16014.js    432 KiB       0  [emitted] [immutable]  [big]  ui
         js/ui-34caf8d12584e4e16014.js.br   96.4 KiB          [emitted]
         js/ui-34caf8d12584e4e16014.js.gz    116 KiB          [emitted]
        js/ui-34caf8d12584e4e16014.js.map    1.8 MiB       0  [emitted] [dev]               ui
     js/ui-34caf8d12584e4e16014.js.map.br    372 KiB          [emitted]              [big]
     js/ui-34caf8d12584e4e16014.js.map.gz    460 KiB          [emitted]              [big]

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

&lt;/div&gt;



&lt;p&gt;Vue 3 app weight is 19kb more. A smaller bundle size could be achieved with Rollup tree-shaking, but the default Vue webpack package weighed slightly more, as well as Vue 3 Vuex and Router packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web performance
&lt;/h3&gt;

&lt;p&gt;To test web performance I used a large SiteInspector &lt;a href="https://siteinspector-test.herokuapp.com/shared?token=eyJhbGciOiJIUzI1NiJ9.eyJ3aWQiOjEsInJvbGUiOiJ2aWV3ZXIifQ.e6pBL0rTwooiSUq5kFg8dOe1zNQes2ESQ8UhXCu07Bw" rel="noopener noreferrer"&gt;report&lt;/a&gt; page which renders thousands of custom Vue components.&lt;/p&gt;

&lt;h4&gt;
  
  
  Vue 2
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmktyefd0oyblq7esaouq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmktyefd0oyblq7esaouq.png" alt="vue2-ch-2"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3507ms - Scripting
1356ms - Rendering
24ms   - Painting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Vue 3
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbmthet3qldwwkywrsurg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbmthet3qldwwkywrsurg.png" alt="vue-3"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;3707ms - Scripting
1252ms - Rendering
26ms   - Painting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vue 3 didn't show a noticeably faster rendering speed - it took ~5 seconds to render the report both in Vue 2 and 3.&lt;/p&gt;

&lt;h4&gt;
  
  
  Summary
&lt;/h4&gt;

&lt;p&gt;Vue 3 didn't improve app efficiency and performance for SiteInspector. In general, web performance remained on the same level. Vue 3 showed bigger progress towards making better toolings and maintainable code.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
    </item>
    <item>
      <title>You can't just migrate to Vue 3 (now)</title>
      <dc:creator>Pete Matsyburka</dc:creator>
      <pubDate>Tue, 02 Feb 2021 14:02:10 +0000</pubDate>
      <link>https://dev.to/omohokcoj/you-can-t-just-migrate-to-vue-3-now-1bf4</link>
      <guid>https://dev.to/omohokcoj/you-can-t-just-migrate-to-vue-3-now-1bf4</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/vuejs/vue-next/pull/1600" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frrth25awqmjttay7w1wv.png" alt="Issue"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently I moved &lt;a href="https://github.com/siteinspector/siteinspector" rel="noopener noreferrer"&gt;SiteInspector&lt;/a&gt; open-source app to Vue 3 and discovered that Vue 3 template compiler has a serious flaw in the default whitespace trimming strategy which makes it unreasonably hard to upgrade existing Vue.js apps.&lt;/p&gt;

&lt;p&gt;Vue 3 template compiler removes whitespaces before HTML tag if it starts with a new line in the template.&lt;br&gt;
This "feature" eliminates visible margins between UI components and there is no way to change this via compiler settings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwiwkpp8owd7aeif7xuba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwiwkpp8owd7aeif7xuba.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Margins between buttons are missing as a result of Vue 3 whitespace trimming strategy.&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;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link1&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link2&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link3&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vue 3 template compiler doesn't respect new lines and removes whitespaces from the rendered HTML.&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;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link1&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link2&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link3&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the correct "trimmed" output should be the following:&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;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link1&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link2&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link3&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if you take a simple HTML page and render it via Vue 3 template compiler you will see a different picture on your screen - all buttons and links will be smashed together and won't move to the next line in the parent container on a smaller mobile screen.&lt;/p&gt;

&lt;p&gt;The best way to fix it for SiteInspector was to add mandatory whitespaces via text interpolation:&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;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link1&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  {{ ' ' }}
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link2&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  {{ ' ' }}
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Link3&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hopefully, this issue will be resolved soon so &lt;code&gt;{{ ' ' }}&lt;/code&gt; can be removed with a single grep command.&lt;/p&gt;

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