<?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: Jack Huynh</title>
    <description>The latest articles on DEV Community by Jack Huynh (@jazurite).</description>
    <link>https://dev.to/jazurite</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%2F1029486%2Fec2e4e9d-ebbe-4219-8d1d-e8a1359ca500.jpg</url>
      <title>DEV Community: Jack Huynh</title>
      <link>https://dev.to/jazurite</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jazurite"/>
    <language>en</language>
    <item>
      <title>Error Handlings</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Mon, 04 Sep 2023 06:50:55 +0000</pubDate>
      <link>https://dev.to/jazurite/error-handlings-4l2h</link>
      <guid>https://dev.to/jazurite/error-handlings-4l2h</guid>
      <description>&lt;h2&gt;
  
  
  Error: Malfunctioning Elasticsearch
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Symptoms
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Unable&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;apply&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="n"&gt;patch&lt;/span&gt;
&lt;span class="no"&gt;Magento&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="no"&gt;CatalogSampleData&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="no"&gt;Setup&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="no"&gt;Patch&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="no"&gt;Data&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="no"&gt;InstallSimpleProducts&lt;/span&gt; 
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Magento_CatalogSampleData&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="ss"&gt;:"no handler found for uri [/magento2_product_1_v1/document_mapping?include_type_name=true] and method [PUT]"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Solution
&lt;/h4&gt;

&lt;p&gt;Due to ElasticSearch version is not yet supported by the current Magento instance: &lt;a href="https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html"&gt;https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Just install Elasticsearch 7.17&lt;/p&gt;




&lt;h2&gt;
  
  
  Error: Gd2.php line 70
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HDUC9Ow7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7w10b7u7i1b98tf2b0ue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HDUC9Ow7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7w10b7u7i1b98tf2b0ue.png" alt="Image description" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution
&lt;/h4&gt;

&lt;p&gt;Here Image Adapter try opens to image files (‘open function in Gd2.php line 72). &lt;strong&gt;validateURLScheme&lt;/strong&gt; function return false always because it checking ‘URL’ format but local files not valid for this format, so it returns false.&lt;/p&gt;

&lt;p&gt;Find validateURLScheme function in &lt;code&gt;vendor\magento\framework\Image\Adapter\Gd2.php file&lt;/code&gt;. at line 92. Replace function with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;validateURLScheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nv"&gt;$allowed_schemes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'ftp'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ftps'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'http'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'https'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
          &lt;span class="nv"&gt;$url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parse_url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$url&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$url&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'scheme'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;in_array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$url&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'scheme'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nv"&gt;$allowed_schemes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;file_exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&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="kc"&gt;false&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="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only change is &lt;code&gt;&amp;amp;&amp;amp; !file_exists($filename)&lt;/code&gt; text added at line 96.&lt;/p&gt;




&lt;h2&gt;
  
  
  Error: PluginListGenerator.php on line 411
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U0a9N3x6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2o3t8hg9m0ix28j1zlt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U0a9N3x6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2o3t8hg9m0ix28j1zlt.png" alt="Image description" width="800" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution
&lt;/h4&gt;

&lt;p&gt;Find &lt;strong&gt;write(array $scopes)&lt;/strong&gt; function in &lt;code&gt;magento2\lib\internal\Magento\Framework\Interception\PluginListGenerator.php&lt;/code&gt; file. at line 156.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Replace&lt;/span&gt;
&lt;span class="nv"&gt;$cacheId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;implode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'|'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;scopePriorityScheme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;"|"&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cacheId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// With&lt;/span&gt;
&lt;span class="nv"&gt;$cacheId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;implode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'-'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;scopePriorityScheme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;"-"&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;cacheId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We only changed the &lt;code&gt;|&lt;/code&gt; -&amp;gt; &lt;code&gt;-&lt;/code&gt; character.&lt;/p&gt;




&lt;h2&gt;
  
  
  Error Magento\Framework\Exception\ValidatorException: Invalid template file
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MjOXolQf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64aiqfu507nphtfkqg34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MjOXolQf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64aiqfu507nphtfkqg34.png" alt="Image description" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add extra code in&lt;/p&gt;

&lt;p&gt;&lt;code&gt;magento2\lib\internal\Magento\Framework\View\Element\Template\File\Validator.php&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;isPathInDirectories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$directories&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;is_array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$directories&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="nv"&gt;$directories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;$directories&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="nv"&gt;$realPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;fileDriver&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getRealPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$path&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nv"&gt;$realPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str_replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'\\'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$realPath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// extra code added&lt;/span&gt;
     &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$directories&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$directory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nb"&gt;strpos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$realPath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$directory&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="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
         &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Sources:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://magento.stackexchange.com/a/344211/113111"&gt;https://magento.stackexchange.com/a/344211/113111&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Error: &lt;code&gt;require-config.js&lt;/code&gt; is not a function
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7WzDtEQe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9u0f7mf17470st79g4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7WzDtEQe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9u0f7mf17470st79g4z.png" alt="Image description" width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution
&lt;/h4&gt;

&lt;p&gt;Change the project base-config "base-url" from "&lt;a href="http://localhost/magento2"&gt;http://localhost/magento2&lt;/a&gt;" to " &lt;a href="http://localhost/magento2/pub"&gt;http://localhost/magento2/pub&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;bin/magento setup:store-config:set --base-url="http://localhost/magento2/pub/"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Error: Image not displaying
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nExZFyGr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cid8kdivlbxk2hlv7msb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nExZFyGr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cid8kdivlbxk2hlv7msb.png" alt="Image description" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--781sAKe---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyngc391r241msg3ksxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--781sAKe---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyngc391r241msg3ksxu.png" alt="Image description" width="647" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution
&lt;/h4&gt;

&lt;p&gt;Run this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/magento catalog:image:resize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be patience cause this seemingly simple command could take half and hour&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FUIUK0-4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbful3ebeoaeowp3s443.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FUIUK0-4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbful3ebeoaeowp3s443.png" alt="Image description" width="699" height="192"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Error: The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Solution
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer config repositories.magento composer https://repo.magento.com/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer config http-basic.repo.magento.com a0a6f216e5da943ce3a36ac92d430456 b0436530e2c686c94e1ad8948411aa55
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Sources:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/magento/magento2/issues/2520#issuecomment-638293942"&gt;https://github.com/magento/magento2/issues/2520#issuecomment-638293942&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Error: &lt;code&gt;bin/magento&lt;/code&gt; Permission Denied
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://magefan.com/blog/bin-magento-permission-denied"&gt;https://magefan.com/blog/bin-magento-permission-denied&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Error: The default website isn't defined
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4JWIykdE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d0bkqirjtzq6qulvnjt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4JWIykdE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d0bkqirjtzq6qulvnjt.png" alt="Image description" width="800" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remove &lt;code&gt;app/etc/env.php&lt;/code&gt; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setup Magento2</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Thu, 24 Aug 2023 07:19:17 +0000</pubDate>
      <link>https://dev.to/jazurite/step-4-download-magento-3a7d</link>
      <guid>https://dev.to/jazurite/step-4-download-magento-3a7d</guid>
      <description>&lt;h2&gt;
  
  
  Step 4: Download Magento
&lt;/h2&gt;

&lt;p&gt;Before download Magento 2, we need Magento authentication keys to authenticate at &lt;a href="https://marketplace.magento.com/customer/account/"&gt;Magento marketplace&lt;/a&gt; if don't have one.&lt;/p&gt;

&lt;p&gt;Select My Account from the top-right corner. Now click Access Keys and Generate your new SECURE KEYS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Public Key: Is your username
Private Key: Is your password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you've acquired both the access keys, we can download Magento using one of 2 ways:&lt;/p&gt;

&lt;h3&gt;
  
  
  Through Github
&lt;/h3&gt;

&lt;p&gt;You can download sourcecode &lt;a href="https://github.com/magento/magento2/releases"&gt;https://github.com/magento/magento2/releases&lt;/a&gt; directly from Magento official repository&lt;/p&gt;

&lt;p&gt;After donwloading, you should extract the pack to &lt;code&gt;C:\xampp\htdocs\magento2&lt;/code&gt; and run this command inside the folder.&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating an authorization file
&lt;/h4&gt;

&lt;p&gt;The Magento 2 GitHub repository requires you to authenticate. The &lt;code&gt;composer install&lt;/code&gt; commands fails if you do not.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After the process finished, run the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer config repositories.magento composer https://repo.magento.com/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer config http-basic.repo.magento.com &amp;lt;public key &amp;lt;private key&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Through Composer
&lt;/h3&gt;

&lt;p&gt;Go to &lt;code&gt;C:\xampp\htdocs&lt;/code&gt; folder and run this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After inserting your repo.magento.com username and password, it will ask for store credentials. Type “Yes.”&lt;/p&gt;

&lt;p&gt;Then Magento 2 will now start downloading on your server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W2qb7viX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06h48j26o6zts0xahib2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W2qb7viX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06h48j26o6zts0xahib2.png" alt="Image description" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Regardless of the downloading method you choose, the final magento2 folder should look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tkVkjeXM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r35taysl2j94bkis1sq1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tkVkjeXM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r35taysl2j94bkis1sq1.png" alt="Image description" width="636" height="936"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Install Magento
&lt;/h2&gt;

&lt;p&gt;Now every preparation steps are done and we can start installing Magento 2 on Localhost.&lt;/p&gt;

&lt;p&gt;Go to &lt;code&gt;C:\xampp\htdocs\magento2&lt;/code&gt; folder, insert this command to start installing Magento 2 (make sure Elasticsearch, Apache, MySql all are running before execute this command)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;php bin/magento setup:install --base-url="http://127.0.0.1/magento2/pub/" --db-host="127.0.0.1" --db-name="magento2" --db-user="root" --db-password="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user@example.com" --admin-user="admin" --admin-password="Admin@123456" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host=127.0.0.1 --elasticsearch-port=9200 --elasticsearch-enable-auth=1 --elasticsearch-username=elastic --elasticsearch-password=elastic
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--base-url&lt;/code&gt;: your magento 2 installation folder&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--db-name&lt;/code&gt;: your database name in step 4&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--db-password&lt;/code&gt;: your database password in step 4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Others are optional, we can change later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HXu60Hr6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f53fyuejl4o4yllo3doy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HXu60Hr6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f53fyuejl4o4yllo3doy.png" alt="Image description" width="800" height="518"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you get the following error&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In PatchApplier.php line 172:

Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original exception message: Wrong file

In Gd2.php line 70: Wrong file  

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

&lt;/div&gt;



&lt;p&gt;Then follow this &lt;a href="https://dev.to/jazurite/part-6-error-handlings-3mnd#error-gd2php-line-70"&gt;solution&lt;/a&gt; and run the command again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--El4xeKTu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0u5463n1fqwbdmoqy6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--El4xeKTu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0u5463n1fqwbdmoqy6c.png" alt="Image description" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open the terminal and run these commands to upgrade the database&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/magento indexer:reindex
bin/magento setup:upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZB2YE5cT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9h7zs93u3lx4ctuaxce1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZB2YE5cT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9h7zs93u3lx4ctuaxce1.png" alt="Image description" width="756" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and this command to compiles and generates optimized code for Dependency Injection&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/magento setup:di:compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you get the following error&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In ErrorHandler.php line 62:

Warning: file_put_contents(C:/xampp/htdocs/magento2/generated/metadata/primary|global|plugin-list.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\magento2\lib\internal\Magento\Framework\Interception\PluginListGenerator.php on line 411   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then following this &lt;a href="https://dev.to/jazurite/part-6-error-handlings-3mnd#error-pluginlistgeneratorphp-on-line-411"&gt;solution&lt;/a&gt; and run the command again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sHEjZ3iR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tk96z66w9bcvun5grmjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sHEjZ3iR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tk96z66w9bcvun5grmjn.png" alt="Image description" width="700" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now can start to deploying our static content&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/magento setup:static-content:deploy -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U5YHo1KY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqvdto6tvydx89monwi5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U5YHo1KY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqvdto6tvydx89monwi5.png" alt="Image description" width="735" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clear Cache&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php bin/magento cache:flush
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6: Install Sample Data
&lt;/h2&gt;

&lt;p&gt;Now we will deploy sample data for our new Magento 2 website on localhost. Sample data will fill your website with some products, categories and images&lt;/p&gt;

&lt;p&gt;Run these below commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/magento sampledata:deploy
bin/magento indexer:reindex
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Well done! refresh your website and enjoy your new Magento 2.4 installation with sample data&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mjiYIz3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wvtwuysck0lizncxgvwo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mjiYIz3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wvtwuysck0lizncxgvwo.png" alt="Image description" width="768" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setup Environments</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Thu, 24 Aug 2023 07:17:38 +0000</pubDate>
      <link>https://dev.to/jazurite/step-1-xampp-and-composer-1jkf</link>
      <guid>https://dev.to/jazurite/step-1-xampp-and-composer-1jkf</guid>
      <description>&lt;p&gt;Step 1: XAMPP and Composer&lt;/p&gt;

&lt;h3&gt;
  
  
  XAMPP
&lt;/h3&gt;

&lt;p&gt;First of all, you need to download and install &lt;a href="https://www.apachefriends.org/download.html"&gt;Xampp&lt;/a&gt;, a simple tool helps developers to create and test their applications on a local web server.&lt;/p&gt;

&lt;p&gt;You might wanna go with PHP 8.1 since it got pretty solid support.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g4y2TXqd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a760jzji1pjwpggmvxoe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g4y2TXqd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a760jzji1pjwpggmvxoe.png" alt="Image description" width="631" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, run set up file and proceed with all steps to install Xampp. In Select Components step, make sure to select Mysql and PHP, PHPmyadmin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lFHXuPC1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u1qxqqgcpuijtiz25beq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lFHXuPC1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u1qxqqgcpuijtiz25beq.png" alt="Image description" width="559" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open XAMPP and start Apache and Mysql, green color of Apache and MySQL indicates that its been started successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UxpoZELx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mo8e4z1gbjn3bvrm2ngp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UxpoZELx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mo8e4z1gbjn3bvrm2ngp.png" alt="Image description" width="668" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  COMPOSER
&lt;/h3&gt;

&lt;p&gt;Now we need to install &lt;a href="https://getcomposer.org/download/"&gt;Composer&lt;/a&gt;, a tool for dependency management in PHP.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WjEZLVK---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46ywf5knu5c2362foi3l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WjEZLVK---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46ywf5knu5c2362foi3l.png" alt="Image description" width="655" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the installation is complete, verify that Composer is installed correctly by running the following command&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If the installation was successful, the command should display the version of the installed Composer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fNiUXNGd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1wsx3mrq251w3wgpz6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fNiUXNGd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1wsx3mrq251w3wgpz6c.png" alt="Image description" width="800" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: PHP &amp;amp; MySql
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Enable PHP extensions
&lt;/h3&gt;

&lt;p&gt;We need to install and enable all required PHP extensions to make the installation go smoothly&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bcmath  ctype   curl    dom
gd  hash    iconv   intl
mbstring    openssl pdo_mysql   simplexml
soap    xsl zip ext-sockets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Quickly open php.ini on Xampp interface with this button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---yHtIs3h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9e9uu3sa52zs829o1mv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---yHtIs3h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9e9uu3sa52zs829o1mv.png" alt="Image description" width="754" height="446"&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;[PHP]
;extension=gd
;extension=intl
;extension=soap
;extension=xsl
;extension=sockets
;extension=sodium
;extension=zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Remove ; from the above lines of php.ini file&lt;/code&gt;. Save the file.&lt;br&gt;
The other extensions are enabled by default after we install Xampp, so we don’t need to include them here. Remember to save files before exiting.&lt;/p&gt;
&lt;h3&gt;
  
  
  Configure PHP settings
&lt;/h3&gt;

&lt;p&gt;In php.ini file, search and change the following values as below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;max_execution_time=18000
max_input_time=1800
memory_limit=4G
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These values will keep the installation go properly without interruption.&lt;/p&gt;

&lt;p&gt;Finally, restart apache to apply php settings by click on apache Stop and Start button on XAMPP&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o2-eMSt9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pob1uqz31nnalgt9pwv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o2-eMSt9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pob1uqz31nnalgt9pwv1.png" alt="Image description" width="681" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create database for Magento 2
&lt;/h2&gt;

&lt;p&gt;Before we process the installation, we have to create a database for Magento 2 website to store all settings related to products, catalog, users, store configuration….&lt;/p&gt;

&lt;p&gt;In Xampp interface, open PHPmyadmin by clicking on Admin button to open phpmyadmin&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d68A2_00--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ja1i707nsdunhib7mjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d68A2_00--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ja1i707nsdunhib7mjl.png" alt="Image description" width="697" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On phpmyadmin page, click on New =&amp;gt; type database name =&amp;gt; click on Create to create a new database. For example, I create magento2 database here&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mcg_GWTk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7zb9sxsn1o1jwac34w9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mcg_GWTk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7zb9sxsn1o1jwac34w9.png" alt="Image description" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, Xampp does not set a password for MYSQL, so we will need to create a new root password for mysql.&lt;/p&gt;

&lt;p&gt;On Xampp, click on Shell button to open command interface&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lEd6351j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgeowfdo7xlhcv1lconw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lEd6351j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgeowfdo7xlhcv1lconw.png" alt="Image description" width="686" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, input the following command to change mysql root password&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;mysqladmin.exe -u root password root
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and press Enter. I put &lt;code&gt;root&lt;/code&gt; as password.&lt;/p&gt;

&lt;p&gt;Now, to use phpmyadmin, you will also need to enter the new password. To make phpmyadmin automatically login with your new password, Open config.inc.php , to open this file, see the screenshot below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TJU__e3G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4nk3311u6wl3nq2rhwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TJU__e3G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4nk3311u6wl3nq2rhwk.png" alt="Image description" width="755" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And insert your new password here&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--teM6AQAm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyu8355izam4t5lb81q3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--teM6AQAm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyu8355izam4t5lb81q3.png" alt="Image description" width="494" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, restart apache to apply php settings by click on apache Stop and Start button on XAMPP&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Elasticsearch
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Download
&lt;/h3&gt;

&lt;p&gt;[Elasticsearch (&lt;a href="https://www.elastic.co/downloads/elasticsearch)is"&gt;https://www.elastic.co/downloads/elasticsearch)is&lt;/a&gt; now a required application to install Magento 2.4, the installation process will stop if there’s something wrong with Elasticsearch verification.&lt;/p&gt;

&lt;p&gt;Next, unzip archived file at the “C:\xampp\htdocs\”&lt;/p&gt;

&lt;h2&gt;
  
  
  Install and Run
&lt;/h2&gt;

&lt;p&gt;Go to &lt;code&gt;\elasticsearch\bin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Right click on &lt;code&gt;elasticsearch.bat&lt;/code&gt; and select &lt;strong&gt;run as administrator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_3K6uWfK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyhgce6irjwgvwmfvw0e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_3K6uWfK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyhgce6irjwgvwmfvw0e.png" alt="Image description" width="800" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leave this window running on background&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C2uJIpXy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ktbnd63hefnel9qms4xg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C2uJIpXy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ktbnd63hefnel9qms4xg.png" alt="Image description" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Passwords
&lt;/h3&gt;

&lt;p&gt;Before we continue, we must set password for all &lt;a href="https://www.elastic.co/guide/en/elasticsearch/reference/6.4/built-in-users.html"&gt;built-in users&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Open another terminal inside &lt;code&gt;C:\xampp\htdocs\elasticsearch\bin&lt;/code&gt; and run this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./elasticsearch-setup-passwords.bat interactive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yr5LOUpJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjfuxfnkbvgdhhcnv8s8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yr5LOUpJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjfuxfnkbvgdhhcnv8s8.png" alt="Image description" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you encounter this error&lt;/p&gt;

&lt;p&gt;write the following line in &lt;code&gt;/elasticsearch/elasticsearch.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpack.security.enabled: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Verify
&lt;/h3&gt;

&lt;p&gt;To check if Elasticsearch is running on your system, open your browser and enter the following address: &lt;code&gt;http:localhost:9200&lt;/code&gt;. When prompted for login credentials, use root user &lt;code&gt;elastic&lt;/code&gt; and the password you just reset.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fY9Uwozd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxvyhskg0yo32fr0xf1b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fY9Uwozd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxvyhskg0yo32fr0xf1b.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you see this result page =&amp;gt; Elasticsearch is running properly&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X42wbnxB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyobxfvjcojgq4m27rti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X42wbnxB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyobxfvjcojgq4m27rti.png" alt="Image description" width="568" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to install Magento 2 on Windows</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Thu, 24 Aug 2023 07:16:52 +0000</pubDate>
      <link>https://dev.to/jazurite/how-to-install-magento-2-on-windows-1o88</link>
      <guid>https://dev.to/jazurite/how-to-install-magento-2-on-windows-1o88</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Magento 2 is widely acknowledged as one of the most robust eCommerce platforms. &lt;/p&gt;

&lt;p&gt;In this article, I gonna show you how to install Magento 2.6 locally on Windows using XAMPP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-installation
&lt;/h2&gt;

&lt;p&gt;Before jumping in, please check on these requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Must meet the Magento system &lt;a href="https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html?lang=en"&gt;requirements&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get &lt;a href="https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/prerequisites/authentication-keys.html"&gt;authentication keys&lt;/a&gt; to the Magento Composer Repository.&lt;/li&gt;
&lt;li&gt;Apache 2.4 or Nginx 1.18&lt;/li&gt;
&lt;li&gt;MySQL 8.0&lt;/li&gt;
&lt;li&gt;PHP 8.1&lt;/li&gt;
&lt;li&gt;Elasticsearch 7.17 or OpenSearch 1.2&lt;/li&gt;
&lt;li&gt;Composer 2.2&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔍 What's Inside:
&lt;/h2&gt;

&lt;p&gt;Here is all the steps to guide you installing Magento2 on a Windows computers&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/jazurite/step-1-xampp-and-composer-1jkf"&gt;Setup Environment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jazurite/step-2-php-mysql-35c0"&gt;Setup Magento2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/jazurite/error-handlings-4l2h"&gt;Error Handling&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other Sources:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.thecoachsmb.com/100-working-step-by-step-guide-to-install-magento-2-4-4-on-windows/"&gt;https://www.thecoachsmb.com/100-working-step-by-step-guide-to-install-magento-2-4-4-on-windows/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.cloudways.com/blog/install-magento-2-composer/"&gt;https://www.cloudways.com/blog/install-magento-2-composer/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=5ctxLhBoOiI"&gt;https://www.youtube.com/watch?v=5ctxLhBoOiI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=gWfmRSA1n28&amp;amp;list=PLR3sn-iJXmwbvT8nI-ksGr5z31CScTBJn&amp;amp;index=6"&gt;https://www.youtube.com/watch?v=gWfmRSA1n28&amp;amp;list=PLR3sn-iJXmwbvT8nI-ksGr5z31CScTBJn&amp;amp;index=6&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.magetop.com/blog/install-magento-2-4-on-xampp/#7_Fix_Magento_Theme_Error"&gt;https://www.magetop.com/blog/install-magento-2-4-on-xampp/#7_Fix_Magento_Theme_Error&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please leave any comments or ask anything if you encounter any errors during the installation process.&lt;/p&gt;

&lt;p&gt;Happy coding.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Defer JavaScript for Faster Load Time</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Sat, 29 Jul 2023 14:28:26 +0000</pubDate>
      <link>https://dev.to/jazurite/defer-javascript-for-faster-load-time-io7</link>
      <guid>https://dev.to/jazurite/defer-javascript-for-faster-load-time-io7</guid>
      <description>&lt;p&gt;When it comes to JavaScript speed optimization, there is one technique every developers should know and embrace: &lt;code&gt;Defer JavaScript&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The behavior of a website&lt;/li&gt;
&lt;li&gt;Why bother defer JavaScript&lt;/li&gt;
&lt;li&gt;Async vs Defer&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The behavior of a website
&lt;/h2&gt;

&lt;p&gt;Imaging having an HTML file import 2 scripts: &lt;code&gt;small.js&lt;/code&gt; and &lt;code&gt;big.js&lt;/code&gt; with difference load times.&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;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"big.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- Load time: 500ms --&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"small.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- Load time: 100ms --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;...content...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During page load, a “white screen” might briefly appear before the full page is visible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TarG05PG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jl4hbbqqdkd1s4ypmat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TarG05PG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jl4hbbqqdkd1s4ypmat.png" alt="Image description" width="800" height="842"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why bother defer JavaScript
&lt;/h2&gt;

&lt;p&gt;Due to it's nature, the browser will stop rendering the page while loading and executing scripts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SiJDcRuZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zffs6g8aop76z4emhwv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SiJDcRuZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zffs6g8aop76z4emhwv.png" alt="Image description" width="800" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the result, the page content remains hidden until both &lt;code&gt;small.js&lt;/code&gt; and &lt;code&gt;big.js&lt;/code&gt; are fully downloaded and run.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0ogNjwW2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qn0aj4hgqqfcw63ctgap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0ogNjwW2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qn0aj4hgqqfcw63ctgap.png" alt="Image description" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The "white-screen" is nearly invisible for users with fast internet connections. However, for those like me with slower speeds, it result in a significant delay before the entire page becomes visible.&lt;/p&gt;

&lt;p&gt;Luckily, &lt;code&gt;Defer JavaScript&lt;/code&gt; comes to the rescue help us pushing all the script to the bottom of the loading process using &lt;code&gt;defer&lt;/code&gt; and &lt;code&gt;async&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Async vs Defer
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Async
&lt;/h4&gt;

&lt;p&gt;Async will move the download of your script into the background and execute the script as soon as the download is finished.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pwd9_Kak--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbz0q9ovfzrrrtnp6g47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pwd9_Kak--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbz0q9ovfzrrrtnp6g47.png" alt="Image description" width="800" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each &lt;code&gt;async&lt;/code&gt; script operates independently, they don't wait for each other. Whatever loads first - run first:&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;head&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- loads first / runs second --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"big.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

  &lt;span class="c"&gt;&amp;lt;!-- loads second / runs first --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"small.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;...content...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Defer
&lt;/h4&gt;

&lt;p&gt;Defer will move the download of your script into the background and execute the script as soon as the site finished parsing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iIAKj-S9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1amf1zr21nzdo7k03zo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iIAKj-S9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1amf1zr21nzdo7k03zo.png" alt="Image description" width="800" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will also respect the execution order of your scripts.&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;head&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- loads first / runs first --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;defer&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"big.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

 &lt;span class="c"&gt;&amp;lt;!-- loads second / runs second --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;defer&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"small.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- visible immediately --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;...content...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;async&lt;/code&gt; and &lt;code&gt;defer&lt;/code&gt; both load JavaScript asynchronously without render blocking but with difference in behavior.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>JavaScript Bloat: Why does it matter?</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Wed, 21 Jun 2023 08:51:33 +0000</pubDate>
      <link>https://dev.to/jazurite/javascript-bloat-unraveling-the-performance-challenge-5dme</link>
      <guid>https://dev.to/jazurite/javascript-bloat-unraveling-the-performance-challenge-5dme</guid>
      <description>&lt;p&gt;Ever wonder why your website gradually slow down after each release? In the tech world, it is widely believed that the main culprit behind lies in what we call &lt;code&gt;JavaScript Bloat&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;State of JavaScript&lt;/li&gt;
&lt;li&gt;What is JavaScript Bloat&lt;/li&gt;
&lt;li&gt;Why more JavaScript mean Worse Performance&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  State of JavaScript
&lt;/h2&gt;

&lt;p&gt;In today's fast-paced world, JavaScript has become an integral part of almost all modern websites, enabling rich and interactive website experiences.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xJAMgbqd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62hbyz1i4lc3fwhosqzc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xJAMgbqd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62hbyz1i4lc3fwhosqzc.png" alt="Image description" width="600" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Think about the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An interactive map that can display real-time traffic updates&lt;/li&gt;
&lt;li&gt;A slider/carousel that switches images every few seconds&lt;/li&gt;
&lt;li&gt;A video player that plays YouTube videos&lt;/li&gt;
&lt;li&gt;And more…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the above use JavaScript to achieve the desired functionality.&lt;/p&gt;

&lt;p&gt;For the last 10 years, JavaScript's usage has been increasing substantially by every measure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2u1wVOTz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqe9ntwz5o2tk7cx5e0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2u1wVOTz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqe9ntwz5o2tk7cx5e0d.png" alt="Image description" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stats from &lt;a href="https://httparchive.org/reports/state-of-javascript?start=2013_01_01&amp;amp;end=2023_01_01&amp;amp;view=list"&gt;HTTP Archive&lt;/a&gt; shows an average based on thousands of tested websites for the past decade (HTTP Archive performs tests every month).&lt;/p&gt;

&lt;p&gt;Its observed that 10 year ago the median page serves only &lt;strong&gt;168.1 KB&lt;/strong&gt; of JavaScript (&lt;strong&gt;107.2 KB&lt;/strong&gt; for mobile). Now that number has risen to &lt;strong&gt;508.5 KB&lt;/strong&gt; (&lt;strong&gt;468.7 KB&lt;/strong&gt; for mobile). Its gone up ~200% (~330% for mobile) in just a decade.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is JavaScript Bloat
&lt;/h2&gt;

&lt;p&gt;JavaScript is like chocolate in a cake: it enriches the experience. But add too much and you'll spoil the taste.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;JavaScript Bloat&lt;/strong&gt; refer to a website that relies excessive amount on poorly optimized JavaScript.&lt;/p&gt;




&lt;p&gt;A feature-rich, complex website in exchange for providing modern, interactive experience naturally going to have more assets that consume more users' resources, from CPU and GPU to memory and network.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://httparchive.org/reports/page-weight?start=2013_01_01&amp;amp;end=2023_01_01&amp;amp;view=grid"&gt;HTTP Archive&lt;/a&gt;, the median web page weight around 2.2 MB of data split across 71 HTTP requests. This is a huge increase from 800 KB average of 10 year ago.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dWa2xS6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvss101m1heoegxalhtc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dWa2xS6a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvss101m1heoegxalhtc.png" alt="Image description" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is the highest contributor to the significant increase in page weight behind images (and videos).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WvPtmzS2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nqbcgirl8wey5ai8j3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WvPtmzS2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nqbcgirl8wey5ai8j3j.png" alt="Image description" width="552" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why more JavaScript mean Worse Performance
&lt;/h2&gt;

&lt;p&gt;To display a web page, the browser parses the HTML content to build the DOM. As soon as the parser comes across a &lt;code&gt;&amp;lt;script&amp;gt;...&amp;lt;/script&amp;gt;&lt;/code&gt; tag, it stops the DOM building, waits for the script to download, parses it, executes it and only then can it process the rest of the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8xk8c_ck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7le1l37ki3846mmd2ysf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8xk8c_ck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7le1l37ki3846mmd2ysf.png" alt="Image description" width="800" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Depending on how large each scripts is, especially on slower connections, there will be a significant delay before users will be able to see your HTML.&lt;/p&gt;

&lt;p&gt;That's why the delayed time between first load and interactive has increasing steadily according to &lt;a href="https://httparchive.org/reports/loading-speed?start=2013_01_01&amp;amp;end=2023_01_01&amp;amp;view=list"&gt;HTTP Archive&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--te4aCt9a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxv8ai934jhdopi92rli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--te4aCt9a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxv8ai934jhdopi92rli.png" alt="Image description" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When your website have lots of third-party scripts, they'll block your own JavaScript and have a drastic effect on your web page performance.&lt;/p&gt;

&lt;p&gt;Here is an example of a simple HTML website before and after install a 3rd-party plugin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--84Tehjlv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhumhii3exqd6hbmctzn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--84Tehjlv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhumhii3exqd6hbmctzn.png" alt="Image description" width="676" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;It's true that JavaScript slow down our webpage. However, it doesn't mean that you shouldn't use JavaScript at all.&lt;br&gt;
In the next article in this series, we’ll discuss some advanced techniques you can use to optimize your website.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How to install Shopify CLI 3.0 for themes</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Wed, 07 Jun 2023 04:39:05 +0000</pubDate>
      <link>https://dev.to/jazurite/how-to-install-shopify-cli-30-for-themes-295f</link>
      <guid>https://dev.to/jazurite/how-to-install-shopify-cli-30-for-themes-295f</guid>
      <description>&lt;p&gt;Shopify CLI (Command Line Interface) is a vital tools for developers when working with Shopify themes. With Shopify CLI you can create, develop, and deploy themes directly from your terminal, allowing for quicker automation and improved workflows.&lt;/p&gt;

&lt;p&gt;Let's see how we can set up the Shopify CLI on our computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; 16 or higher&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.shopify.com/partners." rel="noopener noreferrer"&gt;Shopify Partner Account&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing Shopify CLI ⚡️
&lt;/h2&gt;

&lt;h3&gt;
  
  
  macOS
&lt;/h3&gt;

&lt;p&gt;Installing Shopify CLI on macOS is simple with &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&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;brew tap shopify/shopify
brew install shopify-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;Installing Shopify CLI on Windows require you to install &lt;a href="https://rubyinstaller.org/downloads/" rel="noopener noreferrer"&gt;RubyInstaller for Windows&lt;/a&gt; first.&lt;/p&gt;

&lt;p&gt;Then open the Terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @shopify/cli @shopify/theme
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Verify the installation
&lt;/h3&gt;

&lt;p&gt;After the installation is complete, verify that Shopify CLI is installed correctly by running the following command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If the installation was successful, the command should display the version of the installed Shopify CLI.&lt;/p&gt;

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

&lt;p&gt;Typing in the &lt;code&gt;shopify help&lt;/code&gt; will list available Shopify CLI commands.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

</description>
      <category>shopify</category>
    </item>
    <item>
      <title>Javascript (ES14): with()</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Tue, 23 May 2023 10:56:24 +0000</pubDate>
      <link>https://dev.to/jazurite/javascript-es14-with-1jkb</link>
      <guid>https://dev.to/jazurite/javascript-es14-with-1jkb</guid>
      <description>&lt;p&gt;ECMAScript proposal "Change Array by copy" by Robin Ricard and Ashley Claymore has been merge into ECMAScript standard. This proposal brings a lot of new toys, one of which is new array method: &lt;code&gt;with()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;with()&lt;/code&gt; method is a new way to modify an array's item:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;with(index, value): Array  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only difference is that it does not change the original array and returns a changed copy of the original array.&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;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&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;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// [1, 4, 3] The original array is mutated&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;with()&lt;/strong&gt;&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;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&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;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; 
&lt;span class="c1"&gt;// [1, 4, 3] Returns a new copy of arr with updated value.&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="c1"&gt;// [1, 2, 3] The original array is not affected&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information, check out the following resources:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript (ES14): toSorted()</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Fri, 19 May 2023 03:22:43 +0000</pubDate>
      <link>https://dev.to/jazurite/javascript-es14-tosorted-22e0</link>
      <guid>https://dev.to/jazurite/javascript-es14-tosorted-22e0</guid>
      <description>&lt;p&gt;ECMAScript proposal "Change Array by copy" by Robin Ricard and Ashley Claymore has been merge into ECMAScript standard. This proposal brings a lot of new toys, one of which is new array method: toSorted().&lt;/p&gt;

&lt;p&gt;The toSorted() method is similar to sort&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Functionless
toSorted()

// Arrow function
toSorted((a, b) =&amp;gt; { /* … */ })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only difference is that it does not change the original array, calling this method returns a changed copy of the original array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sort()&lt;/strong&gt;&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;arr&lt;/span&gt; &lt;span class="o"&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;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="c1"&gt;// [1, 2, 3, 4, 5] Returns a reference to original array, now sorted&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// [1, 2, 3, 4, 5] The original array is mutated&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;toSorted()&lt;/strong&gt;&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;arr&lt;/span&gt; &lt;span class="o"&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;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toSorted&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; 
&lt;span class="c1"&gt;// [1, 2, 3, 4, 5] Returns a new copy of arr that is sorted&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="c1"&gt;// [3, 4, 2, 5, 1] The original array is not affected&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information, check out the following resources:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript ( ES14 ): toSpliced()</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Wed, 17 May 2023 04:01:33 +0000</pubDate>
      <link>https://dev.to/jazurite/javascript-es14-toreversed-4155</link>
      <guid>https://dev.to/jazurite/javascript-es14-toreversed-4155</guid>
      <description>&lt;p&gt;ECMAScript proposal &lt;a href="https://github.com/tc39/proposal-change-array-by-copy"&gt;"Change Array by copy"&lt;/a&gt; by Robin Ricard and Ashley Claymore has been merge into ECMAScript standard. This proposal brings a lot of new toys, one of which is new array method: &lt;code&gt;toSpliced()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;toSpliced()&lt;/code&gt; method is similar to &lt;code&gt;splice&lt;/code&gt;&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;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toSpliced&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;deleteCount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;item1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;item2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The only difference is that it does not change the original array, calling this method returns a changed copy of the original array instead of the deleted array.&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="c1"&gt;// splice()&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;originalArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&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;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targetArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;originalArr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targetArr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// [2]&lt;/span&gt;
&lt;span class="c1"&gt;// The original array is mutated&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalArr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// [1,5,3]&lt;/span&gt;

&lt;span class="c1"&gt;// toSplice()&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;originalArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&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;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targetArr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;originalArr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toSplice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targetArr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// [1,5,3];&lt;/span&gt;
&lt;span class="c1"&gt;// The original array is not affected&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalArr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// [1,2,3]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information, check out the following resources:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript ( ES14 ): toReversed()</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Tue, 16 May 2023 04:39:47 +0000</pubDate>
      <link>https://dev.to/jazurite/javascript-es14-toreversed-56j4</link>
      <guid>https://dev.to/jazurite/javascript-es14-toreversed-56j4</guid>
      <description>&lt;p&gt;JavaScript lovers, rejoice! The latest version of ES, ES14, has just introduced a brand new method that will flip your arrays upside down. Meet the "toReversed()" method!&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array.toReversed()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parameters: This method does not accept any parameters.&lt;/p&gt;

&lt;p&gt;Return value: The &lt;code&gt;toReversed()&lt;/code&gt; method returns a new array with the elements in reverse order.&lt;/p&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This method does not change the original array.&lt;/li&gt;
&lt;li&gt;It does not modify the original array in any way, it simply creates a new array with the elements in reverse order.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arr = [1, 2, 3, 4, 5];
const reversedArr = arr.toReversed();

console.log(arr); // [1, 2, 3, 4, 5]
console.log(reversedArr); // [5, 4, 3, 2, 1]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference between &lt;code&gt;reverse()&lt;/code&gt; and &lt;code&gt;toReversed()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const originalArray = [1, 2, 3, 4, 5];

// using `reverse()`
const reversedArray = originalArray.reverse();

console.log(reversedArray); // [5, 4, 3, 2, 1]
console.log(originalArray); // [5, 4, 3, 2, 1] - original array is modified!

// using `toReversed()`
const toReversedArray = originalArray.toReversed();

console.log(toReversedArray); // [1, 2, 3, 4, 5] - reversed copy of the original array
console.log(originalArray); // [1, 2, 3, 4, 5] - original array is unchanged!

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

&lt;/div&gt;



&lt;p&gt;In conclusion, the &lt;code&gt;toReversed()&lt;/code&gt; method is a useful method for creating a new array with the elements in reverse order. It is easy to use and does not modify the original array in any way, making it a safe and efficient way to manipulate arrays in JavaScript.&lt;/p&gt;

&lt;p&gt;For more information, check out the following resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Zooming PDF iframe on Iphone</title>
      <dc:creator>Jack Huynh</dc:creator>
      <pubDate>Thu, 23 Feb 2023 08:31:06 +0000</pubDate>
      <link>https://dev.to/jazurite/zooming-pdf-iframe-on-iphone-538k</link>
      <guid>https://dev.to/jazurite/zooming-pdf-iframe-on-iphone-538k</guid>
      <description>&lt;p&gt;Have you ever embedded a PDF file using iframe in your website?&lt;/p&gt;

&lt;h2&gt;
  
  
  Yes??
&lt;/h2&gt;

&lt;p&gt;Great! Did you manage to get the PDF file shows up?&lt;/p&gt;

&lt;h4&gt;
  
  
  Desktop
&lt;/h4&gt;

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

&lt;h4&gt;
  
  
  Android
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vrvbdj60q5eilfblh6m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vrvbdj60q5eilfblh6m.jpg" alt=" " width="652" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Duh, anyone can do that
&lt;/h2&gt;

&lt;p&gt;Okay, then did you test it on Iphone devices?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why it's works fine on Android?&lt;/p&gt;

&lt;p&gt;Oh my, you should come here and take a look&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2zlmgnzlxhv54no95b4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2zlmgnzlxhv54no95b4.gif" alt=" " width="444" height="684"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can't scroll or zoom out, this is broken&lt;/p&gt;

&lt;p&gt;Why??????&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Okay there is no time to panic, we need to fix this before the boss see it.&lt;/p&gt;

&lt;p&gt;But how???&lt;/p&gt;

&lt;p&gt;We'll using the Google Docs Viewer it's merely a URL which allows you to preview a document while passing the link of a file to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;iframe src="https://docs.google.com/viewer?url=[FILE_URL]&amp;amp;embedded=true"&amp;gt;&amp;lt;/iframe&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;And boom everything works again&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabsti2keieombq0jws1w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabsti2keieombq0jws1w.gif" alt=" " width="428" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
